satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.29k stars 915 forks source link

`CoveragePlot` Error in `colnames<-`(`*tmp*`, value = start(x = region):end(x = region)) : attempt to set 'colnames' on an object with less than two dimensions #9203

Open danli349 opened 3 months ago

danli349 commented 3 months ago

Hello:

When I run the CoveragePlot

CoveragePlot(pbmc, region = 'Erg', features = 'sct_Erg', 
             assay = 'ATAC', expression.assay = 'SCT', peaks = FALSE)

How to solve this error?

R[write to console]: Error in `colnames<-`(`*tmp*`, value = start(x = region):end(x = region)) : 
  attempt to set 'colnames' on an object with less than two dimensions

Error in `colnames<-`(`*tmp*`, value = start(x = region):end(x = region)) : 
  attempt to set 'colnames' on an object with less than two dimensions

Thanks

mhkowalski commented 1 month ago

Hi,

This question is probably better suited for the Signac github, but I can try to help.

Do you have this problem if you include genomic coordinates for the Erg gene rather than the gene itself? If so, it may be something with the annotation in the object. Can you double check to make sure that Erg is in your object annotation, and that your annotation file is in the same format as your peaks (i.e. "chr1" vs "1")

head(pbmc[['ATAC']]@annotation)
subset(pbmc[['ATAC']]@annotation, gene_name=="Erg")