deal with different contigs

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1146 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-07-01 19:17:27 +00:00
parent 20fab507a8
commit 76fd4b3848
1 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,6 @@ public class CleanedReadInjector extends ReadWalker<Integer,Integer> {
while ( allReads.hasNext() ) {
SAMRecord read = allReads.next();
cleanedReads.add(read);
String uniquifiedReadName = getUniquifiedReadName(read);
cleanedReadHash.add(getUniquifiedReadName(read));
}
allReads.close();
@ -94,15 +93,16 @@ public class CleanedReadInjector extends ReadWalker<Integer,Integer> {
// first emit reads from the cleaned set if appropriate
int cleanedReadCount = 0;
SAMRecord firstCleanedRead = cleanedReads.peek();
while ( firstCleanedRead != null && firstCleanedRead.getAlignmentStart() <= read.getAlignmentStart() ) {
while ( firstCleanedRead != null &&
firstCleanedRead.getReferenceIndex() <= read.getReferenceIndex() &&
firstCleanedRead.getAlignmentStart() <= read.getAlignmentStart() ) {
outputBAM.addAlignment(firstCleanedRead);
cleanedReadCount++;
cleanedReads.remove();
firstCleanedRead = cleanedReads.peek();
}
String uniquifiedReadName = getUniquifiedReadName(read);
if ( !cleanedReadHash.contains(uniquifiedReadName) )
if ( !cleanedReadHash.contains(getUniquifiedReadName(read)) )
outputBAM.addAlignment(read);
return cleanedReadCount;
}