stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
327 stars 88 forks source link

TSSEnrichment error #887

Closed AAA-3 closed 2 years ago

AAA-3 commented 2 years ago

Hello,

I am teaching myself ATAC analysis and was following the mouse vignette instructions. When I run the code brain <- TSSEnrichment(brain, fast = FALSE), I get the following error:

Error in `colnames<-`(`*tmp*`, value = seq_len(length.out = region.width) -  : 
  attempt to set 'colnames' on an object with less than two dimensions

I have looked at #374 #485 #594. Since I am using the vignette data, I do not think it is a gene annoation problem and the gene_biotype addition didn't help either (got a Gene annotation does not contain gene_biotype information error instead of the error above).

Is this because:

Sessioninfo:


R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS:   /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=de_DE.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=de_DE.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=de_DE.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] rtracklayer_1.50.0         patchwork_1.1.1            ggplot2_3.3.5              EnsDb.Mmusculus.v79_2.99.0
 [5] ensembldb_2.14.1           AnnotationFilter_1.14.0    GenomicFeatures_1.42.3     AnnotationDbi_1.52.0      
 [9] Biobase_2.50.0             Seurat_4.0.5               Signac_1.4.0               SeuratObject_4.0.4        
[13] GenomicRanges_1.42.0       GenomeInfoDb_1.26.7        IRanges_2.24.1             S4Vectors_0.28.1          
[17] BiocGenerics_0.36.1       

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                  reticulate_1.22             tidyselect_1.1.1            RSQLite_2.2.8              
  [5] htmlwidgets_1.5.4           grid_4.0.4                  docopt_0.7.1                BiocParallel_1.24.1        
  [9] Rtsne_0.15                  munsell_0.5.0               codetools_0.2-18            ica_1.0-2                  
 [13] future_1.23.0               miniUI_0.1.1.1              withr_2.4.2                 colorspace_2.0-2           
 [17] knitr_1.36                  rstudioapi_0.13             ROCR_1.0-11                 tensor_1.5                 
 [21] listenv_0.8.0               labeling_0.4.2              MatrixGenerics_1.2.1        slam_0.1-49                
 [25] GenomeInfoDbData_1.2.4      polyclip_1.10-0             bit64_4.0.5                 farver_2.1.0               
 [29] parallelly_1.29.0           vctrs_0.3.8                 generics_0.1.1              xfun_0.28                  
 [33] biovizBase_1.38.0           BiocFileCache_1.14.0        lsa_0.73.2                  ggseqlogo_0.1              
 [37] R6_2.5.1                    hdf5r_1.3.5                 bitops_1.0-7                spatstat.utils_2.2-0       
 [41] cachem_1.0.6                DelayedArray_0.16.3         assertthat_0.2.1            promises_1.2.0.1           
 [45] scales_1.1.1                nnet_7.3-15                 gtable_0.3.0                globals_0.14.0             
 [49] goftest_1.2-3               rlang_0.4.12                RcppRoll_0.3.0              splines_4.0.4              
 [53] lazyeval_0.2.2              dichromat_2.0-0             checkmate_2.0.0             spatstat.geom_2.3-0        
 [57] yaml_2.2.1                  reshape2_1.4.4              abind_1.4-5                 backports_1.4.0            
 [61] httpuv_1.6.3                Hmisc_4.6-0                 tools_4.0.4                 ellipsis_0.3.2             
 [65] spatstat.core_2.3-1         RColorBrewer_1.1-2          ggridges_0.5.3              Rcpp_1.0.7                 
 [69] plyr_1.8.6                  base64enc_0.1-3             progress_1.2.2              zlibbioc_1.36.0            
 [73] purrr_0.3.4                 RCurl_1.98-1.5              prettyunits_1.1.1           rpart_4.1-15               
 [77] openssl_1.4.5               deldir_1.0-6                pbapply_1.5-0               cowplot_1.1.1              
 [81] zoo_1.8-9                   SummarizedExperiment_1.20.0 ggrepel_0.9.1               cluster_2.1.1              
 [85] magrittr_2.0.1              data.table_1.14.2           scattermore_0.7             lmtest_0.9-39              
 [89] RANN_2.6.1                  SnowballC_0.7.0             ProtGenerics_1.22.0         fitdistrplus_1.1-6         
 [93] matrixStats_0.61.0          hms_1.1.1                   mime_0.12                   xtable_1.8-4               
 [97] XML_3.99-0.8                jpeg_0.1-9                  sparsesvd_0.2               gridExtra_2.3              
[101] compiler_4.0.4              biomaRt_2.46.3              tibble_3.1.6                KernSmooth_2.23-18         
[105] crayon_1.4.2                htmltools_0.5.2             mgcv_1.8-34                 later_1.3.0                
[109] Formula_1.2-4               tidyr_1.1.4                 DBI_1.1.1                   tweenr_1.0.2               
[113] dbplyr_2.1.1                MASS_7.3-53.1               rappdirs_0.3.3              Matrix_1.3-4               
[117] igraph_1.2.9                pkgconfig_2.0.3             GenomicAlignments_1.26.0    foreign_0.8-81             
[121] plotly_4.10.0               spatstat.sparse_2.0-0       xml2_1.3.2                  XVector_0.30.0             
[125] VariantAnnotation_1.36.0    stringr_1.4.0               digest_0.6.28               sctransform_0.3.2          
[129] RcppAnnoy_0.0.19            spatstat.data_2.1-0         Biostrings_2.58.0           leiden_0.3.7               
[133] fastmatch_1.1-3             htmlTable_2.3.0             uwot_0.1.10                 curl_4.3.2                 
[137] shiny_1.7.1                 Rsamtools_2.6.0             lifecycle_1.0.1             nlme_3.1-152               
[141] jsonlite_1.7.2              BSgenome_1.58.0             viridisLite_0.4.0           askpass_1.1                
[145] fansi_0.5.0                 pillar_1.6.4                lattice_0.20-41             fastmap_1.1.0              
[149] httr_1.4.2                  survival_3.2-10             glue_1.5.0                  qlcMatrix_0.9.7            
[153] png_0.1-7                   bit_4.0.4                   ggforce_0.3.3               stringi_1.7.5              
[157] blob_1.2.2                  latticeExtra_0.6-29         memoise_2.0.0               dplyr_1.0.7                
[161] irlba_2.3.3                 future.apply_1.8.1 

Code:

#ATAC RNA Tute using mouse https://satijalab.org/signac/articles/mouse_brain_vignette.html
library(Signac)
library(Seurat)
library(GenomeInfoDb)
library(EnsDb.Mmusculus.v79)
library(ggplot2)
library(patchwork)
set.seed(1234)
library(rtracklayer)

#Pre-processing workflow
counts <- Read10X_h5("/home/ali/Dokumente/RPractise/ATAC Tute/atac_v1_adult_brain_fresh_5k_filtered_peak_bc_matrix.h5")
metadata <- read.csv(
  file = "/home/ali/Dokumente/RPractise/ATAC Tute/atac_v1_adult_brain_fresh_5k_singlecell.csv",
  header = TRUE,
  row.names = 1
)
brain_assay <- CreateChromatinAssay(
  counts = counts,
  sep = c(":", "-"),
  #genome = "mm10",
  #commented out above as it gives error that currentley has no fix
  fragments = '/home/ali/Dokumente/RPractise/ATAC Tute/atac_v1_adult_brain_fresh_5k_fragments.tsv.gz',
  min.cells = 1
)
brain <- CreateSeuratObject(
  counts = brain_assay,
  assay = 'peaks',
  project = 'ATAC',
  meta.data = metadata
)

# extract gene annotations from EnsDb
annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Mmusculus.v79)
genome(annotations) <- "mm10"
seqlevelsStyle(annotations) <- 'UCSC'
Annotation(brain) <- annotations

#QC
brain <- NucleosomeSignal(object = brain) 
brain$nucleosome_group <- ifelse(brain$nucleosome_signal > 4, 'NS > 4', 'NS < 4')
FragmentHistogram(object = brain, group.by = 'nucleosome_group', region = 'chr1-1-10000000')
brain <- TSSEnrichment(brain, fast = FALSE)
timoast commented 2 years ago

Can you show the output of:

head(Annotation(brain))
head(Fragments(brain)[[1]])
AAA-3 commented 2 years ago

They are different, like in #826 image

I guess this has to do with the version of the packages I'm using. I will need to upgrade R and then see if it works.

timoast commented 2 years ago

You need to make sure the line seqlevelsStyle(annotations) <- 'UCSC' runs successfully without error. In this case the annotations are not UCSC style, so my guess is there was an error somewhere.

AAA-3 commented 2 years ago

Running

seqlevelsStyle(annotations) <- 'UCSC'
genome(annotations) <- "mm10"

gave an error described here: https://github.com/Bioconductor/GenomeInfoDb/issues/32#issuecomment-965939826_

Running

genome(annotations) <- "mm10"
seqlevelsStyle(annotations) <- 'UCSC'

did not produce an error. The error is resolved by updating to BioC 3.14 which also means upgrading my R which is on 4.0.4. Wanted to avoid having to seek out the administrators but looks like it cant be helped.

Thanks Tim!! :D

AAA-3 commented 2 years ago

Hi @timoast !

I upgraded everything and am still having some issues with the vignette:

Code ``` #ATAC RNA Tute using mouse https://satijalab.org/signac/articles/mouse_brain_vignette.html library(Signac) library(Seurat) library(GenomeInfoDb) library(EnsDb.Mmusculus.v79) library(ggplot2) library(patchwork) set.seed(1234) library(rtracklayer) #Pre-processing workflow counts <- Read10X_h5("/atac_v1_adult_brain_fresh_5k_filtered_peak_bc_matrix.h5") brain_assay <- CreateChromatinAssay( counts = counts, sep = c(":", "-"), genome = "mm10", fragments = '/atac_v1_adult_brain_fresh_5k_fragments.tsv.gz', min.cells = 1 ) metadata <- read.csv( file = "/atac_v1_adult_brain_fresh_5k_singlecell.csv", header = TRUE, row.names = 1 ) brain <- CreateSeuratObject( counts = brain_assay, assay = 'peaks', project = 'ATAC', meta.data = metadata ) # gene annotations annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Mmusculus.v79) seqlevelsStyle(annotations) <- 'UCSC' genome(annotations) <- "mm10" Annotation(brain) <- annotations ```

I get no errors only warnings which I believe I can ignore (?)

Full log incl all warnings ``` > #ATAC RNA Tute using mouse https://satijalab.org/signac/articles/mouse_brain_vignette.html > library(Signac) > library(Seurat) > library(GenomeInfoDb) > library(EnsDb.Mmusculus.v79) > library(ggplot2) > library(patchwork) > set.seed(1234) > library(rtracklayer) > > #Pre-processing workflow > counts <- Read10X_h5("/home/ali/Dokumente/RPractise/ATAC Tute/atac_v1_adult_brain_fresh_5k_filtered_peak_bc_matrix.h5") Warning message: In sparseMatrix(i = indices[] + 1, p = indptr[], x = as.numeric(x = counts[]), : 'giveCsparse' has been deprecated; setting 'repr = "T"' for you > > brain_assay <- CreateChromatinAssay( + counts = counts, + sep = c(":", "-"), + genome = "mm10", + fragments = '/home/ali/Dokumente/RPractise/ATAC Tute/atac_v1_adult_brain_fresh_5k_fragments.tsv.gz', + min.cells = 1 + ) Computing hash Checking for 5337 cell barcodes > metadata <- read.csv( + file = "/home/ali/Dokumente/RPractise/ATAC Tute/atac_v1_adult_brain_fresh_5k_singlecell.csv", + header = TRUE, + row.names = 1 + ) > > brain <- CreateSeuratObject( + counts = brain_assay, + assay = 'peaks', + project = 'ATAC', + meta.data = metadata + ) Warning: Keys should be one or more alphanumeric characters followed by an underscore, setting key from peaks to peaks_ Warning message: In CreateSeuratObject.Assay(counts = brain_assay, assay = "peaks", : Some cells in meta.data not present in provided counts matrix. > > brain[['peaks']] ChromatinAssay data with 157203 features for 5337 cells Variable features: 0 Genome: mm10 Annotation present: FALSE Motifs present: FALSE Fragment files: 1 > annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Mmusculus.v79) Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done Fetching data...OK Parsing exons...OK Defining introns...OK Defining UTRs...OK Defining CDS...OK aggregating... Done There were 21 warnings (use warnings() to see them) > warnings() Warning messages: 1: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 2: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 3: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 4: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 5: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 6: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 7: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 8: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 9: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 10: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 11: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 12: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 13: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 14: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 15: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 16: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 17: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 18: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 19: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 20: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) 21: In .Seqinfo.mergexy(x, y) : The 2 combined objects have no sequence levels in common. (Use suppressWarnings() to suppress this warning.) > # change to UCSC style since the data was mapped to hg19 > seqlevelsStyle(annotations) <- 'UCSC' > genome(annotations) <- "mm10" > # add the gene information to the object > Annotation(brain) <- annotations ```

Yet, I am still unable to match annotation styles. Any idea what could be goind wrong?

Session Info ``` R version 4.1.2 (2021-11-01) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 9 (stretch) Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.19.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=de_DE.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats4 stats graphics grDevices utils datasets methods base other attached packages: [1] rtracklayer_1.54.0 patchwork_1.1.1 ggplot2_3.3.5 EnsDb.Mmusculus.v79_2.99.0 [5] ensembldb_2.18.2 AnnotationFilter_1.18.0 GenomicFeatures_1.46.1 AnnotationDbi_1.56.2 [9] Biobase_2.54.0 GenomicRanges_1.46.1 GenomeInfoDb_1.30.0 IRanges_2.28.0 [13] S4Vectors_0.32.3 BiocGenerics_0.40.0 SeuratObject_4.0.4 Seurat_4.0.5 [17] Signac_1.4.0 loaded via a namespace (and not attached): [1] utf8_1.2.2 reticulate_1.22 tidyselect_1.1.1 RSQLite_2.2.9 [5] htmlwidgets_1.5.4 grid_4.1.2 docopt_0.7.1 BiocParallel_1.28.2 [9] Rtsne_0.15 munsell_0.5.0 codetools_0.2-18 ica_1.0-2 [13] future_1.23.0 miniUI_0.1.1.1 withr_2.4.3 colorspace_2.0-2 [17] filelock_1.0.2 knitr_1.36 rstudioapi_0.13 ROCR_1.0-11 [21] tensor_1.5 listenv_0.8.0 labeling_0.4.2 MatrixGenerics_1.6.0 [25] slam_0.1-49 GenomeInfoDbData_1.2.7 polyclip_1.10-0 bit64_4.0.5 [29] farver_2.1.0 parallelly_1.29.0 vctrs_0.3.8 generics_0.1.1 [33] xfun_0.28 biovizBase_1.42.0 BiocFileCache_2.2.0 lsa_0.73.2 [37] ggseqlogo_0.1 R6_2.5.1 hdf5r_1.3.5 bitops_1.0-7 [41] spatstat.utils_2.2-0 cachem_1.0.6 DelayedArray_0.20.0 assertthat_0.2.1 [45] promises_1.2.0.1 BiocIO_1.4.0 scales_1.1.1 nnet_7.3-16 [49] gtable_0.3.0 globals_0.14.0 goftest_1.2-3 rlang_0.4.12 [53] RcppRoll_0.3.0 splines_4.1.2 lazyeval_0.2.2 dichromat_2.0-0 [57] checkmate_2.0.0 spatstat.geom_2.3-0 BiocManager_1.30.16 yaml_2.2.1 [61] reshape2_1.4.4 abind_1.4-5 backports_1.4.0 httpuv_1.6.3 [65] Hmisc_4.6-0 tools_4.1.2 ellipsis_0.3.2 spatstat.core_2.3-2 [69] RColorBrewer_1.1-2 ggridges_0.5.3 Rcpp_1.0.7 plyr_1.8.6 [73] base64enc_0.1-3 progress_1.2.2 zlibbioc_1.40.0 purrr_0.3.4 [77] RCurl_1.98-1.5 prettyunits_1.1.1 rpart_4.1-15 deldir_1.0-6 [81] pbapply_1.5-0 cowplot_1.1.1 zoo_1.8-9 SummarizedExperiment_1.24.0 [85] ggrepel_0.9.1 cluster_2.1.2 magrittr_2.0.1 data.table_1.14.2 [89] scattermore_0.7 lmtest_0.9-39 RANN_2.6.1 SnowballC_0.7.0 [93] ProtGenerics_1.26.0 fitdistrplus_1.1-6 matrixStats_0.61.0 hms_1.1.1 [97] mime_0.12 xtable_1.8-4 XML_3.99-0.8 jpeg_0.1-9 [101] sparsesvd_0.2 gridExtra_2.3 compiler_4.1.2 biomaRt_2.50.1 [105] tibble_3.1.6 KernSmooth_2.23-20 crayon_1.4.2 htmltools_0.5.2 [109] mgcv_1.8-38 later_1.3.0 Formula_1.2-4 tidyr_1.1.4 [113] DBI_1.1.1 tweenr_1.0.2 dbplyr_2.1.1 MASS_7.3-54 [117] rappdirs_0.3.3 Matrix_1.3-4 parallel_4.1.2 igraph_1.2.9 [121] pkgconfig_2.0.3 GenomicAlignments_1.30.0 foreign_0.8-81 plotly_4.10.0 [125] spatstat.sparse_2.0-0 xml2_1.3.3 XVector_0.34.0 VariantAnnotation_1.40.0 [129] stringr_1.4.0 digest_0.6.29 sctransform_0.3.2 RcppAnnoy_0.0.19 [133] spatstat.data_2.1-0 Biostrings_2.62.0 leiden_0.3.7 fastmatch_1.1-3 [137] htmlTable_2.3.0 uwot_0.1.11 restfulr_0.0.13 curl_4.3.2 [141] shiny_1.7.1 Rsamtools_2.10.0 rjson_0.2.20 lifecycle_1.0.1 [145] nlme_3.1-153 jsonlite_1.7.2 BSgenome_1.62.0 viridisLite_0.4.0 [149] fansi_0.5.0 pillar_1.6.4 lattice_0.20-45 KEGGREST_1.34.0 [153] fastmap_1.1.0 httr_1.4.2 survival_3.2-13 glue_1.5.1 [157] qlcMatrix_0.9.7 png_0.1-7 bit_4.0.4 ggforce_0.3.3 [161] stringi_1.7.6 blob_1.2.2 latticeExtra_0.6-29 memoise_2.0.1 [165] dplyr_1.0.7 irlba_2.3.5 future.apply_1.8.1 ```
AAA-3 commented 2 years ago

Embarrassing, but the solution was changing seqlevelsStyle(annotations) <- 'UCSC' to seqlevelsStyle(annotations) <- "UCSC"

l-cli commented 2 years ago

Hi! I updated everything as described in this thread, changed to seqlevelsStyle(annotations) <- 'UCSC', but the error persisted. Would appreciate any suggestions!

R version 4.1.0 (2021-05-18)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.4 (Ootpa)

Matrix products: default
BLAS/LAPACK: /data/cli_anaconda3/cli_conda_env/newR/lib/libopenblasp-r0.3.18.so

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       

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

other attached packages:
 [1] patchwork_1.1.1           ggplot2_3.3.5             EnsDb.Hsapiens.v75_2.99.0 ensembldb_2.18.2         
 [5] AnnotationFilter_1.18.0   GenomicFeatures_1.46.1    AnnotationDbi_1.56.2      Biobase_2.54.0           
 [9] GenomicRanges_1.46.1      GenomeInfoDb_1.30.0       IRanges_2.28.0            S4Vectors_0.32.3         
[13] BiocGenerics_0.40.0       SeuratObject_4.0.4        Seurat_4.0.6              Signac_1.5.0             

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                  reticulate_1.22             tidyselect_1.1.1            RSQLite_2.2.9              
  [5] htmlwidgets_1.5.4           grid_4.1.0                  docopt_0.7.1                BiocParallel_1.28.3        
  [9] Rtsne_0.15                  munsell_0.5.0               codetools_0.2-18            ica_1.0-2                  
 [13] future_1.23.0               miniUI_0.1.1.1              withr_2.4.3                 colorspace_2.0-2           
 [17] filelock_1.0.2              knitr_1.37                  rstudioapi_0.13             ROCR_1.0-11                
 [21] tensor_1.5                  listenv_0.8.0               MatrixGenerics_1.6.0        slam_0.1-49                
 [25] GenomeInfoDbData_1.2.7      polyclip_1.10-0             bit64_4.0.5                 farver_2.1.0               
 [29] parallelly_1.30.0           vctrs_0.3.8                 generics_0.1.1              xfun_0.29                  
 [33] biovizBase_1.42.0           BiocFileCache_2.2.0         lsa_0.73.2                  ggseqlogo_0.1              
 [37] R6_2.5.1                    hdf5r_1.3.5                 bitops_1.0-7                spatstat.utils_2.3-0       
 [41] cachem_1.0.6                DelayedArray_0.20.0         assertthat_0.2.1            promises_1.2.0.1           
 [45] BiocIO_1.4.0                scales_1.1.1                nnet_7.3-16                 gtable_0.3.0               
 [49] globals_0.14.0              goftest_1.2-3               rlang_0.4.12                RcppRoll_0.3.0             
 [53] splines_4.1.0               rtracklayer_1.54.0          lazyeval_0.2.2              dichromat_2.0-0            
 [57] checkmate_2.0.0             spatstat.geom_2.3-1         BiocManager_1.30.16         yaml_2.2.1                 
 [61] reshape2_1.4.4              abind_1.4-5                 backports_1.4.1             httpuv_1.6.4               
 [65] Hmisc_4.6-0                 tools_4.1.0                 ellipsis_0.3.2              spatstat.core_2.3-2        
 [69] RColorBrewer_1.1-2          ggridges_0.5.3              Rcpp_1.0.7                  plyr_1.8.6                 
 [73] base64enc_0.1-3             progress_1.2.2              zlibbioc_1.40.0             purrr_0.3.4                
 [77] RCurl_1.98-1.5              prettyunits_1.1.1           rpart_4.1-15                deldir_1.0-6               
 [81] pbapply_1.5-0               cowplot_1.1.1               zoo_1.8-9                   SummarizedExperiment_1.24.0
 [85] ggrepel_0.9.1               cluster_2.1.2               magrittr_2.0.1              data.table_1.14.2          
 [89] scattermore_0.7             lmtest_0.9-39               RANN_2.6.1                  SnowballC_0.7.0            
 [93] ProtGenerics_1.26.0         fitdistrplus_1.1-6          matrixStats_0.61.0          hms_1.1.1                  
 [97] mime_0.12                   xtable_1.8-4                XML_3.99-0.8                jpeg_0.1-9                 
[101] sparsesvd_0.2               gridExtra_2.3               compiler_4.1.0              biomaRt_2.50.1             
[105] tibble_3.1.6                KernSmooth_2.23-20          crayon_1.4.2                htmltools_0.5.2            
[109] mgcv_1.8-38                 later_1.3.0                 Formula_1.2-4               tidyr_1.1.4                
[113] DBI_1.1.2                   tweenr_1.0.2                dbplyr_2.1.1                MASS_7.3-54                
[117] rappdirs_0.3.3              Matrix_1.4-0                parallel_4.1.0              igraph_1.2.10              
[121] pkgconfig_2.0.3             GenomicAlignments_1.30.0    foreign_0.8-81              plotly_4.10.0              
[125] spatstat.sparse_2.1-0       xml2_1.3.3                  XVector_0.34.0              VariantAnnotation_1.40.0   
[129] stringr_1.4.0               digest_0.6.29               sctransform_0.3.2           RcppAnnoy_0.0.19           
[133] spatstat.data_2.1-2         Biostrings_2.62.0           leiden_0.3.9                fastmatch_1.1-3            
[137] htmlTable_2.3.0             uwot_0.1.11                 restfulr_0.0.13             curl_4.3.2                 
[141] shiny_1.7.1                 Rsamtools_2.10.0            rjson_0.2.20                lifecycle_1.0.1            
[145] nlme_3.1-153                jsonlite_1.7.2              BSgenome_1.62.0             viridisLite_0.4.0          
[149] fansi_0.5.0                 pillar_1.6.4                lattice_0.20-45             KEGGREST_1.34.0            
[153] fastmap_1.1.0               httr_1.4.2                  survival_3.2-13             glue_1.6.0                 
[157] qlcMatrix_0.9.7             png_0.1-7                   bit_4.0.4                   ggforce_0.3.3              
[161] stringi_1.7.6               blob_1.2.2                  latticeExtra_0.6-29         memoise_2.0.1              
[165] dplyr_1.0.7                 irlba_2.3.5                 future.apply_1.8.1 

We used the exact same codes as the pbmc3k vignette: https://satijalab.org/seurat/articles/pbmc3k_tutorial.html

l-cli commented 2 years ago

Resolved by manually changing the annotations object! Thank you

iva302 commented 2 years ago

Resolved by manually changing the annotations object! Thank you

How did you manually change the object? Thanks in advance!

AC-H commented 10 months ago

I would like it also, How you manually modify annotations object? Thanks in advance!

siqi-zZ commented 3 months ago

I also have those error, I found when as this step they can do well.

extract gene annotations from EnsDb

annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Hsapiens.v75)

change to UCSC style since the data was mapped to hg19

seqlevels(annotations) <- paste0('chr', seqlevels(annotations)) genome(annotations) <- "hg19" library(ggplot2) library(patchwork)

add the gene information to the object

Annotation(pbmc) <- annotations

but when you not run this" annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Hsapiens.v75)" ,will have this error, even have annotations object. So every time you need run " annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Hsapiens.v75)" for new sample.

rshikha95 commented 2 months ago

Resolved by manually changing the annotations object! Thank you

How?