Selects a single sample on which to operate.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3080 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
20e3ba15ca
commit
8048b709a0
|
|
@ -0,0 +1,16 @@
|
|||
package org.broadinstitute.sting.gatk.filters;
|
||||
|
||||
import net.sf.picard.filter.SamRecordFilter;
|
||||
import net.sf.samtools.SAMRecord;
|
||||
import net.sf.samtools.SAMReadGroupRecord;
|
||||
import org.broadinstitute.sting.utils.cmdLine.Argument;
|
||||
|
||||
public class SampleFilter implements SamRecordFilter {
|
||||
@Argument(fullName = "sample_to_keep", shortName = "goodSM", doc="The name of the sample to keep, filtering out all others", required=true)
|
||||
private String SAMPLE_TO_KEEP = null;
|
||||
|
||||
public boolean filterOut( final SAMRecord read ) {
|
||||
final SAMReadGroupRecord readGroup = read.getReadGroup();
|
||||
return !( readGroup != null && readGroup.getSample().equals( SAMPLE_TO_KEEP ) );
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue