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 ) {
// user specified samples to select
String readSample = read.getReadGroup().getSample();
boolean found = false;
for (String sampleSelected : samplesToChoose) {
if (readSample.equalsIgnoreCase(sampleSelected)) {
found = true;
break;
}
}
if (!found)
// todo - should be case-agnostic but for simplicity and speed this is ignored.
// todo - can check at initialization intersection of requested samples and samples in BAM header to further speedup.
if (!samplesToChoose.contains(read.getReadGroup().getSample()))
return false;
}