Skip to content
Snippets Groups Projects
Commit bae8214b authored by Aaron's avatar Aaron
Browse files

Forced proper BEDPE order for bamToBed and pairToBed.

parent 7b52f3e3
No related branches found
No related tags found
No related merge requests found
......@@ -402,8 +402,7 @@ void PrintBedPE(const BamAlignment &bam1, const BamAlignment &bam2, const RefVec
swap(chrom1, chrom2);
swap(start1, start2);
swap(end1, end2);
swap(strand1, strand2);
if (useEditDistance == true) swap(editDistance1, editDistance2);
swap(strand1, strand2);
}
// report BEDPE using min mapQuality
......
......@@ -126,6 +126,14 @@ private:
}
}
// swap the ends if necessary
if ( a.chrom1 > a.chrom2 || ((a.chrom1 == a.chrom2) && (a.start1 > a.start2)) ) {
swap(a.chrom1, a.chrom2);
swap(a.start1, a.start2);
swap(a.end1, a.end2);
swap(a.strand1, a.strand2);
}
// compute the minimum mapping quality b/w the two ends of the pair.
a.score = "0";
if (_useEditDistance == false) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment