Bamtobed paired mate error
1
0
Entering edit mode
5.2 years ago
rbronste ▴ 420

Hi I am trying to make a -bedpe file using bedtools bamtobed and am running into a problem. I get many of the following error messages after this command.

bedtools bamtobed -bedpe -i male_1_sorted_rmdup.bam > male_1_sorted_rmdup.bed

Errors:

*****WARNING: Query NB551387:262:H3FMVBGXC:3:21408:20039:5256 is marked as paired, but its mate does not occur next to it in your BAM file.  Skipping.

If I run samtools flagstat on the bam file input it appears that the mates are properly paired. These are sorted bam files from which I have removed the duplicates Picard. They are otherwise not processed, made with Bowtie2.

samtools flagstat male_1_sorted_rmdup.bam

21276014 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 duplicates
21276014 + 0 mapped (100.00%:-nan%)
21276014 + 0 paired in sequencing
10638007 + 0 read1
10638007 + 0 read2
21276014 + 0 properly paired (100.00%:-nan%)
21276014 + 0 with itself and mate mapped
0 + 0 singletons (0.00%:-nan%)
0 + 0 with mate mapped to a different chr
0 + 0 with mate mapped to a different chr (mapQ>=5)

Wondering why this may be happening? Thanks!

bedtools bedops bamtobed bed • 3.3k views
ADD COMMENT
1
Entering edit mode

The post calls it an Error but the tool says it's a Warning. Warnings can be ignored (for the moment at least). The situation is definitely interesting though, I'm curious what the reasoning behind this warning could be.

ADD REPLY
0
Entering edit mode

Yes you are correct it is a warning however still would like to figure out a fix as its severely reducing the bedpe information I get.

ADD REPLY
1
Entering edit mode
5.2 years ago
ATpoint 85k

You have to sort by query name samtools sort -nfor paired-end data as bedtools required mate reads directly adjacent to each other. It is recommended to read the help messages of the tools you use before running it:

bedtools bamtobed --help
(...)
-bedpe  Write BEDPE format.
        - Requires BAM to be grouped or sorted by query.
ADD COMMENT

Login before adding your answer.

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