Modified SampleFilter to allow for multiple samples to be given. AminoAcidTransition now turns on when you give VariantEval the right commands.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3812 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
b0fc42906e
commit
75bea4881a
|
|
@ -30,12 +30,14 @@ import net.sf.samtools.SAMRecord;
|
||||||
import net.sf.samtools.SAMReadGroupRecord;
|
import net.sf.samtools.SAMReadGroupRecord;
|
||||||
import org.broadinstitute.sting.commandline.Argument;
|
import org.broadinstitute.sting.commandline.Argument;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class SampleFilter implements SamRecordFilter {
|
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)
|
@Argument(fullName = "sample_to_keep", shortName = "goodSM", doc="The name of the sample(s) to keep, filtering out all others", required=true)
|
||||||
private String SAMPLE_TO_KEEP = null;
|
private Set SAMPLES_TO_KEEP = null;
|
||||||
|
|
||||||
public boolean filterOut( final SAMRecord read ) {
|
public boolean filterOut( final SAMRecord read ) {
|
||||||
final SAMReadGroupRecord readGroup = read.getReadGroup();
|
final SAMReadGroupRecord readGroup = read.getReadGroup();
|
||||||
return !( readGroup != null && readGroup.getSample().equals( SAMPLE_TO_KEEP ) );
|
return !( readGroup != null && SAMPLES_TO_KEEP.contains(readGroup.getSample()) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,10 +127,12 @@ public class AminoAcidTransition extends VariantEvaluator {
|
||||||
private String infoKey;
|
private String infoKey;
|
||||||
private String infoValueSplit;
|
private String infoValueSplit;
|
||||||
private boolean useCodons;
|
private boolean useCodons;
|
||||||
|
private boolean enabled;
|
||||||
private AminoAcidTable lookup;
|
private AminoAcidTable lookup;
|
||||||
|
|
||||||
public AminoAcidTransition(VariantEvalWalker parent) {
|
public AminoAcidTransition(VariantEvalWalker parent) {
|
||||||
super(parent);
|
super(parent);
|
||||||
|
enabled = parent.aminoAcidTransitionKey != null;
|
||||||
getParsingInformation(parent);
|
getParsingInformation(parent);
|
||||||
lookup = new AminoAcidTable();
|
lookup = new AminoAcidTable();
|
||||||
acidTable = new AminoAcidTiTvTable();
|
acidTable = new AminoAcidTiTvTable();
|
||||||
|
|
@ -160,7 +162,7 @@ public class AminoAcidTransition extends VariantEvaluator {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean enabled() {
|
public boolean enabled() {
|
||||||
return false;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue