Closed elisulvaran closed 1 year ago
Hi, have you tried subsetting SeuratObject
so that it only contains in the intersecting cells, or cells_select
?
Hi! Yes, so the ChromatinAssay was the object that had cells that were not present in the Seurat object, that's why I had to intersect them using:
cells_select <- intersect(colnames(ChromatinAssayObject), colnames(SeuratObject))
This is how my ChromatinAssay looks like
> ChromatinAssayObject
ChromatinAssay data with 171904 features for 26024 cells
Variable features: 0
Genome: hg38
Annotation present: TRUE
Motifs present: FALSE
Fragment files: 26
And this is how my Seurat object looks like
> SeuratObject
An object of class Seurat
239771 features across 26024 samples within 3 assays
Active assay: RNA (36601 features, 2000 variable features)
2 layers present: counts, data
2 other assays present: ATAC, SCT
5 dimensional reductions calculated: pca, umap.rna, lsi, umap.atac, wnn.umap
As you can see, they both have the same number of samples. I'm not sure if the problem is arising due to the number of features, but my ATAC and my RNA assay in the SeuratObject have a different number of features, so I don't think that's why the error is showing up.
Thanks!
hi @elisulvaran
I don't think CreateChromatinAssay
usually use cells
as the parameter. You can directly subset your counts matrix.
SeuratObject[["ChromatinAssay"]] <- CreateChromatinAssay(counts = ChromatinAssayObject@counts[,cells_select],
sep = c(":", "-"),
genome = "hg38",
fragments = Fragments(ChromatinAssayObject),
annotation = Annotation(ChromatinAssayObject))
Hello! Firstly, thank you so much for creating such an incredible and useful tool. I have a ChromatinAssay object that I would like to add to my Seurat object. I was not sure on what the best way of doing this was, but I followed this section of a signac tutorial
This is throwing the following error:
I don't really know how to proceed with this. Here's my info session:
Thank you!