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

Footprint with ident subsetting and grouping returns error #641

Closed
Connorr0 opened this issue Jun 1, 2021 · 4 comments
Closed

Footprint with ident subsetting and grouping returns error #641

Connorr0 opened this issue Jun 1, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@Connorr0
Copy link

Connorr0 commented Jun 1, 2021

I am not sure if this is a bug or a feature request. Since the documentation implied that this should work I put it in as a bug.

I was hoping to take a subset of cells (Progenitors), split them by dataset of origin, then plot a footprint.

To do this I ran the following code:

Idents(d89_footprint) = d89_footprint$int_type # to get cell types
PlotFootprint(d89_footprint, features = "ATOH7", 
    idents = "Progenitors", 
    group.by = "orig.ident")

I then got this error:
Error in vector(mode = "numeric", length = npos * ngroup) : invalid 'length' argument

Individually the following plots work fine:

PlotFootprint(d89_footprint, features = "ATOH7", group.by = "orig.ident")
PlotFootprint(d89_footprint, features = "ATOH7", idents = "Progenitors")

Also, the table command shows that I should have cells for the groups I was looking for:

> table(d89_footprint$orig.ident, d89_footprint$int_type)

       Progenitors ...
  dxx        2889     ...
  dyy        3787     ...

Is there a way to do this that does not involve rerunning footprints on the subset?

Thanks for the help, awesome package!

> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
 [1] RColorBrewer_1.1-2 Matrix_1.2-18      plotly_4.9.3       ggplot2_3.3.3     
 [5] pheatmap_1.0.12    stringr_1.4.0      dplyr_1.0.5        Signac_1.2.0      
 [9] SeuratObject_4.0.0 Seurat_4.0.1      

loaded via a namespace (and not attached):
  [1] Rtsne_0.15             colorspace_2.0-1       deldir_0.2-10         
  [4] ellipsis_0.3.2         ggridges_0.5.3         lsa_0.73.2            
  [7] XVector_0.30.0         GenomicRanges_1.42.0   rstudioapi_0.13       
 [10] spatstat.data_2.1-0    farver_2.1.0           leiden_0.3.7          
 [13] listenv_0.8.0          SnowballC_0.7.0        ggrepel_0.9.1         
 [16] fansi_0.4.2            codetools_0.2-18       splines_4.0.5         
 [19] docopt_0.7.1           knitr_1.33             RcppRoll_0.3.0        
 [22] polyclip_1.10-0        jsonlite_1.7.2         Rsamtools_2.6.0       
 [25] ica_1.0-2              cluster_2.1.2          png_0.1-7             
 [28] uwot_0.1.10            ggforce_0.3.3          shiny_1.6.0           
 [31] sctransform_0.3.2      spatstat.sparse_2.0-0  compiler_4.0.5        
 [34] httr_1.4.2             assertthat_0.2.1       fastmap_1.1.0         
 [37] lazyeval_0.2.2         tweenr_1.0.2           later_1.2.0           
 [40] htmltools_0.5.1.1      tools_4.0.5            igraph_1.2.6          
 [43] gtable_0.3.0           glue_1.4.2             GenomeInfoDbData_1.2.4
 [46] RANN_2.6.1             reshape2_1.4.4         fastmatch_1.1-0       
 [49] Rcpp_1.0.6             slam_0.1-48            scattermore_0.7       
 [52] Biostrings_2.58.0      vctrs_0.3.8            nlme_3.1-152          
 [55] ggseqlogo_0.1          lmtest_0.9-38          xfun_0.22             
 [58] globals_0.14.0         mime_0.10              miniUI_0.1.1.1        
 [61] lifecycle_1.0.0        irlba_2.3.3            goftest_1.2-2         
 [64] future_1.21.0          MASS_7.3-54            zlibbioc_1.36.0       
 [67] zoo_1.8-9              scales_1.1.1           spatstat.core_2.1-2   
 [70] promises_1.2.0.1       spatstat.utils_2.1-0   parallel_4.0.5        
 [73] reticulate_1.20        pbapply_1.4-3          gridExtra_2.3         
 [76] rpart_4.1-15           stringi_1.5.3          S4Vectors_0.28.1      
 [79] BiocGenerics_0.36.1    BiocParallel_1.24.1    GenomeInfoDb_1.26.7   
 [82] rlang_0.4.11           pkgconfig_2.0.3        matrixStats_0.58.0    
 [85] bitops_1.0-7           qlcMatrix_0.9.7        lattice_0.20-44       
 [88] ROCR_1.0-11            purrr_0.3.4            tensor_1.5            
 [91] labeling_0.4.2         patchwork_1.1.1        htmlwidgets_1.5.3     
 [94] cowplot_1.1.1          tidyselect_1.1.1       parallelly_1.25.0     
 [97] RcppAnnoy_0.0.18       plyr_1.8.6             magrittr_2.0.1        
[100] R6_2.5.0               IRanges_2.24.1         generics_0.1.0        
[103] DBI_1.1.1              withr_2.4.2            pillar_1.6.1          
[106] mgcv_1.8-35            fitdistrplus_1.1-3     survival_3.2-11       
[109] abind_1.4-5            RCurl_1.98-1.3         tibble_3.1.1          
[112] future.apply_1.7.0     crayon_1.4.1           KernSmooth_2.23-20    
[115] utf8_1.2.1             spatstat.geom_2.1-0    viridis_0.6.0         
[118] grid_4.0.5             data.table_1.14.0      sparsesvd_0.2         
[121] digest_0.6.27          xtable_1.8-4           tidyr_1.1.3           
[124] httpuv_1.6.0           stats4_4.0.5           munsell_0.5.0         
[127] viridisLite_0.4.0
@Connorr0 Connorr0 added the bug Something isn't working label Jun 1, 2021
@timoast
Copy link
Collaborator

timoast commented Jun 2, 2021

Is Progenitors in orig.ident? It looks like orig.ident only contains dxx and dyy

@timoast
Copy link
Collaborator

timoast commented Jun 2, 2021

I think what you're asking is for the ability to subset idents using one set of metadata, and the group cells in the subset using a second set of metadata. This is similar to combining the split.by and group.by parameters in some other Seurat functions (DimPlot for example), but we have not implemented split.by for PlotFootprint() yet. I think this is a feature request rather than a bug.

@timoast timoast added enhancement New feature or request and removed bug Something isn't working labels Jun 2, 2021
@timoast
Copy link
Collaborator

timoast commented Jun 2, 2021

Actually we already have a feature request for this: #523

@timoast timoast closed this as completed Jun 2, 2021
@lucinda-paddock
Copy link

@Connorr0 I'm trying to do the same thing with my own data—did you ever find a way to plot footprints of a particular subset of cells without rerunning the footprint function on the subset?
(also seconded, would love split.by in the PlotFootprint() function)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants