Clover icon

Coverage Report

  1. Project Clover database Wed Dec 3 2025 17:03:17 GMT
  2. Package jalview.datamodel

File HMMNode.java

 

Coverage histogram

../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

4
26
21
1
148
105
23
0.88
1.24
21
1.1

Classes

Class Line # Actions
HMMNode 8 26 23
1.0100%
 

Contributing tests

This file is covered by 18 tests. .

Source view

1    package jalview.datamodel;
2   
3    /**
4    * stores data for each node in the hmm model
5    * @author TZVanaalten
6    *
7    */
 
8    public class HMMNode
9    {
10    //contains the match emissions for each symbol
11    double[] matchEmissions;
12   
13    //contains the insert emissions for each symbol
14    double[] insertEmissions;
15   
16    // contains the state transitions for each possible transition. These are mm,
17    // mi, md, im, ii, dm and dd in order
18    double[] stateTransitions;
19   
20    //annotations
21    int residueNumber;
22    char consensusResidue;
23    char referenceAnnotation;
24    char maskValue;
25    char consensusStructure;
26   
27    /**
28    * Constructor
29    */
 
30  2651 toggle public HMMNode()
31    {
32    }
33   
 
34  1315 toggle public double[] getMatchEmissions()
35    {
36  1315 return matchEmissions;
37    }
38   
 
39  17840 toggle double getMatchEmission(int symbolIndex)
40    {
41  17840 return matchEmissions[symbolIndex];
42    }
43   
 
44  2647 toggle public void setMatchEmissions(double[] matches)
45    {
46  2647 this.matchEmissions = matches;
47    }
48   
 
49  1315 toggle public double[] getInsertEmissions()
50    {
51  1315 return insertEmissions;
52    }
53   
 
54  16 toggle double getInsertEmission(int symbolIndex)
55    {
56  16 return insertEmissions[symbolIndex];
57    }
58   
 
59  2648 toggle public void setInsertEmissions(double[] insertEmissionsL)
60    {
61  2648 this.insertEmissions = insertEmissionsL;
62    }
63   
 
64  1315 toggle public double[] getStateTransitions()
65    {
66  1315 return stateTransitions;
67    }
68   
 
69  18 toggle double getStateTransition(int transition)
70    {
71  18 return stateTransitions[transition];
72    }
73   
 
74  2648 toggle public void setStateTransitions(double[] stateTransitionsM)
75    {
76  2648 this.stateTransitions = stateTransitionsM;
77    }
78   
 
79  3971 toggle int getResidueNumber()
80    {
81  3971 return residueNumber;
82    }
 
83  5263 toggle public void setResidueNumber(int resNo)
84    {
85  5263 this.residueNumber = resNo;
86    }
87   
 
88  3945 toggle char getConsensusResidue()
89    {
90  3945 return consensusResidue;
91    }
 
92  2634 toggle public void setConsensusResidue(char consensusResidue)
93    {
94  2634 this.consensusResidue = consensusResidue;
95    }
96   
 
97  1311 toggle char getReferenceAnnotation()
98    {
99  1311 return referenceAnnotation;
100    }
 
101  2634 toggle public void setReferenceAnnotation(char referenceAnnotation)
102    {
103  2634 this.referenceAnnotation = referenceAnnotation;
104    }
105   
 
106  533 toggle char getMaskValue()
107    {
108  533 return maskValue;
109    }
 
110  2374 toggle public void setMaskValue(char maskValue)
111    {
112  2374 this.maskValue = maskValue;
113    }
114   
 
115  533 toggle char getConsensusStructure()
116    {
117  533 return consensusStructure;
118    }
 
119  2374 toggle public void setConsensusStructure(char consensusStructure)
120    {
121  2374 this.consensusStructure = consensusStructure;
122    }
123   
124    /**
125    * Answers the symbol index of the symbol with the highest match emission
126    * probability (first symbol in case of a tie). Note this object stores
127    * probabilities, not the negative logarithms as in the HMM file.
128    *
129    * @return
130    */
 
131  4 toggle int getMaxMatchEmissionIndex()
132    {
133  4 int maxIndex = 0;
134  4 double max = 0D;
135   
136  50 for (int i = 0; i < matchEmissions.length; i++)
137    {
138  46 if (matchEmissions[i] > max)
139    {
140  9 max = matchEmissions[i];
141  9 maxIndex = i;
142    }
143    }
144  4 return maxIndex;
145    }
146    }
147   
148