X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FHMMNode.java;h=b646eeea8af08ee5bc657f6d0cb215aeef85d54f;hb=ef2b8e4a4d6db3bb95506b523c27dfd3231b12f3;hp=93fa49e6ed71211aa06db32694d35e5ff1c7b5b8;hpb=dad3f91c2f9a38ce8c64a688b6f1ba4f539af9fc;p=jalview.git diff --git a/src/jalview/datamodel/HMMNode.java b/src/jalview/datamodel/HMMNode.java index 93fa49e..b646eee 100644 --- a/src/jalview/datamodel/HMMNode.java +++ b/src/jalview/datamodel/HMMNode.java @@ -18,7 +18,7 @@ public class HMMNode double[] stateTransitions; //annotations - Integer alignmentColumn = null; + int residueNumber; char consensusResidue; char referenceAnnotation; char maskValue; @@ -36,7 +36,7 @@ public class HMMNode return matchEmissions; } - public double getMatchEmission(int symbolIndex) + double getMatchEmission(int symbolIndex) { return matchEmissions[symbolIndex]; } @@ -51,7 +51,7 @@ public class HMMNode return insertEmissions; } - public double getInsertEmission(int symbolIndex) + double getInsertEmission(int symbolIndex) { return insertEmissions[symbolIndex]; } @@ -66,7 +66,7 @@ public class HMMNode return stateTransitions; } - public double getStateTransition(int transition) + double getStateTransition(int transition) { return stateTransitions[transition]; } @@ -76,15 +76,16 @@ public class HMMNode this.stateTransitions = stateTransitionsM; } - public Integer getAlignmentColumn() + int getResidueNumber() { - return alignmentColumn; + return residueNumber; } - public void setAlignmentColumn(int alignmentColumn) + public void setResidueNumber(int resNo) { - this.alignmentColumn = alignmentColumn; + this.residueNumber = resNo; } - public char getConsensusResidue() + + char getConsensusResidue() { return consensusResidue; } @@ -92,7 +93,8 @@ public class HMMNode { this.consensusResidue = consensusResidue; } - public char getReferenceAnnotation() + + char getReferenceAnnotation() { return referenceAnnotation; } @@ -100,7 +102,8 @@ public class HMMNode { this.referenceAnnotation = referenceAnnotation; } - public char getMaskValue() + + char getMaskValue() { return maskValue; } @@ -108,7 +111,8 @@ public class HMMNode { this.maskValue = maskValue; } - public char getConsensusStructure() + + char getConsensusStructure() { return consensusStructure; } @@ -116,6 +120,29 @@ public class HMMNode { this.consensusStructure = consensusStructure; } + + /** + * Answers the symbol index of the symbol with the highest match emission + * probability (first symbol in case of a tie). Note this object stores + * probabilities, not the negative logarithms as in the HMM file. + * + * @return + */ + int getMaxMatchEmissionIndex() + { + int maxIndex = 0; + double max = 0D; + + for (int i = 0; i < matchEmissions.length; i++) + { + if (matchEmissions[i] > max) + { + max = matchEmissions[i]; + maxIndex = i; + } + } + return maxIndex; + } }