Question: Bamtobed paired mate error
0
gravatar for rbronste
9 months ago by
rbronste360
rbronste360 wrote:

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!

bamtobed bedops bed bedtools • 394 views
ADD COMMENTlink modified 9 months ago by ATpoint36k • written 9 months ago by rbronste360
1

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 REPLYlink written 9 months ago by RamRS27k

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 REPLYlink written 9 months ago by rbronste360
1
gravatar for ATpoint
9 months ago by
ATpoint36k
Germany
ATpoint36k wrote:

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 COMMENTlink modified 9 months ago • written 9 months ago by ATpoint36k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1368 users visited in the last hour