LTLA / scuttle

Clone of the Bioconductor repository for the scuttle package.
https://bioconductor.org/packages/devel/bioc/html/scuttle.html
9 stars 7 forks source link

Column names of perCellQCMetrics output vary depending on how use.altexps supplied #3

Closed PeteHaitch closed 3 years ago

PeteHaitch commented 3 years ago

It seems the names get mangled if use.altexps is supplied as a character vector.

suppressPackageStartupMessages(library(scuttle))
sce <- mockSCE()
# 'altexps_Spikes_detected' etc.
perCellQCMetrics(sce, use.altexps = 1)
#> DataFrame with 200 rows and 6 columns
#>                sum  detected altexps_Spikes_sum altexps_Spikes_detected
#>          <numeric> <numeric>          <numeric>               <numeric>
#> Cell_001    387078      1502               8417                      87
#> Cell_002    383884      1503               6064                      80
#> Cell_003    371396      1514               7983                      75
#> Cell_004    375663      1505               7290                      67
#> Cell_005    375371      1525               7609                      77
#> ...            ...       ...                ...                     ...
#> Cell_196    366651      1510               7406                      70
#> Cell_197    366926      1491               5171                      79
#> Cell_198    361263      1506               8073                      76
#> Cell_199    384181      1544               6991                      77
#> Cell_200    359864      1489               7689                      81
#>          altexps_Spikes_percent     total
#>                       <numeric> <numeric>
#> Cell_001                2.12822    395495
#> Cell_002                1.55508    389948
#> Cell_003                2.10423    379379
#> Cell_004                1.90363    382953
#> Cell_005                1.98679    382980
#> ...                         ...       ...
#> Cell_196                1.97991    374057
#> Cell_197                1.38969    372097
#> Cell_198                2.18581    369336
#> Cell_199                1.78719    391172
#> Cell_200                2.09194    367553
# 'altexps_NA_detected' etc.
perCellQCMetrics(sce, use.altexps = "Spikes")
#> DataFrame with 200 rows and 6 columns
#>                sum  detected altexps_NA_sum altexps_NA_detected
#>          <numeric> <numeric>      <numeric>           <numeric>
#> Cell_001    387078      1502           8417                  87
#> Cell_002    383884      1503           6064                  80
#> Cell_003    371396      1514           7983                  75
#> Cell_004    375663      1505           7290                  67
#> Cell_005    375371      1525           7609                  77
#> ...            ...       ...            ...                 ...
#> Cell_196    366651      1510           7406                  70
#> Cell_197    366926      1491           5171                  79
#> Cell_198    361263      1506           8073                  76
#> Cell_199    384181      1544           6991                  77
#> Cell_200    359864      1489           7689                  81
#>          altexps_NA_percent     total
#>                   <numeric> <numeric>
#> Cell_001            2.12822    395495
#> Cell_002            1.55508    389948
#> Cell_003            2.10423    379379
#> Cell_004            1.90363    382953
#> Cell_005            1.98679    382980
#> ...                     ...       ...
#> Cell_196            1.97991    374057
#> Cell_197            1.38969    372097
#> Cell_198            2.18581    369336
#> Cell_199            1.78719    391172
#> Cell_200            2.09194    367553

Created on 2020-12-17 by the reprex package (v0.3.0)

Session info ``` r sessionInfo() #> R version 4.0.0 (2020-04-24) #> Platform: x86_64-pc-linux-gnu (64-bit) #> Running under: Ubuntu 18.04.5 LTS #> #> Matrix products: default #> BLAS/LAPACK: /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64_lin/libmkl_rt.so #> #> locale: #> [1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C #> [3] LC_TIME=en_AU.UTF-8 LC_COLLATE=en_AU.UTF-8 #> [5] LC_MONETARY=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8 #> [7] LC_PAPER=en_AU.UTF-8 LC_NAME=C #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C #> #> attached base packages: #> [1] parallel stats4 stats graphics grDevices utils datasets #> [8] methods base #> #> other attached packages: #> [1] scuttle_1.0.3 SingleCellExperiment_1.12.0 #> [3] SummarizedExperiment_1.20.0 Biobase_2.50.0 #> [5] GenomicRanges_1.42.0 GenomeInfoDb_1.26.2 #> [7] IRanges_2.24.0 S4Vectors_0.28.1 #> [9] BiocGenerics_0.36.0 MatrixGenerics_1.2.0 #> [11] matrixStats_0.57.0 #> #> loaded via a namespace (and not attached): #> [1] Rcpp_1.0.5 knitr_1.30 #> [3] XVector_0.30.0 magrittr_2.0.1 #> [5] zlibbioc_1.36.0 BiocParallel_1.24.1 #> [7] lattice_0.20-41 rlang_0.4.9 #> [9] stringr_1.4.0 highr_0.8 #> [11] sparseMatrixStats_1.2.0 DelayedMatrixStats_1.12.1 #> [13] tools_4.0.0 grid_4.0.0 #> [15] xfun_0.19 htmltools_0.5.0 #> [17] yaml_2.2.1 digest_0.6.27 #> [19] Matrix_1.2-18 GenomeInfoDbData_1.2.4 #> [21] bitops_1.0-6 RCurl_1.98-1.2 #> [23] evaluate_0.14 rmarkdown_2.5 #> [25] DelayedArray_0.16.0 stringi_1.5.3 #> [27] compiler_4.0.0 beachmat_2.6.2 ```
LTLA commented 3 years ago

Thanks, this should be fixed in db64be8dbc54e2328316390070d8eaea4bad2b64.