Hi all, I am trying to convert a pair-end bam file to bedpe.
I use the code below: (Inspired by James)
samtools sort -@ 16 -n in.bam in.sorted samtools fixmate in.sorted.bam in.sorted.fixed.bam samtools view -@ 16 -bf 0x2 in.sorted.fixed.bam | bedtools bamtobed -i stdin -bedpe > in.sorted.fixed.bedpe
I use a bash script to run all the commands. After running the code, the bedpe file generated is empty while there is no warning or error reported during execution.
Using samtools view to check :
samtools view -H in.sorted.fixed.bam
The in.sorted.fixed.bam is sorted: @HD VN:1.0 SO:queryname
Does anyone get a hint of what would be the problem?
Thanks a lot!!!