Hello all,
I have a paired end bam file and I want to use bedtools for them. After merging, the paired end read alignments are not lying next to each other. It is making problems in the bedtools process. Is there any tool available to rearrange the paired end read alignments in bam file?
Thanks, Deeps
2 answers
If you are using Picard , you can sort by queryname.
Copy and pasting from Picard's manual:
SortSam
USAGE: SortSam [options]
Documentation: http://picard.sourceforge.net/command-line-overview.shtml#SortSam
Input and output formats are determined by file extension.
Option Description
INPUT=File The BAM or SAM file to sort. Required.
OUTPUT=File The sorted BAM or SAM output file. Required.
SORT_ORDER=SortOrder Sort order of output file Required. Possible values: {unsorted, queryname, coordinate}
Log in to answer this question.