Question: Circos Histogram Bam File
gravatar for Sander Timmer
8.5 years ago by
Sander Timmer700
United Kingdom
Sander Timmer700 wrote:

I've a BAM that I'd like to show its coverage off in a circos plot (

Is there a standardised way of going from a BAM file towards such a histogram in circos?

bam • 9.0k views
ADD COMMENTlink modified 6.2 years ago by Biostar ♦♦ 20 • written 8.5 years ago by Sander Timmer700

I checked galaxy for circos , but not getting respective link ... pls share it ..

ADD REPLYlink modified 6.8 years ago • written 6.8 years ago by archie100
gravatar for dfornika
8.5 years ago by
Vancouver, British Columbia, Canada
dfornika1.0k wrote:

Start by generating a .pileup file with:

samtools mpileup -f your_reference.fa your_bamfile.bam > your_pileup.pileup

Then extract the chromosome , coordinates, and coverage fields with:

cut -f 1,2,4 your_pileup.pileup > coverage_file.txt

Then I'd imagine you will need to do some sort of downsampling before you load this in circos, because you likely won't have the resolution to show coverage for every base in your dataset. Someone else will have to help out with that step. Maybe take an average of every 100kb? That would take 3 billion points down to a reasonable 30,000 points.

The input for circos needs to be of the form:

chromosome start end coverage

So something like

chr1 1 100000 200
chr1 100001 200000 350
chr1 200001 300000 485

Then import into circos by adding something like this to your circos.conf:

file = data/coverage_file.txt
type = histogram
r0 = ?r
r1 = ?r
min= 0
max= ?
orientation = out
ADD COMMENTlink modified 8.5 years ago • written 8.5 years ago by dfornika1.0k

For the middle section, you can use bedmap module from bedops suite ( with --sum flag. You will need to make a bed file defining your windows in downsampling step as your mapfile, though. Hope this helps.

ADD REPLYlink written 6.8 years ago by Noushin N580

Great, thanks a lot this is exactly what I was looking for!

ADD REPLYlink written 8.5 years ago by Sander Timmer700

You're welcome, sorry I couldn't give more specific instructions for that middle section, but hopefully you'll find some way to automate it.

ADD REPLYlink written 8.5 years ago by dfornika1.0k

for the middle portion, one can use -bg option from bedtools genomecov program

ADD REPLYlink modified 14 months ago by _r_am32k • written 5.3 years ago by Prakki Rama2.4k

Note that samtools mpileup has a default coverage cap at 800 (I think)

ADD REPLYlink written 5.9 years ago by Andreas2.5k
gravatar for kristen.dang
8.5 years ago by
kristen.dang10 wrote:

If I heard correctly, I believe Jeremy Goecks announced at ISMB that circos visualizations have been/are being added as a new feature of Galaxy/Trackster. I haven't checked it out but it sounds like a good option compared to doing it directly through circos. I've used circos a bit and it is not easy.

ADD COMMENTlink written 8.5 years ago by kristen.dang10
Please log in to add an answer.


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