Skip to content

Commit

Permalink
Further tweaks to read info
Browse files Browse the repository at this point in the history
  • Loading branch information
lmose committed Sep 14, 2017
1 parent bda0d77 commit 6207cd5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/java/abra/SortedSAMWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,22 @@ private SortingSAMRecordCollection updateReadMatesAndSortByCoordinate(SortingSAM

mates.clear();
currReads.clear();
currReadName = read.getReadName();
}

// Cache reads with same read name
currReads.add(read);

// Cache read by mate info
MateKey mateKey = getOriginalReadInfo(read);
SAMRecord existingMate = mates.get(mateKey);
if (existingMate == null || (existingMate.getFlags() & 0xA00) != 0) {
// Cache read info giving priority to primary alignments
mates.put(mateKey, read);
if (read.getSupplementaryAlignmentFlag() != true && (read.getFlags() & 0x100) == 0) {
MateKey mateKey = getOriginalReadInfo(read);
SAMRecord existingMate = mates.get(mateKey);

// if (existingMate == null || existingMate.getSupplementaryAlignmentFlag() == true || (existingMate.getFlags() & 0x100) != 0) {
if (existingMate == null) {
// Cache read info giving priority to primary alignments
mates.put(mateKey, read);
}
}
}

Expand Down

0 comments on commit 6207cd5

Please sign in to comment.