Question: MACS2 BAMPE and BEDPE gave dramatically different "mean fragment size"
0
gravatar for Xinwei Han
22 months ago by
Xinwei Han0
Xinwei Han0 wrote:

Using the same paired-end data, MACS2 BAMPE mode gave mean fragment size of 111bp, while BEDPE mode gave mean fragment size of 259bp.

To produce bedpe files from BAM files, I followed one previous thread in the MACS2 GitHub repository: https://github.com/taoliu/MACS/issues/183

Basically, I used "samtools view -b -f 2 -F 4 -F 8 -F 256 -F 512 -F 2048" to select reads first, and finally cut 3 columns of bedtools ouput to make the bedpe files specific to MACS2.

I also used "Picard collectinsertsizemetrics" to check insert size distribution, the median of which is very close to the "mean fragment size" in BEDPE mode. The size in BAMPE mode seemed mistakenly small.

I am using MACS2 2.1.1.20160309 installed with miniconda.

I also posted the same question (along with two log files) in the MACS2 repository at GitHub ( https://github.com/taoliu/MACS/issues/217 ), but have not gotten any feedback. I guess there are more MACS2 users in Biostars. So I re-post the question here, just to make sure I am using MACS2 correctly.

I noticed mcjmigdal in this thread (MACS2 produces different results using BAMPE and BEDPE) also ran into this problem. Hope we can sort this out.

Many thanks, Xinwei

chip-seq • 896 views
ADD COMMENTlink modified 21 months ago by Biostar ♦♦ 20 • written 22 months ago by Xinwei Han0

This appears to be a very specific issue that, possibly, the developer will have to address. Like you, I have seen others with the same issue, but there does not appear to have been a solution on any forum.

Have you tried things like re-aligning your data and only including reads that: are properly paired align uniquely in the genome ?

...basically just including the best quality data in your BAM file to see if that improves the situation. With Bowtie, you can ensure unique mapping. In fact, I always switch that on for ChIP-seq data by supplying the --best -m 1 parameters to Bowtie.

ADD REPLYlink written 22 months ago by Kevin Blighe47k

Thanks for sharing! I used bowtie2 for mapping these data. After mapping, I required mapping quality to be at least 5 (samtools view -q 5), in order to remove multiply mapped reads.

In this thread (https://github.com/taoliu/MACS/issues/183), the developer mentioned the BAMPE mode implements internally something like "samtools view -b -f 2 -F 4 -F 8 -F 256 -F 512 -F 2048", so only properly mapped reads are used by MACS2. It should not matter much how read alignment is filtered in the previous steps.

Currently, I just use BEDPE mode, as the fragment size in this mode is close to "Picard collectinsertsizemetrics".

ADD REPLYlink written 22 months ago by Xinwei Han0

Yes, that samtools command should only include properly mapped read pairs, and also only retain primary alignments. Strange issue!

ADD REPLYlink written 22 months ago by Kevin Blighe47k
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: 638 users visited in the last hour