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

featureCV ignores its na.rm argument #67

Merged
merged 3 commits into from
Dec 12, 2015
Merged

featureCV ignores its na.rm argument #67

merged 3 commits into from
Dec 12, 2015

Conversation

sgibb
Copy link
Collaborator

@sgibb sgibb commented Dec 12, 2015

While creating the MSnSets for the synapter objects I recognized NAs in the CV column. The NAs even survive na.rm=TRUE:

MWE:

library("MSnbase")
data(msnset)
msnset <- msnset[41:43]
featureCV(msnset, factor(rep(1, nrow(msnset))), na.rm=FALSE)
#   CV.iTRAQ4.114 CV.iTRAQ4.115 CV.iTRAQ4.116 CV.iTRAQ4.117
#1     0.4695498     0.2907382            NA     0.5489767
featureCV(msnset, factor(rep(1, nrow(msnset))), na.rm=TRUE)
#   CV.iTRAQ4.114 CV.iTRAQ4.115 CV.iTRAQ4.116 CV.iTRAQ4.117
#1     0.4695498     0.2907382            NA     0.5489767

expected output:

featureCV(msnset, factor(rep(1, nrow(msnset))), na.rm=TRUE)
#   CV.iTRAQ4.114 CV.iTRAQ4.115 CV.iTRAQ4.116 CV.iTRAQ4.117
#1     0.4695498     0.2907382     0.4233534     0.5489767

I have rewritten the featureCV to fix this bug and to speed up the calculation a little bit (because of less loops).

I opened this PR because there are some failing unit tests (because my pRolocdata is too old) but I can't download a newer version now. Maybe you could have a look and run the tests.

lgatto pushed a commit that referenced this pull request Dec 12, 2015
featureCV ignores its na.rm argument
@lgatto lgatto merged commit d9c1e27 into master Dec 12, 2015
@sgibb sgibb deleted the featureCV branch December 14, 2015 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants