From e051311e8cf457f999eac4d618c47ae2ef431364 Mon Sep 17 00:00:00 2001 From: ebanks Date: Wed, 16 Dec 2009 17:58:41 +0000 Subject: [PATCH] Added convenience methods in RodVCF to pull out all of the VCF data from the VCFRecord (e.g. getID(), getSamples(), getInfoValues()) git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2374 348d0f76-0448-11de-a6fe-93d51630548a --- .../sting/gatk/refdata/RodVCF.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/java/src/org/broadinstitute/sting/gatk/refdata/RodVCF.java b/java/src/org/broadinstitute/sting/gatk/refdata/RodVCF.java index b9cd653ff..76201a0c8 100755 --- a/java/src/org/broadinstitute/sting/gatk/refdata/RodVCF.java +++ b/java/src/org/broadinstitute/sting/gatk/refdata/RodVCF.java @@ -13,6 +13,7 @@ import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; +import java.util.Map; /** @@ -104,6 +105,11 @@ public class RodVCF extends BasicReferenceOrderedDatum implements VariationRod, return mCurrentRecord.getType(); } + public String getID() { + assertNotNull(); + return mCurrentRecord.getID(); + } + /** * are we a SNP? If not we're a Indel/deletion * @@ -166,6 +172,16 @@ public class RodVCF extends BasicReferenceOrderedDatum implements VariationRod, return mCurrentRecord.getNegLog10PError(); } + public double getQual() { + assertNotNull(); + return mCurrentRecord.getQual(); + } + + public boolean hasAlternateAllele() { + assertNotNull(); + return mCurrentRecord.hasAlternateAllele(); + } + /** * gets the alternate alleles. This method should return all the alleles present at the location, * NOT including the reference base. This is returned as a string list with no guarantee ordering @@ -232,6 +248,11 @@ public class RodVCF extends BasicReferenceOrderedDatum implements VariationRod, return mCurrentRecord.getReferenceForSNP(); } + public boolean hasGenotypeData() { + assertNotNull(); + return mCurrentRecord.hasGenotypeData(); + } + /** * get the genotype * @@ -275,6 +296,36 @@ public class RodVCF extends BasicReferenceOrderedDatum implements VariationRod, return mCurrentRecord.hasGenotype(x); } + public String[] getSampleNames() { + assertNotNull(); + return mCurrentRecord.getSampleNames(); + } + + public Map getInfoValues() { + assertNotNull(); + return mCurrentRecord.getInfoValues(); + } + + public String[] getFilteringCodes() { + assertNotNull(); + return mCurrentRecord.getFilteringCodes(); + } + + public boolean isFiltered() { + assertNotNull(); + return mCurrentRecord.isFiltered(); + } + + public boolean hasFilteringCodes() { + assertNotNull(); + return mCurrentRecord.hasFilteringCodes(); + } + + public String getFilterString() { + assertNotNull(); + return mCurrentRecord.getFilterString(); + } + public VCFHeader getHeader() { return mReader.getHeader(); }