Open qqwang-berkeley opened 6 years ago
Could you please check if this result persists with version 2.27.1 on the bedtools2 repository: https://github.com/arq5x/bedtools2/releases If the issue persists could you post it in that repo (bedtools2, not bedtools)?
I have a sorted bam and a bed file and tried to find reads in the bam file that overlap with entries in the bed file. I tried two ways:
1) intersectBed -abam sorted.bam -b sample.bed -f 1 > intersect.bam
2) First sort the bed file using the chromosome order in the bam file header: bedtools sort -faidx chromo_order_in_sam_header.txt -i sample.bed > sample_sorted.bam
intersectBed -abam sorted.bam -b sample_sorted.bed -sorted -g genome_file.txt -f 1 > intersect_sorted.bam
These two ways gave different results. A check on genome browser shows that 1) is giving the right answer while 2) is missing a lot of reads. Have you observed this before and do you have any recommendations to make the results match?
Qingqing