1 package jalview.datamodel;
3 import java.util.HashMap;
7 * Data structure to hold a HMM file
13 public class HiddenMarkovModel
16 // Stores file properties
17 private Map<String, String> fileProperties = new HashMap<>();
19 public String getAccessionNumber()
21 return fileProperties.get("ACC");
24 public String getDescription()
26 return fileProperties.get("DESC");
29 public int getModelLength()
31 return Integer.parseInt(fileProperties.get("LENG"));
34 public int getMaxInstanceLength()
36 return Integer.parseInt(fileProperties.get("MAXL"));
39 // gets type of symbol alphabet - "amino", "DNA", "RNA"
40 public String getAlphabetType()
42 return fileProperties.get("ALPH");
45 // returns boolean indicating whether the reference annotation character field
46 // for each match state is valid or ignored
47 public boolean getReferenceAnnotationFlag()
49 if (fileProperties.get("RF") == "yes")
56 // returns boolean indicating whether the model mask annotation character
58 // for each match state is valid or ignored
59 public boolean getModelMaskedFlag()
61 if (fileProperties.get("MM") == "yes")
68 // returns boolean indicating whether the consensus residue field
69 // for each match state is valid or ignored
70 public boolean getConsensusResidueAnnotationFlag()
72 if (fileProperties.get("CONS") == "yes")
79 // returns boolean indicating whether the consensus structure character field
80 // for each match state is valid or ignored
81 public boolean getConsensusStructureAnnotationFlag()
83 if (fileProperties.get("CS") == "yes")
90 // returns boolean indicating whether the model mask annotation character
92 // for each match state is valid or ignored
93 public boolean getMapAnnotationFlag()
95 if (fileProperties.get("MAP") == "yes")
102 // not sure whether to implement this
103 // public Date getDate()
108 // not sure whether to implement this
109 // public String getCommandLineLog()
114 // gets the number of sequences that the HMM was trained on
115 public int getSequenceNumber()
117 return Integer.parseInt(fileProperties.get("NSEQ"));
120 // gets the effective number determined during sequence weighting
121 public int getEffectiveSequenceNumber()
123 return Integer.parseInt(fileProperties.get("EFFN"));
126 public int getCheckSum()
128 return Integer.parseInt(fileProperties.get("CKSUM"));
131 // need to ask if BigDecimal is best decimal type for this purpose
132 // and how to limit number of decimals
133 public double getGatheringThresholdGA1()
135 return Double.parseDouble((fileProperties.get("GA1")));
138 public void put(String key, String value)
140 fileProperties.put(key, value);