Hello,
I want to get per nucleotide coverage for my particular gene (geneX) which I added in the fasta file. There are other chromosomes present in the bam file, whose per nu coverage I am not interested in. When I use genomeCoverageBed tool to calculate per nucleotide coverage for my gene I also get coverage for other chromosomes which should not be the case if you look at my command below
samtools view -bh test.bam geneX | genomeCoverageBed - ibam stdin -g my.genome -d > out.txt
my my.genome looks like this
geneX 1400
This runs for a very long time because the program still looks for chr1, chr2 etc??
Anyway I can only get per nuc counts for geneX.
Thanks
Varun
Hi Kevin, Thanks for your reply. I looked at the bedtools manual for coverage function. If I want per nucleotide coverage for the bed file(as is my case), the command should be like this
Then this is the output
Thanks
Yes, is that what you needed? The 4th column is the exact base number, and the 5th is the read-depth at that position. There should be 13,456 lines in your file.
yup, works fine, must say better than genomeCoverageBed because in genomeCoverageBed, if you have all the headers(having all the chromosomes) in the bam file and only a particular chr alignments you want, it still goes through all the chromosomes.