Calculate Mapping Density Along Chromosome Coordinates
2
1
Entering edit mode
12.5 years ago
Bioscientist ★ 1.7k

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

r • 3.9k views
ADD COMMENT
3
Entering edit mode
12.5 years ago

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.

ADD COMMENT
1
Entering edit mode

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

ADD REPLY
1
Entering edit mode
12.5 years ago

Have you looked at:

  • BEDtools
  • pysam (python)
  • IRanges (R/Bioconductor)
  • samtools
ADD COMMENT

Login before adding your answer.

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