Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write_adat function not working, even on example data that is unaltered. #18

Closed
aabarrera2 opened this issue Apr 15, 2022 · 13 comments
Closed
Labels
bug Something isn't working

Comments

@aabarrera2
Copy link

Hi Stu,

The write_adat function gives me this message , with my own data and with example data - ADAT passed checks and trapsx Attributes has only 3 entries: 'names', 'row.names', 'class'Error in mutate.soma_adat(x, blank_col = NA_character_) :
is.intact.attributes(.data) is not TRUE

whats strange is that ive called both 'is.intact.attributes' and 'is.soma_adat()'. and both are true. I know these are both requirements for write_adat.

I am just wondering if you have an idea why.
I am using data from assay version 3.2 and the !version of my file from somalogic is 1.2

@stufield
Copy link
Contributor

stufield commented Apr 15, 2022

Hi @aabarrera2 , this seems a bit like a breaking change from dplyr::mutate() v1.0.8. Can you tell me which version of dplyr you are using and which version of SomaDataIO?
The most recent version of SomaDataIO (v5.3.0) has a bugifx for this specific issue. So updating (if you're not on it already) will likely solve this.
The reason your attributes are intact outside the write_adat() call is that they are initially ok, but internally mutate() breaks them, then you get the error that they're broken (attributes are required to regenerate the Header information of the ADAT when you write it to file).
BTW: the new SomaDataIO v5.3.0 doesn't even use dplyr::mutate() anymore, so this issue will simply go away, even without the bugfix.

@aabarrera2
Copy link
Author

aabarrera2 commented Apr 18, 2022 via email

@stufield
Copy link
Contributor

stufield commented Apr 18, 2022

So you're trying to read in an ADAT with v5.3.0 code that was written with < v5.3.0 code? Correct?
I think it would be best to re-create the joined ADAT from scratch, with v5.3.0 code so that you're not crossing versions.
Without a proper reprex I'm not sure I'll be able to reproduce the error on my end, especially since we don't use scan() anywhere in SomaDataIO. Are you calling it somewhere and getting this error?

To try: back rev to the version of SomaDataIO used to write the modified ADAT, can read_adat() parse that one?

@stufield stufield added the bug Something isn't working label Apr 22, 2022
@stufield
Copy link
Contributor

This reproduces the scan() bug. Likely an alignment issue in write_adat()

example_data |>
  head() |>
  dplyr::select(SlideId, Subarray, Sex, seq.10000.28, seq.10001.7) |> 
  write_adat("out.adat")
foo <- read_adat("out.adat")

@aabarrera2
Copy link
Author

aabarrera2 commented Apr 22, 2022 via email

@stufield
Copy link
Contributor

stufield commented Apr 22, 2022

@aabarrera2 , there's a nice example in the README for how we suggest performing a simple 2-group analysis. Might be a good resource for you to follow as a template for your data. See the section on 2 group t-test analyses.

@KirkDSL
Copy link

KirkDSL commented Apr 22, 2022

If your analysis is a simple 2-group analysis (e.g., t-test), you may be able to use our Statistics and Data Visualization software here: https://somalogic.com/statistical-analysis-tool/

Here's the link to the User's Guide describing what functionality the tool provides: https://stats.somalogic.com/userguide/

@aabarrera2
Copy link
Author

aabarrera2 commented Apr 22, 2022 via email

@KirkDSL
Copy link

KirkDSL commented Apr 22, 2022

I'm glad you were able to use the tools successfully! Unfortunately, simple analyses is where it stops. More sophisticated analyses definitely require writing code, as you are doing now. Hopefully we'll be able to add more functionality to the tool.

@aabarrera2
Copy link
Author

aabarrera2 commented Oct 11, 2022 via email

@stufield
Copy link
Contributor

Hi @aabarrera2 ,

This appears to be the same error as the original post correct?
Can you confirm which version of SomaDataIO you are using to generate this error?
SomaDataIO v5.3.0 should contain the bug, but it was fixed (I believe) as a result of this issue, so it should be fixed in the current HEAD of the GitHub repository (i.e. the development version).
As an aside, I am currently working on freezing the package where it stands into a bugfix v5.3.1 version to incorporate this bugfix into a frozen version.

If you could confirm the development fixes this issue I would appreciate it.
Thanks!

Stu

@aabarrera2
Copy link
Author

aabarrera2 commented Oct 11, 2022 via email

@stufield
Copy link
Contributor

I believe it automatically closed when the bugfix was merged. All good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants