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.
Thank you for the prompt response! Even with that fix I am still getting an error:
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.Thank you so much. This solved my problem!!