Hi all,
I am trying to follow this vignette but confused:
https://greenleaflab.github.io/chromVAR/.
I have 8 bam files from ATAC-seq data and converted to 8 bed files. However this example has 2 bam files and only one bed file.
peakfile <- "mypeaks.bed"
peaks <- getPeaks(peakfile)
bamfiles <- c("mybam1.bam","mybam2.bam")
fragment_counts <- getCounts(bamfiles, peaks,
paired = TRUE,
by_rg = TRUE,
format = "bam",
colData = DataFrame(celltype = c("GM","K562")))
Would you suggest me the correct way to read data in this case? Why do we need both bam and bed file for the function getCounts()? Thank you so much.
It's fine, the purpose of DiffBind and chromVAR are different. In a nutshell, chromVAR matches a collection of motifs to open chromatin regions, and then calculates deviation scores for each motif based on the read counts per sample for the regions that harbor a certain motif. The output is a relatively high-dimensional overview whether certain motifs are generally more associated with opening or closing chromatin between samples/conditions. We used that before for bulk ATAC-seq and it worked reasonably well, pretty much confirming what you would see when scanning differential chromatin regions between conditions for motif enrichment, but more convenient and faster since you don't have to do all this testing and enrichment analysis.
Seconding the 2nd paragraph, it's one BED file with peaks, for example consensus peaks, and then one bam per sample, as described in the manual OP links. There is no instruction to ever convert BAM to BED, so please stick to the manual.
Thanks ATpoint! I have consensus file from nf-core/atac. The vignette used
system.file()
to read bam data in so I try to read my bam files into the tool but got error. Would you suggest the function to read data? For example, if I have 8 bam files for 4 conditions (2 biological replicates for each condition), how can I read them into? The vignette usedexample_counts
a built in data which is aRangedSummarizedExperiment
. Would you please tell me how to get this object with my data?Error in value[3L] : failed to open BamFile: file(s) do not exist:
'path/to/bam_file'
If I put the path to bam file directly into the function, I get the same error:
Error in value[3L] : failed to open BamFile: file(s) do not exist:
'path/to/bam_file'
I can read it now. Missed a forward slash in the file path. Thank you.
Thanks Jame for your help! I used DiffBind but I got an error: Help with error DiffBind