--- /dev/null
+package jalview.datamodel;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Data structure to hold a HMM file
+ */
+/**
+ * @author TZVanaalten
+ *
+ */
+public class HiddenMarkovModel
+{
+
+ // Stores file properties
+ private Map<String, String> fileProperties = new HashMap<>();
+
+ public String getAccessionNumber()
+ {
+ return fileProperties.get("ACC");
+ }
+
+ public String getDescription()
+ {
+ return fileProperties.get("DESC");
+ }
+
+ public int getModelLength()
+ {
+ return Integer.parseInt(fileProperties.get("LENG"));
+ }
+
+ public int getMaxInstanceLength()
+ {
+ return Integer.parseInt(fileProperties.get("MAXL"));
+ }
+
+ // gets type of symbol alphabet - "amino", "DNA", "RNA"
+ public String getAlphabetType()
+ {
+ return fileProperties.get("ALPH");
+ }
+
+ // returns boolean indicating whether the reference annotation character field
+ // for each match state is valid or ignored
+ public boolean getReferenceAnnotationFlag()
+ {
+ if (fileProperties.get("RF") == "yes")
+ {
+ return true;
+ }
+ return false;
+ }
+
+ // returns boolean indicating whether the model mask annotation character
+ // field
+ // for each match state is valid or ignored
+ public boolean getModelMaskedFlag()
+ {
+ if (fileProperties.get("MM") == "yes")
+ {
+ return true;
+ }
+ return false;
+ }
+
+ // returns boolean indicating whether the consensus residue field
+ // for each match state is valid or ignored
+ public boolean getConsensusResidueAnnotationFlag()
+ {
+ if (fileProperties.get("CONS") == "yes")
+ {
+ return true;
+ }
+ return false;
+ }
+
+ // returns boolean indicating whether the consensus structure character field
+ // for each match state is valid or ignored
+ public boolean getConsensusStructureAnnotationFlag()
+ {
+ if (fileProperties.get("CS") == "yes")
+ {
+ return true;
+ }
+ return false;
+ }
+
+ // returns boolean indicating whether the model mask annotation character
+ // field
+ // for each match state is valid or ignored
+ public boolean getMapAnnotationFlag()
+ {
+ if (fileProperties.get("MAP") == "yes")
+ {
+ return true;
+ }
+ return false;
+ }
+
+ // not sure whether to implement this
+ // public Date getDate()
+ // {
+
+ // }
+
+ // not sure whether to implement this
+ // public String getCommandLineLog()
+ // {
+
+ // }
+
+ // gets the number of sequences that the HMM was trained on
+ public int getSequenceNumber()
+ {
+ return Integer.parseInt(fileProperties.get("NSEQ"));
+ }
+
+ // gets the effective number determined during sequence weighting
+ public int getEffectiveSequenceNumber()
+ {
+ return Integer.parseInt(fileProperties.get("EFFN"));
+ }
+
+ public int getCheckSum()
+ {
+ return Integer.parseInt(fileProperties.get("CKSUM"));
+ }
+
+ // need to ask if BigDecimal is best decimal type for this purpose
+ // and how to limit number of decimals
+ public double getGatheringThresholdGA1()
+ {
+ return Double.parseDouble((fileProperties.get("GA1")));
+ }
+
+ public void put(String key, String value)
+ {
+ fileProperties.put(key, value);
+ }
+
+}