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

Unable to use correctExperiments with 'subset.row=' defined #32

Closed
ycl6 opened this issue Oct 5, 2021 · 4 comments
Closed

Unable to use correctExperiments with 'subset.row=' defined #32

ycl6 opened this issue Oct 5, 2021 · 4 comments

Comments

@ycl6
Copy link

ycl6 commented Oct 5, 2021

Hi,

There is a problem using correctExperiments with subset.row= flag to subset assays to the defined genes. I am using the function on a list of SingleCellExperiments.

if (!is.null(subset.row) && !correct.all) {
raw.ass <- lapply(raw.ass, "[", i=subset.row, , drop=FALSE)
}

Error in eval(subscript, envir = eframe, enclos = eframe): '...' used in an incorrect context
Traceback:

1. lapply(raw.ass, "[", i = subset.row, , drop = FALSE)
2. lapply(raw.ass, "[", i = subset.row, , drop = FALSE)
3. FUN(X[[i]], ...)
4. FUN(X[[i]], ...)
5. extract_Nindex_from_syscall(sys.call(), parent.frame())
6. lapply(seq_len(length(call) - 2L), function(i) {
 .     subscript <- call[[2L + i]]
 .     if (missing(subscript)) 
 .         return(NULL)
 .     subscript <- eval(subscript, envir = eframe, enclos = eframe)
 .     if (is.null(subscript)) 
 .         return(integer(0))
 .     subscript
 . })
7. lapply(seq_len(length(call) - 2L), function(i) {
 .     subscript <- call[[2L + i]]
 .     if (missing(subscript)) 
 .         return(NULL)
 .     subscript <- eval(subscript, envir = eframe, enclos = eframe)
 .     if (is.null(subscript)) 
 .         return(integer(0))
 .     subscript
 . })
8. FUN(X[[i]], ...)
9. eval(subscript, envir = eframe, enclos = eframe)
10. eval(subscript, envir = eframe, enclos = eframe)
11. eval(subscript, envir = eframe, enclos = eframe)

I propose changed it as below and that should work.

        if (!is.null(subset.row) && !correct.all) {
            raw.ass <- lapply(raw.ass, function(x) x[subset.row,,drop=FALSE])
        }
R version 4.1.0 (2021-05-18)
batchelor_1.8.0
@LTLA
Copy link
Owner

LTLA commented Oct 7, 2021

This seems like a problem with DelayedArray rather than batchelor, see Bioconductor/DelayedArray#97.

@ycl6
Copy link
Author

ycl6 commented Oct 8, 2021

Thanks @LTLA , hope that either DelayedArray or batchelor is fixed for the function to work properly.

@MerRome
Copy link

MerRome commented May 24, 2022

Hello,

I am still observing the same problem with batchelor_1.12.0 and DelayedArray version 0.22.0, do you have any suggestions or workarounds?

Thanks for your time!
Merrit

@LTLA LTLA closed this as completed in 51f8b0b May 25, 2022
@LTLA
Copy link
Owner

LTLA commented May 25, 2022

Gave up waiting for DelayedArray to fix it so I just patched it on correctExperiments's end.

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

No branches or pull requests

3 participants