Filter by colData value
1
0
Entering edit mode
marc.tormo • 0
@marctormo-23189
Last seen 2.5 years ago
UPF (Barcelona)

Hi,

I'm having some troubles trying to filter a SingleCellLoomExperiment object by its colData. I made a subset with 100 columns , an I want to filter by the variable Tissue in colData to be equal than "DRG".

Does anyone know what I'm doing wrong? Many thanks!

> scle.all
class: SingleCellLoomExperiment 
dim: 27998 100 
metadata(0):
assays(2): matrix logcounts
rownames(27998): Cbln2 Ptchd2 ... Med27 Psmc6
rowData names(7): Accession Gene ... X_Total X_Valid
colnames(100): Enteric neurons Enteric neurons ... Enteric neurons
  Enteric neurons
colData names(127): Age AnalysisPool ... cDNA_Lib_Ok ngperul_cDNA
reducedDimNames(0):
spikeNames(0):
altExpNames(0):
rowGraphs(0): NULL
colGraphs(2): KNN MKNN

> table(colData(scle.all.drg)$Tissue)
DRG  XX 
 50  50 

> scle.all.drg <- scle.all[,colData(scle.all)$Tissue == "DRG"]
Error in validObject(.Object) : invalid class ?SelfHits? object: 1: 
    'from(x)' must contain non-NA values >= 1 and <= 'nLnode(x)'
invalid class ?SelfHits? object: 2: 
    'to(x)' must contain non-NA values >= 1 and <= 'nRnode(x)'

sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

locale:
[1] en_US.UTF-8

attached base packages:
 [1] grid      parallel  stats4    stats     graphics  grDevices utils    
 [8] datasets  methods   base     

other attached packages:
 [1] rmarkdown_2.1               DESeq2_1.26.0              
 [3] LoomExperiment_1.4.0        rtracklayer_1.46.0         
 [5] rhdf5_2.30.0                SingleR_1.0.5              
 [7] pheatmap_1.0.12             xlsx_0.6.3                 
 [9] AUCell_1.8.0                GSEABase_1.48.0            
[11] graph_1.64.0                annotate_1.64.0            
[13] XML_3.99-0.3                AnnotationDbi_1.48.0       
[15] gridExtra_2.3               edgeR_3.28.0               
[17] limma_3.42.0                Rtsne_0.15                 
[19] scran_1.14.1                scater_1.14.0              
[21] ggplot2_3.3.0               SingleCellExperiment_1.8.0 
[23] SummarizedExperiment_1.16.1 DelayedArray_0.12.2        
[25] BiocParallel_1.20.1         matrixStats_0.56.0         
[27] Biobase_2.46.0              GenomicRanges_1.38.0       
[29] GenomeInfoDb_1.22.0         IRanges_2.20.2             
[31] S4Vectors_0.24.3            BiocGenerics_0.32.0        

loaded via a namespace (and not attached):
  [1] backports_1.1.5               Hmisc_4.4-0                  
  [3] AnnotationHub_2.18.0          BiocFileCache_1.10.2         
  [5] igraph_1.2.4.2                splines_3.6.1                
  [7] digest_0.6.25                 htmltools_0.4.0              
  [9] viridis_0.5.1                 magrittr_1.5                 
 [11] checkmate_2.0.0               memoise_1.1.0                
 [13] cluster_2.1.0                 Biostrings_2.54.0            
 [15] R.utils_2.9.2                 jpeg_0.1-8.1                 
 [17] colorspace_1.4-1              blob_1.2.1                   
 [19] rappdirs_0.3.1                xfun_0.12                    
 [21] dplyr_0.8.5                   crayon_1.3.4                 
 [23] RCurl_1.98-1.1                genefilter_1.68.0            
 [25] survival_3.1-11               glue_1.3.2                   
 [27] gtable_0.3.0                  zlibbioc_1.32.0              
 [29] XVector_0.26.0                BiocSingular_1.2.0           
 [31] Rhdf5lib_1.8.0                HDF5Array_1.14.0             
 [33] scales_1.1.0                  DBI_1.1.0                    
 [35] Rcpp_1.0.4                    viridisLite_0.3.0            
 [37] xtable_1.8-4                  htmlTable_1.13.3             
 [39] dqrng_0.2.1                   foreign_0.8-76               
 [41] bit_1.1-15.2                  rsvd_1.0.3                   
 [43] Formula_1.2-3                 htmlwidgets_1.5.1            
 [45] httr_1.4.1                    RColorBrewer_1.1-2           
 [47] acepack_1.4.1                 farver_2.0.3                 
 [49] pkgconfig_2.0.3               rJava_0.9-11                 
 [51] R.methodsS3_1.8.0             nnet_7.3-13                  
 [53] dbplyr_1.4.2                  locfit_1.5-9.1               
 [55] tidyselect_1.0.0              rlang_0.4.5                  
 [57] later_1.0.0                   munsell_0.5.0                
 [59] BiocVersion_3.10.1            tools_3.6.1                  
 [61] RSQLite_2.2.0                 ExperimentHub_1.12.0         
 [63] evaluate_0.14                 stringr_1.4.0                
 [65] fastmap_1.0.1                 yaml_2.2.1                   
 [67] knitr_1.28                    bit64_0.9-7                  
 [69] purrr_0.3.3                   mime_0.9                     
 [71] R.oo_1.23.0                   compiler_3.6.1               
 [73] rstudioapi_0.11               beeswarm_0.2.3               
 [75] curl_4.3                      png_0.1-7                    
 [77] interactiveDisplayBase_1.24.0 geneplotter_1.64.0           
 [79] tibble_2.1.3                  statmod_1.4.34               
 [81] stringi_1.4.6                 lattice_0.20-40              
 [83] Matrix_1.2-18                 vctrs_0.2.4                  
 [85] pillar_1.4.3                  lifecycle_0.2.0              
 [87] BiocManager_1.30.10           BiocNeighbors_1.4.0          
 [89] data.table_1.12.8             bitops_1.0-6                 
 [91] irlba_2.3.3                   httpuv_1.5.2                 
 [93] R6_2.4.1                      latticeExtra_0.6-29          
 [95] promises_1.1.0                vipor_0.4.5                  
 [97] assertthat_0.2.1              xlsxjars_0.6.1               
 [99] withr_2.1.2                   GenomicAlignments_1.22.1     
[101] Rsamtools_2.2.3               GenomeInfoDbData_1.2.2       
[103] rpart_4.1-15                  DelayedMatrixStats_1.8.0     
[105] shiny_1.4.0.2                 base64enc_0.1-3              
[107] ggbeeswarm_0.6.0      
SingleCellLoomExperiment • 1.1k views
ADD COMMENT
0
Entering edit mode

This can be made reproducible with

library(LoomExperiment)
example(LoomExperiment)
colData(scle)$foo = sample(c("A", "B"), ncol(scle), replace = TRUE)
scle[,scle$foo == "A"]
Error in validObject(.Object) : invalid class "SelfHits" object: 1:
    'nLnode(x)' must be a single non-negative integer
invalid class "SelfHits" object: 2:
    'nRnode(x)' must be a single non-negative integer
invalid class "SelfHits" object: 3:
    'from(x)' must contain non-NA values >= 1 and <= 'nLnode(x)'
invalid class "SelfHits" object: 4:
    'to(x)' must contain non-NA values >= 1 and <= 'nRnode(x)'

So this looks like a (serious) bug in LoomExperiment

> sessionInfo()
R version 4.0.0 alpha (2020-04-07 r78168)
Platform: x86_64-apple-darwin17.7.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS:   /Users/ma38727/bin/R-4-0-branch/lib/libRblas.dylib
LAPACK: /Users/ma38727/bin/R-4-0-branch/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets
[8] methods   base

other attached packages:
 [1] LoomExperiment_1.5.2        rtracklayer_1.47.0
 [3] rhdf5_2.31.10               SingleCellExperiment_1.9.3
 [5] SummarizedExperiment_1.17.5 DelayedArray_0.13.12
 [7] matrixStats_0.56.0          Biobase_2.47.3
 [9] GenomicRanges_1.39.3        GenomeInfoDb_1.23.17
[11] IRanges_2.21.8              S4Vectors_0.25.15
[13] BiocGenerics_0.33.3

loaded via a namespace (and not attached):
 [1] magrittr_1.5             XVector_0.27.2           GenomicAlignments_1.23.2
 [4] zlibbioc_1.33.1          BiocParallel_1.21.2      lattice_0.20-41
 [7] stringr_1.4.0            tools_4.0.0              grid_4.0.0
[10] HDF5Array_1.15.18        crayon_1.3.4             Matrix_1.2-18
[13] GenomeInfoDbData_1.2.3   Rhdf5lib_1.9.3           bitops_1.0-6
[16] RCurl_1.98-1.2           stringi_1.4.6            compiler_4.0.0
[19] Biostrings_2.55.7        Rsamtools_2.3.7          XML_3.99-0.3

> BiocManager::valid()
[1] TRUE
ADD REPLY
0
Entering edit mode

Thanks Martin,

I don't know how to report a bug through Bioconductor, sorry.

ADD REPLY
0
Entering edit mode
@danielvantwisk-13028
Last seen 4.4 years ago

We've pushed a change to LoomExperiment that is available in the upcoming Biocondcutor 3.11 release that addresses the issue using Martin Morgan's example. Please let us no if this problem persists.

ADD COMMENT
0
Entering edit mode

See LoomExperiment version 1.5.3

ADD REPLY
0
Entering edit mode

Thanks, it works now

ADD REPLY

Login before adding your answer.

Traffic: 718 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6