JAL-2850 JAL-1766 option to load contig sequence referenced by VCF
[jalview.git] / src / jalview / ext / htsjdk / HtsContigDb.java
index 729f658..73d1674 100644 (file)
@@ -250,10 +250,19 @@ public class HtsContigDb
 
   // ///// end of hts bits.
 
+  /**
+   * Reads the contig with the given id and returns as a Jalview SequenceI object.
+   * Note the database must be indexed for this operation to succeed.
+   * 
+   * @param id
+   * @return
+   */
   public SequenceI getSequenceProxy(String id)
   {
-    if (!isValid())
+    if (!isValid() || !refFile.isIndexed())
     {
+      System.err.println(
+              "Cannot read contig as file is invalid or not indexed");
       return null;
     }