JAL-2738 PoC of Load VCF file on to gene sequence
[jalview.git] / src / jalview / ext / htsjdk / VCFReader.java
index 8dfd7e2..c5e09e0 100644 (file)
@@ -3,6 +3,7 @@ package jalview.ext.htsjdk;
 import htsjdk.samtools.util.CloseableIterator;
 import htsjdk.variant.variantcontext.VariantContext;
 import htsjdk.variant.vcf.VCFFileReader;
+import htsjdk.variant.vcf.VCFHeader;
 
 import java.io.Closeable;
 import java.io.File;
@@ -72,7 +73,8 @@ public class VCFReader implements Closeable, Iterable<VariantContext>
   /**
    * Queries for records overlapping the region specified. Note that this method
    * requires a VCF file with an associated index. If no index exists a
-   * TribbleException will be thrown.
+   * TribbleException will be thrown. Client code should call close() on the
+   * iterator when finished with it.
    * 
    * @param chrom
    *          the chromosome to query
@@ -87,4 +89,14 @@ public class VCFReader implements Closeable, Iterable<VariantContext>
   {
     return reader == null ? null : reader.query(chrom, start, end);
   }
+
+  /**
+   * Returns an object that models the VCF file headers
+   * 
+   * @return
+   */
+  public VCFHeader getFileHeader()
+  {
+    return reader == null ? null : reader.getFileHeader();
+  }
 }