-
Notifications
You must be signed in to change notification settings - Fork 444
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
Fix ampvis2 NA in metadata error #6213
Fix ampvis2 NA in metadata error #6213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the initiative. Would be cool to add a corresponding test.
tools/ampvis2/macros.xml
Outdated
@@ -49,6 +49,7 @@ echo $(R --version | grep "R version")", ampvis2 version" $(R --vanilla --slave | |||
## the additional column in the ist file can the be used | |||
## to filter SampleIDs from select inputs | |||
## (check for character columns only .. since data in the column is otherwise converted to the corresponding type .. which fails) | |||
data\$metadata[is.na(data\$metadata)] <- "NA" ##the comparison fails if NA values are present, see https://stackoverflow.com/questions/7355187/error-in-if-while-condition-missing-value-where-true-false-needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do this in the for loop?
What is data\$metadata[is.na(data\$metadata)]
actually doing? Guess some subsetting. Intuitively I would have expected the negation of is.na
(but its R, i.e. it might be unintuitive) .. also my question would be if we need to modify anything else in data
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You are right, this can be fixed outside the loop
data\$metadata[is.na(data\$metadata)]
selects all cells which are NA- I think the data can be untouched, as only the metadata is changed, but if it should be changed to as string as "NA" or undefined or something - I am not sure - the user should probably be warned that the metadata will be modified
@bernt-matthias ok from your side? |
Yep. I enabled automerge. Can someone restart tests. I only have my mobile until end of the month. |
Thanks @paulzierep |
* fix NA * bump version * added test and improved the fix
If there are NA values in the metadata, the subset tool fails with:
Fixed by setting the values to "NA".
@bernt-matthias any suggestion ?