-
Notifications
You must be signed in to change notification settings - Fork 34
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
Changes in subsetByColData between in 3.14 #303
Comments
Hi Dawid, @gogonzo We've increased the efficiency of the subsetting operation by cleaning up some of the code and resolving an issue with multiple subsequent subsets. We directly pass along the subset vector to the In the meantime, you can definitely use a more complete subset vector, e.g.,
Best regards, |
@LiNk-NY object[c(1, NA), ]
# Sepal.Length Sepal.Width Petal.Length Petal.Width Species
# 1 5.1 3.5 1.4 0.2 setosa
# NA NA NA NA NA <NA> I believe problem lays in var <- c(T, NA, rep(F, 148))
subset(iris, var)
# Sepal.Length Sepal.Width Petal.Length Petal.Width Species
# 1 5.1 3.5 1.4 0.2 setosa Do you agree or disagree? |
We are not following the In order to make the handling of Best, |
Hi @LiNk-NY thank you for the answer. I still think that problem lays in MAE, I'm even more sure now about this. There are still problems with the S4Vector which I have reported but it's not case for the library(MultiAssayExperiment)
# S4Vectors and MultiAssayExperiment
DF <- miniACC@colData
subset(DF, race %in% c())
DF[DF$race %in% c(), ]
subsetByColData(miniACC, DF$race %in% c())
# base R
df <- data.frame(a = c(1, NA, 3), b = 1:3)
subset(df, a %in% c())
df[df$a %in% c(), ] However, MAE failed to cover the case didn't fail in # S4Vectors and MultiAssayExperiment
subset(DF, race == "white") #
DF[DF$race == "white", ] # error - reported in S4Vectors
subsetByColData(miniACC, DF$race == "white") # error
# base R
df[df$a > 0, ] # return includes NAs
subset(df, a > 0) # omits NA I fully understand the reason - it's because MultiAssayExperiment/R/subsetBy-methods.R Line 264 in f256a29
This line is the reason of the failure, and I wouldn't expect S4Vectors to fix this issue, because it should rather be like I've proposed below or in the first comment. newcoldata <- coldata[y & !is.na(y), , drop = FALSE] I can even help you to make a PR if you agree. Regards, |
There is a general misconception that The removal of As above, we can consider adding an Best regards, |
Ok, forget the whole discussion. +1 to Regards, |
Hi there,
I spotted changes in version for Bioc 3.14 when using
subsetByColData
. Code below used to work but now it throws an errorPreviously it went fine because function use to handle
NA
in the condition. I think previous state was what user expects. See the definition ofsubset.data.frame
where you can noticer & !is.na(r)
which excludesNA
from the subsetting operation.I think that the problem lays in this line
MultiAssayExperiment/R/subsetBy-methods.R
Line 264 in f256a29
which I believe can be modified to
What do you think?
Regards,
Dawid Kaledkowski
The text was updated successfully, but these errors were encountered: