Hi all, I'm relatively new to bioinformatics / single-cell analysis but I was wondering if I could get some help fixing this error I've been having with doing joint 10X Genomics Multiome RNA-seq and matched ATAC-seq data analysis in R with Seurat and Signac.
I keep running into this issue where I cannot add an assay object to my Seurat object as I did previously. I came to find this recently updated vignette "Joint RNA and ATAC analysis: 10x multiomic" which includes the following code:
# load the RNA and ATAC data
counts <- [Read10X_h5](https://satijalab.org/seurat/reference/Read10X_h5.html)("pbmc_granulocyte_sorted_10k_filtered_feature_bc_matrix.h5")
fragpath <- "pbmc_granulocyte_sorted_10k_atac_fragments.tsv.gz"
# get gene annotations for hg38
annotation <- [GetGRangesFromEnsDb](https://stuartlab.org/signac/reference/getgrangesfromensdb)(ensdb = EnsDb.Hsapiens.v86)
[seqlevels](https://stuartlab.org/signac/reference/seqinfo-methods)(annotation) <- [paste0](https://rdrr.io/r/base/paste.html)('chr', [seqlevels](https://stuartlab.org/signac/reference/seqinfo-methods)(annotation))
# create a Seurat object containing the RNA adata
pbmc <- [CreateSeuratObject](https://mojaveazure.github.io/seurat-object/reference/CreateSeuratObject.html)(
counts = counts$`Gene Expression`,
assay = "RNA"
)
# create ATAC assay and add it to the object
pbmc[["ATAC"]] <- [CreateChromatinAssay](https://stuartlab.org/signac/reference/createchromatinassay)(
counts = counts$Peaks,
sep = [c](https://rdrr.io/r/base/c.html)(":", "-"),
fragments = fragpath,
annotation = annotation
)
And this seems to work in the vignette but when I run my code below, I get the error that is provided. Just wondering what this means and if there is a fix? Or do I have to roll back my Seurat/Signac versions because this worked previously?
My code:
adata = Read10X_h5("aggregated_outs/filtered_feature_bc_matrix.h5")
#Extracting RNA-seq and ATAC-seq data
rnaCounts = adata$`Gene Expression`
peakCounts = adata$Peaks
annotation = GetGRangesFromEnsDb(ensdb = EnsDb.Mmusculus.v79)
seqlevels(annotation) = paste0('chr', seqlevels(annotation))
actGC <- CreateSeuratObject(counts = rnaCounts, assay = "RNA" , min.cells = 3, min.features = 200)
> frag.file = "aggregated_outs/atac_fragments.tsv.gz"
> actGC[["ATAC"]] = CreateChromatinAssay(
+ counts = peakCounts,
+ sep = c(":", "-"),
+ fragments = frag.file,
+ annotation = annotation
+ )
Computing hash
Checking for 46002 cell barcodes
Error in `[[<-`:
! Cannot add new cells with [[<-
Run `rlang::last_trace()` to see where the error occurred.
Hi all, I'm relatively new to bioinformatics / single-cell analysis but I was wondering if I could get some help fixing this error I've been having with doing joint 10X Genomics Multiome RNA-seq and matched ATAC-seq data analysis in R with Seurat and Signac.
I keep running into this issue where I cannot add an assay object to my Seurat object as I did previously. I came to find this recently updated vignette "Joint RNA and ATAC analysis: 10x multiomic" which includes the following code:
And this seems to work in the vignette but when I run my code below, I get the error that is provided. Just wondering what this means and if there is a fix? Or do I have to roll back my Seurat/Signac versions because this worked previously?
My code:
I did also check thread https://github.com/stuart-lab/signac/discussions/1692 - https://github.com/stuart-lab/signac/discussions/1692#discussion-6564054 However I am unsure what they mean by "One of the objects I merged did not have matching cell id". Is this a similar situation to mine?
Apologies if this is a duplicate, I couldn't find any other articles relating to the same assay / issue that I'm having.
Would appreciate any help! Please let me know if I can provide more information.