From ef5d2c155d9c77ec96ba9c8e41a96b045746b937 Mon Sep 17 00:00:00 2001 From: tzvanaalten Date: Mon, 24 Jul 2017 13:37:14 +0100 Subject: [PATCH] JAL-2599 .hmm parser should now accept older .hmm files --- src/jalview/io/HMMFile.java | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) 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. * -- 1.7.10.2