Added methods to get strand bias and to test if record has allele freq or bias fields set.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1993 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-11-09 04:20:35 +00:00
parent 3313b0ddb4
commit d07f3bb6f6
1 changed files with 21 additions and 0 deletions

View File

@ -78,6 +78,11 @@ public class RodVCF extends BasicReferenceOrderedDatum implements VariationRod,
if (!this.isBiallelic()) throw new StingException("We're not bi-allelic."); if (!this.isBiallelic()) throw new StingException("We're not bi-allelic.");
} }
public boolean hasNonRefAlleleFrequency() {
return (this.mCurrentRecord.getInfoValues().containsKey("AF") ||
(this.mCurrentRecord.getInfoValues().containsKey("AC") && this.mCurrentRecord.getInfoValues().containsKey("AN")));
}
/** /**
* get the frequency of this variant * get the frequency of this variant
* *
@ -101,6 +106,22 @@ public class RodVCF extends BasicReferenceOrderedDatum implements VariationRod,
return 0.0; return 0.0;
} }
public boolean hasStrandBias() {
return this.mCurrentRecord.getInfoValues().containsKey("SB");
}
/**
* get the strand bias of this variant
*
* @return StrandBias with the stored slod
*/
public double getStrandBias() {
assertNotNull();
if (this.mCurrentRecord.getInfoValues().containsKey("SB"))
return Double.valueOf(this.mCurrentRecord.getInfoValues().get("SB"));
return 0.0;
}
/** @return the VARIANT_TYPE of the current variant */ /** @return the VARIANT_TYPE of the current variant */
@Override @Override
public VARIANT_TYPE getType() { public VARIANT_TYPE getType() {