-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hi all,
I have been playing around with LoomExperiment and comparing the colGraphs functionality to SingleCellExperiment::colPairs.
I noticed a potential issue when subsetting a SingleCellLoomExperiment. Using the example file, I can see, that the 6th cell is connected to itself and the first cell (among others). The first cell is connected with the 6th cell but not itself (among others). Therefore scle[,c(1,6)] and scle[,c(6,1)] should return different edge lists in form of colGraphs entries. However:
library(LoomExperiment)
l1_file <-
system.file("extdata", "L1_DRG_20_example.loom", package = "LoomExperiment")
scle <- import(l1_file, type="SingleCellLoomExperiment")
scle
ind <- c(1, 6)
scle2 <- scle[,ind]
colGraphs(scle2)[[1]]
returns
LoomGraph object with 3 hits and 1 metadata column:
from to | w
<integer> <integer> | <numeric>
[1] 2 1 | 0.0714286
[2] 1 2 | 0.0188679
[3] 2 2 | 0.0406144
-------
nnode: 2
and
ind <- c(6, 1)
scle2 <- scle[,ind]
colGraphs(scle2)[[1]]
returns
LoomGraph object with 3 hits and 1 metadata column:
from to | w
<integer> <integer> | <numeric>
[1] 2 1 | 0.0714286
[2] 1 2 | 0.0188679
[3] 2 2 | 0.0406144
-------
nnode: 2
When converting the SCLE into an SCE object, the subsetting operation works as expected:
library(SingleCellExperiment)
sce <- as(scle, "SingleCellExperiment")
colPair(sce, "KNN") <- as(colGraphs(scle)[[1]], "SelfHits")
ind <- c(6, 1)
sce2 <- sce[,ind]
colPair(sce2, "KNN")
which returns
SelfHits object with 3 hits and 1 metadata column:
from to | w
<integer> <integer> | <numeric>
[1] 1 1 | 0.0406144
[2] 1 2 | 0.0714286
[3] 2 1 | 0.0188679
-------
nnode: 2
This is my session info:
R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Red Hat Enterprise Linux 8.8 (Ootpa)
Matrix products: default
BLAS/LAPACK: FlexiBLAS OPENBLAS; LAPACK version 3.11.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Europe/Zurich
tzcode source: system (glibc)
attached base packages:
[1] stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] LoomExperiment_1.24.0 BiocIO_1.16.0 rhdf5_2.50.2 SingleCellExperiment_1.28.1
[5] SummarizedExperiment_1.36.0 Biobase_2.66.0 GenomicRanges_1.58.0 GenomeInfoDb_1.42.3
[9] IRanges_2.40.1 MatrixGenerics_1.18.1 matrixStats_1.5.0 S4Vectors_0.44.0
[13] BiocGenerics_0.52.0 workflowr_1.7.1
loaded via a namespace (and not attached):
[1] SparseArray_1.6.2 stringi_1.8.4 lattice_0.22-6 digest_0.6.37 magrittr_2.0.3
[6] evaluate_1.0.3 grid_4.4.1 fastmap_1.2.0 rprojroot_2.0.4 jsonlite_1.9.1
[11] Matrix_1.7-2 processx_3.8.6 whisker_0.4.1 ps_1.9.0 promises_1.3.2
[16] httr_1.4.7 UCSC.utils_1.2.0 HDF5Array_1.34.0 abind_1.4-8 cli_3.6.3
[21] rlang_1.1.6 crayon_1.5.3 XVector_0.46.0 DelayedArray_0.32.0 yaml_2.3.10
[26] S4Arrays_1.6.0 tools_4.4.1 Rhdf5lib_1.28.0 httpuv_1.6.15 GenomeInfoDbData_1.2.13
[31] R6_2.6.1 lifecycle_1.0.4 git2r_0.36.2 zlibbioc_1.52.0 stringr_1.5.1
[36] fs_1.6.6 callr_3.7.6 later_1.4.2 glue_1.8.0 Rcpp_1.0.14
[41] xfun_0.50 rhdf5filters_1.18.1 rstudioapi_0.17.1 knitr_1.49 htmltools_0.5.8.1
[46] rmarkdown_2.29 compiler_4.4.1 getPass_0.2-4
Metadata
Metadata
Assignees
Labels
No labels