Igv Coverage Track Display
2
2
Entering edit mode
10.6 years ago
liupfskygre ▴ 210

Hi,

Does anyone here know how to reverse the coverage track in IGV? I have separate the reads mapped to the + and - strand and want to display them one upwards and the other downwards, like the picture here:

http://davetang.org/muse/2013/09/07/creating-a-coverage-plot-in-r/cage_density_plot_histo/

Thanks!

coverage igv • 5.7k views
ADD COMMENT
0
Entering edit mode

I don't think you can with IGV. There's a reason that example used R.

ADD REPLY
3
Entering edit mode
9.3 years ago

First, you need to use bedtools to convert bam or bed file into bedgraph format for positive strand and negative strand respectively. Please remember multiply the coverage of negative strand by "-1". Then you can merge these two files together and load it in IGV.

Here is the example:

samtools view -h -b Input.bam | bedtools bamtobed -ed -i - | bedtools genomecov -split -strand "+" -i - -g mm10.chrom.sizes -bg -trackline -trackopts 'name="Input" visibility=2 color=255,30,30' > Input.bedgraph
samtools view -h -b Input.bam | bedtools bamtobed -ed -i - | bedtools genomecov -split -strand "-" -i - -g mm10.chrom.sizes -bg | awk '{OFS="\t"}{print $1,$2,$3,$4*-1;}' >> Input.bedgraph
ADD COMMENT
0
Entering edit mode
10.6 years ago

You can't do that in IGV because a coordinate cannot have two different values.

What you can do however is split the data into two tracks and plot the positive values in one and the negative ones in the other

ADD COMMENT
0
Entering edit mode

This works in UCSC the same way. In a track hub, you can add the trackDb setting negateValues on to your bigWig file, to plot the value downwards. You may also want to change the color e.g. to red with color 255,0,0.

ADD REPLY

Login before adding your answer.

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