Joint RNA and ATAC analysis: 10x multiomic - Fragment Path
1
0
Entering edit mode
15 months ago
cgp09741 ▴ 10

I am trying to follow the tutorial for Signac 1.10.0... I am getting an error when it comes to the part of the code "create ATAC assay and add it to the object" below is the code that I am running

counts <- Read10X_h5("~/Documents/multiomic/pbmc_granulocyte_sorted_10k_filtered_feature_bc_matrix.h5")
fragpath <- "../Documents/multiomic/pbmc_granulocyte_sorted_10k_atac_fragments.tsv.gz"
annotation <- GetGRangesFromEnsDb(ensdb = EnsDb.Hsapiens.v86)
seqlevels(annotation) <- paste0('chr', seqlevels(annotation))
pbmc <- CreateSeuratObject(counts = counts$`Gene Expression`,assay = "RNA")

The above code runs fine, but the code below is where I get an error:

pbmc[["ATAC"]] <- CreateChromatinAssay(counts = counts$Peaks,sep = c(":", "-"),fragments = fragpath,annotation = annotation)

This is the error I am getting:

Error in CreateFragmentObject(path = fragments, cells = cells, validate.fragments = validate.fragments, :
Fragment file does not exist.

I am assuming it has something to do with the path that I am setting... If someone could please provide insight to the correct way to set path I would appreciate it. I am currently using the atac_fragments.tsv.gz file that I am setting my path to.

ATAC-seq multiomic signac • 1.1k views
ADD COMMENT
0
Entering edit mode
15 months ago

Presumably a typo since you have:

counts <- Read10X_h5("~/Documents/multiomic/pbmc_granulocyte_sorted_10k_filtered_feature_bc_matrix.h5")

But then:

fragpath <- "../Documents/multiomic/pbmc_granulocyte_sorted_10k_atac_fragments.tsv.gz"

Which should probably be:

fragpath <- "~/Documents/multiomic/pbmc_granulocyte_sorted_10k_atac_fragments.tsv.gz"

Gotta pay real close attention when providing file paths.

ADD COMMENT
0
Entering edit mode

Thank you for the prompt response! Even with that fix I am still getting an error:

Error in CreateFragmentObject(path = fragments, cells = cells, validate.fragments = validate.fragments, :
Fragment file is not indexed.
ADD REPLY
1
Entering edit mode

You need the index for the file in the same location. It has the same name but ends with .tbi. If you don't have an index, you can generate one, see here.

ADD REPLY
0
Entering edit mode

Thank you so much. This solved my problem!!

ADD REPLY

Login before adding your answer.

Traffic: 2514 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6