From: tzvanaalten Date: Mon, 24 Jul 2017 12:37:14 +0000 (+0100) Subject: JAL-2599 .hmm parser should now accept older .hmm files X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ef5d2c155d9c77ec96ba9c8e41a96b045746b937;p=jalview.git JAL-2599 .hmm parser should now accept older .hmm files --- diff --git a/src/jalview/io/HMMFile.java b/src/jalview/io/HMMFile.java index a7a0a0c..95e2017 100644 --- a/src/jalview/io/HMMFile.java +++ b/src/jalview/io/HMMFile.java @@ -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. *