how to extract per base information (in coverage track of IGV) from .bam file
2
0
Entering edit mode
5.9 years ago
xzhangxmu • 0

I would like to get coverage information per bases from the .bam file. But I don't know how to do it. I use IGV to visualize "sorted. Bam" file. When I put the mouse on any base at coverage track, I can see, for example, "Chr 10:150669 Total count:7 A:0 C:6 G:0 T:1 N:0 " through the example, I can know how many counts per base and what are they. But I don't know how I can export this data? I have tried Igvtools(count) with GUI, and then I got a .wig file which has two columns, one is the base position(like, chr1:112234), another is total counts. However, it 's not enough; I still need the details about how many A, G, T, C respectively. Would you kindly tell me how to do it? I will appreciate it.

RNA-Seq IGVtools • 5.1k views
ADD COMMENT
1
Entering edit mode
5.9 years ago
  1. Download IGVtools from here: https://software.broadinstitute.org/software/igv/download
  2. Extract IGVtools in folder of your choice
  3. sh /<path to="" igvtools="">/igvtools count -w 1 --bases input.bam output.wig hg38

wig file is tsv file.

reference: https://digibio.blogspot.com/2014/07/calculate-coverage-from-bam-files-using.html

ADD COMMENT
0
Entering edit mode

Thank you very much for your help. It did work. I had tried the command above "sh igv count -w --bases myinput.file." In the beginning, everything is going well. "loading genome: home/igv/genome.hg38.genome; -> Genome loaded. id = hg38; -> Listen on port 60151" But It didn't change anymore. The progress stops at "listen on port 60151". I am trying to figure it out. Thanks again.

ADD REPLY
0
Entering edit mode
5.9 years ago
cmdcolin ★ 4.0k

You could maybe do this with samtools mpileup

The mpileup command gets you most of the way there and then a small script can count number of "A","G","T","C" at each position Coverage In Bam File - Bases And Overall Count

ADD COMMENT
0
Entering edit mode

Thank you very much. Samtools mpileup command output the details of each base. For those who interested in the output file of mpileup, here are the details of each column in the output file. http://samtools.sourceforge.net/pileup.shtml

ADD REPLY

Login before adding your answer.

Traffic: 1916 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