X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fhtsjdk%2FHtsContigDb.java;h=73d16745a22cb6447bdd04bfe86e1391a63ea17d;hb=296593216c47a835f462d1d74a40b41e4818f737;hp=729f658ba6cf457fd05a372e526772ad128b2793;hpb=b87ae5ac68939a1b964682046e8b07958fae219a;p=jalview.git diff --git a/src/jalview/ext/htsjdk/HtsContigDb.java b/src/jalview/ext/htsjdk/HtsContigDb.java index 729f658..73d1674 100644 --- a/src/jalview/ext/htsjdk/HtsContigDb.java +++ b/src/jalview/ext/htsjdk/HtsContigDb.java @@ -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; }