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

split.by feature in vizualization is not working well #1660

Closed
jgarces02 opened this issue Mar 15, 2024 · 1 comment
Closed

split.by feature in vizualization is not working well #1660

jgarces02 opened this issue Mar 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jgarces02
Copy link

jgarces02 commented Mar 15, 2024

Hi. I'm having some problems with the recently added feature to split the visualization according to a second variable in the metadata. I tried it in CoveragePlot and PlotFootprint, and it crashed in both cases... I think they could be related.

Thanks in advance.

> CoveragePlot(myobject, region = "chr3-183515949-183516718", features = "KLHL6",
    extend.upstream = 1000, extend.downstream = 1000,
    split.by = "BMI_change",
    group.by = "predicted.celltype.l2_curated", idents = "CD16 Monos")
Error in `group_by()`:
! Must group by variables found in `.data`.
✖ Column `group` is not found.
Run `rlang::last_trace()` to see where the error occurred.

> PlotFootprint(myobject, label = F, features = "PAX7", 
    group.by = "predicted.celltype.l2_curated", idents = "CD16 Monos", 
    split.by = "BMI_change") + patchwork::plot_layout(ncol = 1)
Error in vector(mode = "numeric", length = npos * ngroup) :
  invalid 'length' argument

(metadata)

> head(myobject@meta.data)
                                      orig.ident nCount_RNA nFeature_RNA
1_AAACCAACAAGTTATC-1 SD-2520_1003_BL_ES_multiome       1050          700
1_AAACGCGCAGCCAGTT-1 SD-2520_1003_BL_ES_multiome       1150          732
1_AAAGCCGCAGCACGTT-1 SD-2520_1003_BL_ES_multiome       1310          940
1_AAAGCCGCAGCTACGT-1 SD-2520_1003_BL_ES_multiome       2230         1140
1_AAAGGCTCATGAGCAG-1 SD-2520_1003_BL_ES_multiome       1376          868
1_AACAAGCCAAATGCCC-1 SD-2520_1003_BL_ES_multiome       1447          940
                     nCount_ATAC nFeature_ATAC nCount_HTO nFeature_HTO
1_AAACCAACAAGTTATC-1        1594          1436       4328            8
1_AAACGCGCAGCCAGTT-1        2323          2073       2132            8
1_AAAGCCGCAGCACGTT-1        4305          3877       1870            8
1_AAAGCCGCAGCTACGT-1         629           610      12644            8
1_AAAGGCTCATGAGCAG-1        4796          4323       3675            8
1_AACAAGCCAAATGCCC-1        8913          7647       5384            8
                     percent.mt nucleosome_signal nucleosome_percentile
1_AAACCAACAAGTTATC-1  12.857143         1.4131737                  0.76
1_AAACGCGCAGCCAGTT-1   2.695652         0.7011494                  0.21
1_AAAGCCGCAGCACGTT-1   4.503817         1.5840336                  0.84
1_AAAGCCGCAGCTACGT-1  17.085202         0.9302326                  0.40
1_AAAGGCTCATGAGCAG-1  19.404070         1.7010309                  0.89
1_AACAAGCCAAATGCCC-1  21.561852         1.0244141                  0.48
                     TSS.enrichment TSS.percentile
1_AAACCAACAAGTTATC-1       4.506263           0.04
1_AAACGCGCAGCCAGTT-1       5.408545           0.20
1_AAAGCCGCAGCACGTT-1       3.785757           0.01
1_AAAGCCGCAGCTACGT-1       4.220779           0.02
1_AAAGGCTCATGAGCAG-1       4.090388           0.02
1_AACAAGCCAAATGCCC-1       4.654981           0.05
                     predicted.celltype.l2_curated  BMI_change
1_AAACCAACAAGTTATC-1                   NKs (early) weight loss
1_AAACGCGCAGCCAGTT-1                          preB weight loss
1_AAAGCCGCAGCACGTT-1                          preB weight loss
1_AAAGCCGCAGCTACGT-1                    CD14 monos weight loss
1_AAAGGCTCATGAGCAG-1                     CD8 naive weight loss
1_AACAAGCCAAATGCCC-1                          HSCs weight loss

(sessionInfo)

R version 4.3.2 (2023-10-31)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /rtsess01/juno/home/garcesj/software/miniconda3/envs/scNUTRI/lib/libopenblasp-r0.3.25.so;  LAPACK version 3.11.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] 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
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: America/New_York
tzcode source: system (glibc)

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

other attached packages:
 [1] BSgenome.Hsapiens.UCSC.hg38_1.4.5 BSgenome_1.70.1
 [3] rtracklayer_1.62.0                BiocIO_1.12.0
 [5] Biostrings_2.70.1                 XVector_0.42.0
 [7] GenomicRanges_1.54.1              GenomeInfoDb_1.38.5
 [9] IRanges_2.36.0                    S4Vectors_0.40.2
[11] motifmatchr_1.24.0                TFBSTools_1.40.0
[13] JASPAR2020_0.99.10                reshape2_1.4.4
[15] dplyr_1.1.4                       future_1.33.1
[17] ggside_0.2.3                      patchwork_1.2.0
[19] ggplot2_3.4.4                     AnnotationHub_3.10.0
[21] BiocFileCache_2.10.1              dbplyr_2.4.0
[23] BiocGenerics_0.48.1               Signac_1.12.9004
[25] Seurat_5.0.1                      SeuratObject_5.0.1
[27] sp_2.1-2

loaded via a namespace (and not attached):
  [1] RcppAnnoy_0.0.22              splines_4.3.2
  [3] later_1.3.2                   bitops_1.0-7
  [5] filelock_1.0.3                R.oo_1.26.0
  [7] tibble_3.2.1                  polyclip_1.10-6
  [9] XML_3.99-0.16.1               DirichletMultinomial_1.44.0
 [11] fastDummies_1.7.3             lifecycle_1.0.4
 [13] globals_0.16.2                lattice_0.22-5
 [15] MASS_7.3-60.0.1               magrittr_2.0.3
 [17] plotly_4.10.4                 yaml_2.3.8
 [19] httpuv_1.6.13                 sctransform_0.4.1
 [21] spam_2.10-0                   spatstat.sparse_3.0-3
 [23] reticulate_1.34.0             CNEr_1.38.0
 [25] cowplot_1.1.3                 pbapply_1.7-2
 [27] DBI_1.2.1                     RColorBrewer_1.1-3
 [29] abind_1.4-5                   zlibbioc_1.48.0
 [31] Rtsne_0.17                    R.utils_2.12.3
 [33] purrr_1.0.2                   RCurl_1.98-1.14
 [35] pracma_2.4.4                  tweenr_2.0.2
 [37] rappdirs_0.3.3                GenomeInfoDbData_1.2.11
 [39] ggrepel_0.9.5                 irlba_2.3.5.1
 [41] listenv_0.9.0                 spatstat.utils_3.0-4
 [43] seqLogo_1.68.0                goftest_1.2-3
 [45] RSpectra_0.16-1               annotate_1.80.0
 [47] spatstat.random_3.2-2         fitdistrplus_1.1-11
 [49] parallelly_1.36.0             DelayedArray_0.28.0
 [51] leiden_0.4.3.1                codetools_0.2-19
 [53] RcppRoll_0.3.0                ggforce_0.4.1
 [55] tidyselect_1.2.0              ggseqlogo_0.2
 [57] farver_2.1.1                  matrixStats_1.2.0
 [59] spatstat.explore_3.2-5        GenomicAlignments_1.38.2
 [61] jsonlite_1.8.8                ellipsis_0.3.2
 [63] progressr_0.14.0              ggridges_0.5.6
 [65] survival_3.5-7                systemfonts_1.0.5
 [67] tools_4.3.2                   ragg_1.2.7
 [69] TFMPvalue_0.0.9               ica_1.0-3
 [71] Rcpp_1.0.12                   glue_1.7.0
 [73] SparseArray_1.2.3             gridExtra_2.3
 [75] MatrixGenerics_1.14.0         withr_3.0.0
 [77] BiocManager_1.30.22           fastmap_1.1.1
 [79] fansi_1.0.6                   caTools_1.18.2
 [81] digest_0.6.34                 R6_2.5.1
 [83] mime_0.12                     textshaping_0.3.7
 [85] colorspace_2.1-0              GO.db_3.18.0
 [87] scattermore_1.2               poweRlaw_0.80.0
 [89] gtools_3.9.5                  tensor_1.5
 [91] spatstat.data_3.0-4           RSQLite_2.3.5
 [93] R.methodsS3_1.8.2             utf8_1.2.4
 [95] tidyr_1.3.1                   generics_0.1.3
 [97] data.table_1.14.10            S4Arrays_1.2.0
 [99] httr_1.4.7                    htmlwidgets_1.6.4
[101] uwot_0.1.16                   pkgconfig_2.0.3
[103] gtable_0.3.4                  blob_1.2.4
[105] lmtest_0.9-40                 htmltools_0.5.7
[107] dotCall64_1.1-1               scales_1.3.0
[109] Biobase_2.62.0                png_0.1-8
[111] tzdb_0.4.0                    rjson_0.2.21
[113] nlme_3.1-164                  curl_5.2.0
[115] zoo_1.8-12                    cachem_1.0.8
[117] stringr_1.5.1                 BiocVersion_3.18.1
[119] KernSmooth_2.23-22            parallel_4.3.2
[121] miniUI_0.1.1.1                AnnotationDbi_1.64.1
[123] restfulr_0.0.15               pillar_1.9.0
[125] grid_4.3.2                    vctrs_0.6.5
[127] RANN_2.6.1                    promises_1.2.1
[129] xtable_1.8-4                  cluster_2.1.6
[131] readr_2.1.5                   cli_3.6.2
[133] compiler_4.3.2                Rsamtools_2.18.0
[135] rlang_1.1.3                   crayon_1.5.2
[137] future.apply_1.11.1           labeling_0.4.3
[139] plyr_1.8.9                    stringi_1.8.3
[141] viridisLite_0.4.2             deldir_2.0-2
[143] BiocParallel_1.36.0           munsell_0.5.0
[145] lazyeval_0.2.2                spatstat.geom_3.2-7
[147] Matrix_1.6-5                  RcppHNSW_0.5.0
[149] hms_1.1.3                     bit64_4.0.5
[151] KEGGREST_1.42.0               shiny_1.8.0
[153] SummarizedExperiment_1.32.0   interactiveDisplayBase_1.40.0
[155] ROCR_1.0-11                   igraph_1.6.0
[157] memoise_2.0.1                 fastmatch_1.1-4
[159] bit_4.0.5
@jgarces02 jgarces02 added the bug Something isn't working label Mar 15, 2024
@timoast
Copy link
Collaborator

timoast commented Mar 28, 2024

Hi @jgarces02, thanks for the bug report. This issue was related to the combined use of idents and split.by, should now be fixed on the develop branch.

@timoast timoast closed this as completed Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants