stuart-lab / signac

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

error in signac motif tutorial #115

Closed davemcg closed 4 years ago

davemcg commented 4 years ago

https://satijalab.org/signac/articles/motif_vignette.html

# Add the Motif object to the assay
mouse_brain[['peaks']] <- AddMotifObject(
  object = mouse_brain[['peaks']],
  motif.object = motif
)

This should be

# Add the Motif object to the assay
mouse_brain[['peaks']] <- AddMotifObject(
  object = mouse_brain,
  motif.object = motif
)
timoast commented 4 years ago

No, the vignette is correct. Why do you think it's a bug?

davemcg commented 4 years ago

Sorry, I'm following along with own Seurat obj (rpe.atac (which doesn't already have a peak slot)....I get an error:

> rpe.atac[['peaks']] <- AddMotifObject(
   object = rpe.atac[['peaks']],
   motif.object = motif
 )
Error in `[[.Seurat`(rpe.atac, "peaks") : 
  Cannot find 'peaks' in this Seurat object

Doesn't object refer to seurat object, and not the slot?

timoast commented 4 years ago

Object in this case refers to an Assay object. Here you're getting the error because you don't have an assay called "peaks" in the Seurat object

davemcg commented 4 years ago

Ah, I named my ATAC assay 'ATAC'....sorry for the wasted time.