JAL-2599 .hmm parser should now accept older .hmm files
authortzvanaalten <tzvanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Mon, 24 Jul 2017 12:37:14 +0000 (13:37 +0100)
committertzvanaalten <tzvanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Mon, 24 Jul 2017 12:37:14 +0000 (13:37 +0100)
src/jalview/io/HMMFile.java

index a7a0a0c..95e2017 100644 (file)
@@ -249,25 +249,36 @@ public class HMMFile extends AlignFile
       scanner.next();
     }
 
-    char consensusR;
-    consensusR = charValue(scanner.next());
-    hmm.getNodes().get(index).setConsensusResidue(consensusR);
+    if (scanner.hasNext())
+    {
+      char consensusR;
+      consensusR = charValue(scanner.next());
+      hmm.getNodes().get(index).setConsensusResidue(consensusR);
+    }
 
+    if (scanner.hasNext())
+    {
       char reference;
       reference = charValue(scanner.next());
       hmm.getNodes().get(index).setReferenceAnnotation(reference);
+    }
 
-
+    if (scanner.hasNext())
+    {
       char value;
       value = charValue(scanner.next());
       hmm.getNodes().get(index).setMaskValue(value);
-
-    char consensusS;
-    consensusS = charValue(scanner.next());
-    hmm.getNodes().get(index).setConsensusStructure(consensusS);
+    }
+    if (scanner.hasNext())
+    {
+      char consensusS;
+      consensusS = charValue(scanner.next());
+      hmm.getNodes().get(index).setConsensusStructure(consensusS);
+    }
   }
 
 
+
   /**
    * Fills a list of doubles based on an input line.
    *