Further bug fixes/cleanups for PrintReadsWalker

This commit is contained in:
Guillermo del Angel 2011-07-20 10:44:37 -04:00
parent a2d90a3590
commit 7140280bf6
1 changed files with 3 additions and 11 deletions

View File

@ -114,17 +114,9 @@ public class PrintReadsWalker extends ReadWalker<SAMRecord, SAMFileWriter> {
} }
if (SAMPLES_SPECIFIED ) { if (SAMPLES_SPECIFIED ) {
// user specified samples to select // user specified samples to select
String readSample = read.getReadGroup().getSample(); // todo - should be case-agnostic but for simplicity and speed this is ignored.
boolean found = false; // todo - can check at initialization intersection of requested samples and samples in BAM header to further speedup.
for (String sampleSelected : samplesToChoose) { if (!samplesToChoose.contains(read.getReadGroup().getSample()))
if (readSample.equalsIgnoreCase(sampleSelected)) {
found = true;
break;
}
}
if (!found)
return false; return false;
} }