Question: how to extract per base information (in coverage track of IGV) from .bam file
0
gravatar for xzhangxmu
2.1 years ago by
xzhangxmu0
xzhangxmu0 wrote:

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 • 1.9k views
ADD COMMENTlink modified 2.1 years ago by cmdcolin1.5k • written 2.1 years ago by xzhangxmu0
1
gravatar for cpad0112
2.1 years ago by
cpad011214k
Hyderabad India
cpad011214k wrote:
  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 COMMENTlink written 2.1 years ago by cpad011214k

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 REPLYlink written 2.0 years ago by xzhangxmu0
0
gravatar for cmdcolin
2.1 years ago by
cmdcolin1.5k
United States
cmdcolin1.5k wrote:

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 COMMENTlink written 2.1 years ago by cmdcolin1.5k

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 REPLYlink written 2.0 years ago by xzhangxmu0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2514 users visited in the last hour
_