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?
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?
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:
(plot)
file = data/coverage_file.txt
type = histogram
r0 = ?r
r1 = ?r
min= 0
max= ?
orientation = out
...
(rules)
(/rules)
(/plot)
For the middle section, you can use bedmap module from bedops suite (https://bedops.readthedocs.org/en/latest/content/reference/statistics/bedmap.html) with --sum flag. You will need to make a bed file defining your windows in downsampling step as your mapfile, though. Hope this helps.
for the middle portion, one can use -bg
option from bedtools genomecov program
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.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
I checked galaxy for circos , but not getting respective link ... pls share it ..