I'm having trouble with converting the bam file into bed -bedpe using the bedtools.
workflow: samtools sort -n mut.bam mut.Namesorted bamTobed -i mut.Namesorted.bam -bedpe > dilpMerged_bedpe.bed
After sorting the file by read name (option -n) I run the bamTobed command. but it gives me an error message after running a few lines:
* ERROR: -bedpe requires BAM to be sorted/grouped by query name.
What am I doing wrong here?