For a given set of coordinates is there a simple fast way of determining the 'summit' coordinate,
2
0
Entering edit mode
9.9 years ago
User 9088 ▴ 20

I have a BAM file from DNase-seq experiment and a result of peak calling analysis.

For a given set of coordinates is there a simple fast way of determining the 'summit' coordinate, i.e the coordinate with the highest read pileup.

The peak caller does report the summit from its own data, but i want to check out different regions.

Thanks.

DNase-seq • 2.2k views
ADD COMMENT
0
Entering edit mode
9.9 years ago

The depth is the 4th column, though that may not be correct if your reads are paired-end. You could find the location of the maximum with a simple awk script:

samtools mpileup ...options... foo.bam | awk '{if($4 > maxdepth) {chr=$1; pos=$2; maxdepth=$4;}}END{print chr,pos,maxdepth}'
ADD COMMENT
0
Entering edit mode
9.9 years ago

One option is to use BEDOPS and format your regions-of-interest into a BED file called regions.bed:

$ bam2bed < foo.bam | bedmap --echo --max-element regions.bed - > answer.bed

The bam2bed script converts the BAM file to BED and pipes it to bedmap, which uses the score operator --max-element to return the maximum scoring BAM element over each region in regions.bed.

ADD COMMENT

Login before adding your answer.

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