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:
parent
20fab507a8
commit
76fd4b3848
|
|
@ -66,7 +66,6 @@ public class CleanedReadInjector extends ReadWalker<Integer,Integer> {
|
||||||
while ( allReads.hasNext() ) {
|
while ( allReads.hasNext() ) {
|
||||||
SAMRecord read = allReads.next();
|
SAMRecord read = allReads.next();
|
||||||
cleanedReads.add(read);
|
cleanedReads.add(read);
|
||||||
String uniquifiedReadName = getUniquifiedReadName(read);
|
|
||||||
cleanedReadHash.add(getUniquifiedReadName(read));
|
cleanedReadHash.add(getUniquifiedReadName(read));
|
||||||
}
|
}
|
||||||
allReads.close();
|
allReads.close();
|
||||||
|
|
@ -94,15 +93,16 @@ public class CleanedReadInjector extends ReadWalker<Integer,Integer> {
|
||||||
// first emit reads from the cleaned set if appropriate
|
// first emit reads from the cleaned set if appropriate
|
||||||
int cleanedReadCount = 0;
|
int cleanedReadCount = 0;
|
||||||
SAMRecord firstCleanedRead = cleanedReads.peek();
|
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);
|
outputBAM.addAlignment(firstCleanedRead);
|
||||||
cleanedReadCount++;
|
cleanedReadCount++;
|
||||||
cleanedReads.remove();
|
cleanedReads.remove();
|
||||||
firstCleanedRead = cleanedReads.peek();
|
firstCleanedRead = cleanedReads.peek();
|
||||||
}
|
}
|
||||||
|
|
||||||
String uniquifiedReadName = getUniquifiedReadName(read);
|
if ( !cleanedReadHash.contains(getUniquifiedReadName(read)) )
|
||||||
if ( !cleanedReadHash.contains(uniquifiedReadName) )
|
|
||||||
outputBAM.addAlignment(read);
|
outputBAM.addAlignment(read);
|
||||||
return cleanedReadCount;
|
return cleanedReadCount;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue