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.
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!
2 answers
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
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
Log in to answer this question.
I don't think you can with IGV. There's a reason that example used R.