stuart-lab / signac

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

Error when running pbmc <- TSSEnrichment(object = pbmc, fast = FALSE) #1582

Closed sropri92 closed 10 months ago

sropri92 commented 10 months ago

Hi,

I am going through the vignette on Analyzing PBMC scATAC-seq. I run the following line and get this error:

pbmc <- TSSEnrichment(object = pbmc, fast = FALSE) Extracting TSS positions Finding + strand cut sites Finding - strand cut sites Computing mean insertion frequency in flanking regions Normalizing TSS score Error in slot(object = object, name = layer) : argument "slot" is missing, with no default

I am using the data described in the vignette as well as the genome annotation described (EnsDb.Hsapiens.v75). My annotation also looks correct but you can please check below. I would appreciate any help on how to solve this issue as I have tried a couple things and am stuck. Appreciate the help.

head(Annotation(pbmc)) GRanges object with 6 ranges and 5 metadata columns: seqnames ranges strand | tx_id gene_name gene_id

| ENSE00001489430 chrX 192989-193061 + | ENST00000399012 PLCXD1 ENSG00000182378 ENSE00001536003 chrX 192991-193061 + | ENST00000484611 PLCXD1 ENSG00000182378 ENSE00002160563 chrX 193020-193061 + | ENST00000430923 PLCXD1 ENSG00000182378 ENSE00001750899 chrX 197722-197788 + | ENST00000445062 PLCXD1 ENSG00000182378 ENSE00001489388 chrX 197859-198351 + | ENST00000381657 PLCXD1 ENSG00000182378 ENSE00001719251 chrX 197861-197923 + | ENST00000429181 PLCXD1 ENSG00000182378 gene_biotype type ENSE00001489430 protein_coding exon ENSE00001536003 protein_coding exon ENSE00002160563 protein_coding exon ENSE00001750899 protein_coding exon ENSE00001489388 protein_coding exon ENSE00001719251 protein_coding exon ------- seqinfo: 25 sequences (1 circular) from hg19 genome head(Fragments(pbmc)[[1]]) chrom start end barcode readCount 1 chr1 10066 10279 TTAGCTTAGGAGAACA-1 2 2 chr1 10072 10279 TTAGCTTAGGAGAACA-1 2 3 chr1 10079 10316 ATATTCCTCTTGTACT-1 2 4 chr1 10084 10340 CGTACAAGTTACCCAA-1 1 5 chr1 10085 10271 TGTGACAGTACAACGG-1 1 6 chr1 10085 10339 CATGCCTTCTCTGACC-1 1
sropri92 commented 10 months ago

This is my pbmc object using seurat V5:

str(pbmc) Formal class 'Seurat' [package "SeuratObject"] with 13 slots ..@ assays :List of 1 .. ..$ peaks:Formal class 'ChromatinAssay' [package "Signac"] with 16 slots .. .. .. ..@ ranges :Formal class 'GRanges' [package "GenomicRanges"] with 7 slots .. .. .. .. .. ..@ seqnames :Formal class 'Rle' [package "S4Vectors"] with 4 slots .. .. .. .. .. .. .. ..@ values : Factor w/ 24 levels "chr1","chr2",..: 1 2 3 4 5 6 7 8 9 10 ... .. .. .. .. .. .. .. ..@ lengths : int [1:24] 8555 6858 5499 3515 4389 5269 4263 3677 3540 4137 ... .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. ..@ ranges :Formal class 'IRanges' [package "IRanges"] with 6 slots .. .. .. .. .. .. .. ..@ start : int [1:87561] 565107 569174 713460 752422 762106 779589 793516 801120 804872 839520 ... .. .. .. .. .. .. .. ..@ width : int [1:87561] 444 466 1364 617 1254 683 226 219 890 1604 ... .. .. .. .. .. .. .. ..@ NAMES : NULL .. .. .. .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. ..@ strand :Formal class 'Rle' [package "S4Vectors"] with 4 slots .. .. .. .. .. .. .. ..@ values : Factor w/ 3 levels "+","-","": 3 .. .. .. .. .. .. .. ..@ lengths : int 87561 .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. ..@ seqinfo :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots .. .. .. .. .. .. .. ..@ seqnames : chr [1:24] "chr1" "chr2" "chr3" "chr4" ... .. .. .. .. .. .. .. ..@ seqlengths : int [1:24] NA NA NA NA NA NA NA NA NA NA ... .. .. .. .. .. .. .. ..@ is_circular: logi [1:24] NA NA NA NA NA NA ... .. .. .. .. .. .. .. ..@ genome : chr [1:24] NA NA NA NA ... .. .. .. .. .. ..@ elementMetadata:Formal class 'DFrame' [package "S4Vectors"] with 6 slots .. .. .. .. .. .. .. ..@ rownames : NULL .. .. .. .. .. .. .. ..@ nrows : int 87561 .. .. .. .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. .. .. ..@ listData : Named list() .. .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. .. ..@ metadata : list() .. .. .. ..@ motifs : NULL .. .. .. ..@ fragments :List of 1 .. .. .. .. ..$ :Formal class 'Fragment' [package "Signac"] with 3 slots .. .. .. .. .. .. ..@ path : chr "/n/scratch/users/a/alr2523/scATAC_seq/atac_v1_pbmc_10k_fragments.tsv.gz" .. .. .. .. .. .. ..@ hash : chr [1:2] "8e03bd72e952a7da7c1cce52f3696e6e" "146e556e1311573593bd6cfa6efefcc1" .. .. .. .. .. .. ..@ cells: Named chr [1:8728] "AAACGAAAGAGCGAAA-1" "AAACGAAAGAGTTTGA-1" "AAACGAAAGCGAGCTA-1" "AAACGAAAGGCTTCGC-1" ... .. .. .. .. .. .. .. ..- attr(, "names")= chr [1:8728] "AAACGAAAGAGCGAAA-1" "AAACGAAAGAGTTTGA-1" "AAACGAAAGCGAGCTA-1" "AAACGAAAGGCTTCGC-1" ... .. .. .. .. .. .. .. .. ..- attr(, ".match.hash")=Class 'match.hash' .. .. .. .. .. .. .. ..- attr(, ".match.hash")=Class 'match.hash' .. .. .. ..@ seqinfo : NULL .. .. .. ..@ annotation :Formal class 'GRanges' [package "GenomicRanges"] with 7 slots .. .. .. .. .. ..@ seqnames :Formal class 'Rle' [package "S4Vectors"] with 4 slots .. .. .. .. .. .. .. ..@ values : Factor w/ 25 levels "chrX","chr20",..: 1 2 3 4 5 6 7 8 9 10 ... .. .. .. .. .. .. .. ..@ lengths : int [1:25] 91850 65937 286553 138842 193124 140929 189609 187010 118295 200248 ... .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. ..@ ranges :Formal class 'IRanges' [package "IRanges"] with 6 slots .. .. .. .. .. .. .. ..@ start : int [1:3072120] 192989 192991 193020 197722 197859 197861 198129 198149 198149 198149 ... .. .. .. .. .. .. .. ..@ width : int [1:3072120] 73 71 42 67 493 63 223 203 203 203 ... .. .. .. .. .. .. .. ..@ NAMES : chr [1:3072120] "ENSE00001489430" "ENSE00001536003" "ENSE00002160563" "ENSE00001750899" ... .. .. .. .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. ..@ strand :Formal class 'Rle' [package "S4Vectors"] with 4 slots .. .. .. .. .. .. .. ..@ values : Factor w/ 3 levels "+","-","": 1 2 1 2 1 2 1 2 1 2 ... .. .. .. .. .. .. .. ..@ lengths : int [1:109414] 57 73 24 23 134 1 74 12 5 62 ... .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. ..@ seqinfo :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots .. .. .. .. .. .. .. ..@ seqnames : chr [1:25] "chrX" "chr20" "chr1" "chr6" ... .. .. .. .. .. .. .. ..@ seqlengths : int [1:25] 155270560 63025520 249250621 171115067 198022430 159138663 133851895 135006516 191154276 81195210 ... .. .. .. .. .. .. .. ..@ is_circular: logi [1:25] FALSE FALSE FALSE FALSE FALSE FALSE ... .. .. .. .. .. .. .. ..@ genome : chr [1:25] "hg19" "hg19" "hg19" "hg19" ... .. .. .. .. .. ..@ elementMetadata:Formal class 'DFrame' [package "S4Vectors"] with 6 slots .. .. .. .. .. .. .. ..@ rownames : NULL .. .. .. .. .. .. .. ..@ nrows : int 3072120 .. .. .. .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. .. .. ..@ listData :List of 5 .. .. .. .. .. .. .. .. ..$ tx_id : chr [1:3072120] "ENST00000399012" "ENST00000484611" "ENST00000430923" "ENST00000445062" ... .. .. .. .. .. .. .. .. ..$ gene_name : chr [1:3072120] "PLCXD1" "PLCXD1" "PLCXD1" "PLCXD1" ... .. .. .. .. .. .. .. .. ..$ gene_id : chr [1:3072120] "ENSG00000182378" "ENSG00000182378" "ENSG00000182378" "ENSG00000182378" ... .. .. .. .. .. .. .. .. ..$ gene_biotype: chr [1:3072120] "protein_coding" "protein_coding" "protein_coding" "protein_coding" ... .. .. .. .. .. .. .. .. ..$ type : Factor w/ 4 levels "cds","exon","gap",..: 2 2 2 2 2 2 2 2 2 2 ... .. .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. .. ..@ metadata : list() .. .. .. ..@ bias : NULL .. .. .. ..@ positionEnrichment: list() .. .. .. ..@ links :Formal class 'GRanges' [package "GenomicRanges"] with 7 slots .. .. .. .. .. ..@ seqnames :Formal class 'Rle' [package "S4Vectors"] with 4 slots .. .. .. .. .. .. .. ..@ values : Factor w/ 0 levels: .. .. .. .. .. .. .. ..@ lengths : int(0) .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. ..@ ranges :Formal class 'IRanges' [package "IRanges"] with 6 slots .. .. .. .. .. .. .. ..@ start : int(0) .. .. .. .. .. .. .. ..@ width : int(0) .. .. .. .. .. .. .. ..@ NAMES : NULL .. .. .. .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. ..@ strand :Formal class 'Rle' [package "S4Vectors"] with 4 slots .. .. .. .. .. .. .. ..@ values : Factor w/ 3 levels "+","-","": .. .. .. .. .. .. .. ..@ lengths : int(0) .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. ..@ seqinfo :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots .. .. .. .. .. .. .. ..@ seqnames : chr(0) .. .. .. .. .. .. .. ..@ seqlengths : int(0) .. .. .. .. .. .. .. ..@ iscircular: logi(0) .. .. .. .. .. .. .. ..@ genome : chr(0) .. .. .. .. .. ..@ elementMetadata:Formal class 'DFrame' [package "S4Vectors"] with 6 slots .. .. .. .. .. .. .. ..@ rownames : NULL .. .. .. .. .. .. .. ..@ nrows : int 0 .. .. .. .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. .. .. .. ..@ metadata : list() .. .. .. .. .. .. .. ..@ listData : Named list() .. .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. .. ..@ metadata : list() .. .. .. ..@ counts :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots .. .. .. .. .. ..@ i : int [1:52681465] 31 74 83 116 134 147 153 166 175 178 ... .. .. .. .. .. ..@ p : int [1:8729] 0 5546 12127 21340 51653 56574 61650 64340 73157 79801 ... .. .. .. .. .. ..@ Dim : int [1:2] 87561 8728 .. .. .. .. .. ..@ Dimnames:List of 2 .. .. .. .. .. .. ..$ : chr [1:87561] "chr1-565107-565550" "chr1-569174-569639" "chr1-713460-714823" "chr1-752422-753038" ... .. .. .. .. .. .. ..$ : chr [1:8728] "AAACGAAAGAGCGAAA-1" "AAACGAAAGAGTTTGA-1" "AAACGAAAGCGAGCTA-1" "AAACGAAAGGCTTCGC-1" ... .. .. .. .. .. .. .. ..- attr(, ".match.hash")=Class 'match.hash' .. .. .. .. .. ..@ x : num [1:52681465] 2 2 2 1 2 2 2 6 2 2 ... .. .. .. .. .. ..@ factors : list() .. .. .. ..@ data :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots .. .. .. .. .. ..@ i : int [1:52681465] 31 74 83 116 134 147 153 166 175 178 ... .. .. .. .. .. ..@ p : int [1:8729] 0 5546 12127 21340 51653 56574 61650 64340 73157 79801 ... .. .. .. .. .. ..@ Dim : int [1:2] 87561 8728 .. .. .. .. .. ..@ Dimnames:List of 2 .. .. .. .. .. .. ..$ : chr [1:87561] "chr1-565107-565550" "chr1-569174-569639" "chr1-713460-714823" "chr1-752422-753038" ... .. .. .. .. .. .. ..$ : chr [1:8728] "AAACGAAAGAGCGAAA-1" "AAACGAAAGAGTTTGA-1" "AAACGAAAGCGAGCTA-1" "AAACGAAAGGCTTCGC-1" ... .. .. .. .. .. .. .. ..- attr(, ".match.hash")=Class 'match.hash' .. .. .. .. .. ..@ x : num [1:52681465] 2 2 2 1 2 2 2 6 2 2 ... .. .. .. .. .. ..@ factors : list() .. .. .. ..@ scale.data : num[0 , 0 ] .. .. .. ..@ assay.orig : NULL .. .. .. ..@ var.features : logi(0) .. .. .. ..@ meta.features :'data.frame': 87561 obs. of 0 variables .. .. .. ..@ misc : Named list() .. .. .. ..@ key : chr "peaks" ..@ meta.data :'data.frame': 8728 obs. of 23 variables: .. ..$ orig.ident : Factor w/ 1 level "SeuratProject": 1 1 1 1 1 1 1 1 1 1 ... .. ..$ nCount_peaks : num [1:8728] 13187 16069 28008 221734 11439 ... .. ..$ nFeature_peaks : int [1:8728] 5546 6581 9213 30313 4921 5076 2690 8817 6644 3632 ... .. ..$ total : int [1:8728] 22965 21806 46233 288897 16103 266481 10753 31745 23136 14626 ... .. ..$ duplicate : int [1:8728] 10872 9336 21197 99998 6751 45654 4760 14341 10210 5612 ... .. ..$ chimeric : int [1:8728] 183 122 479 2830 104 3425 61 167 145 99 ... .. ..$ unmapped : int [1:8728] 198 175 292 1512 120 1514 43 191 157 109 ... .. ..$ lowmapq : int [1:8728] 1198 1050 2673 16347 867 41940 644 1465 1308 913 ... .. ..$ mitochondrial : int [1:8728] 51 1 14 913 0 57 96 29 15 96 ... .. ..$ passed_filters : int [1:8728] 10463 11122 21578 167297 8261 173891 5149 15552 11301 7797 ... .. ..$ cell_id : chr [1:8728] "_cell_0" "_cell_1" "_cell_2" "_cell_3" ... .. ..$ is__cell_barcode : int [1:8728] 1 1 1 1 1 1 1 1 1 1 ... .. ..$ TSS_fragments : int [1:8728] 4157 4858 10696 86433 3784 14141 2637 6587 5136 3493 ... .. ..$ DNase_sensitive_region_fragments: int [1:8728] 8537 9548 17420 137387 6973 78696 3973 13546 9636 6050 ... .. ..$ enhancer_region_fragments : int [1:8728] 3079 3954 4332 32884 2509 11425 753 5745 3542 1394 ... .. ..$ promoter_region_fragments : int [1:8728] 3249 3600 8763 70515 2987 1686 2289 4911 4019 2740 ... .. ..$ on_target_fragments : int [1:8728] 8894 10034 18562 144918 7288 85168 4183 14115 10072 6346 ... .. ..$ blacklist_region_fragments : int [1:8728] 6 10 22 300 4 2121 8 23 8 13 ... .. ..$ peak_region_fragments : int [1:8728] 6796 8319 14333 113658 5879 7360 3220 11399 8215 4509 ... .. ..$ nucleosome_signal : num [1:8728] 1.065 0.781 1.01 1.117 0.971 ... .. ..$ nucleosome_percentile : num [1:8728] 0.71 0.12 0.61 0.77 0.54 0.95 0.91 0.41 0.71 0.72 ... .. ..$ pct_reads_in_peaks : num [1:8728] 65 74.8 66.4 67.9 71.2 ... .. ..$ blacklist_ratio : num [1:8728] 0.000883 0.001202 0.001535 0.002639 0.00068 ... ..@ active.assay: chr "peaks" ..@ active.ident: Factor w/ 1 level "SeuratProject": 1 1 1 1 1 1 1 1 1 1 ... .. ..- attr(, "names")= chr [1:8728] "AAACGAAAGAGCGAAA-1" "AAACGAAAGAGTTTGA-1" "AAACGAAAGCGAGCTA-1" "AAACGAAAGGCTTCGC-1" ... .. .. ..- attr(, ".match.hash")=Class 'match.hash' ..@ graphs : list() ..@ neighbors : list() ..@ reductions : list() ..@ images : list() ..@ project.name: chr "SeuratProject" ..@ misc : list() ..@ version :Classes 'package_version', 'numeric_version' hidden list of 1 .. ..$ : int [1:3] 5 0 1 ..@ commands : list() ..@ tools : list()

timoast commented 10 months ago

This should be fixed on the develop branch, please see https://github.com/stuart-lab/signac/issues/1538

sropri92 commented 10 months ago

Thank you Tim