X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fhtsjdk%2FHtsContigDb.java;h=73d16745a22cb6447bdd04bfe86e1391a63ea17d;hb=947109cebef3e98693ffc0a70b5bffcbd32217e2;hp=729f658ba6cf457fd05a372e526772ad128b2793;hpb=d53f86449820b92534376bd383e92a083037ec90;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; }