Just one note - if you are using BAM, the -g option is no longer needed (as of v2.13.1), as the chrom sizes are identified in the BAM header
Calculate Mapping Density Along Chromosome Coordinates
As title I hope to calculate mapping density for chromosome 2,(doubt there's some hotspot for mapping). And eventually plot the histogram for visualization.
How can I do this? Use python or R? thx
• 4,575 views
•
link
2 answers
You give very little information, so I can only give you a general answer and assume you have a mapping in SAM or BAM format for which you want to know the vertical coverage.
There are many possibilities, depending on what you want exactly and size of your data among others. One of them is using genomeCoverageBed from BEDtools:
genomeCoverageBed -ibam sample.bam -d -g genome.bed
Another is looking at the fourth or so column of samtools mpileup results.
• 1 views
•
link
• 0 views
•
link
Have you looked at:
- BEDtools
- pysam (python)
- IRanges (R/Bioconductor)
- samtools
• 2 views
•
link
Log in to answer this question.