// only string value - use the getter methods. For example, to find the length
// of theHMM, use getModelLength()to return an int value
Map<String, String> fileProperties = new HashMap<>();
+
+ //contains all of the symbols used in this model. The index of each symbol represents its lookup value
+ List<Character> symbols = new ArrayList<>();
- // contains the average emission probabilities for each symbol
- List<Double> averageMatchStateEmissionProbabilities = new ArrayList<>();
+ // contains information for each node in the model. The begin node is at index
+ // 0. Node 0 contains average emission probabilities for each symbol
+ List<HMMNode> nodes = new ArrayList<>();
- // contains the probabilities of insert 0 emissions for each symbol
- List<Double> insertZeroEmissions = new ArrayList<>();
+ // contains the HMM node for each alignment column
+ Map<Integer, Integer> nodeLookup = new HashMap<>();
+
+ //contains the symbol index for each symbol
+ Map<Character, Integer> symbolIndexLookup = new HashMap<>();
- // contains the probabilities of transitions from the begin state and insert
- // state 0. These are bm, bi, bd, im, ii, dm and dd in order (0th position in
- // the array indicates the probability of a bm transition)
- List<Double> beginStateTransitions = new ArrayList<>();
+ final static String YES = "yes";
- // contains the alignment column index for each node
- List<Integer> alignmentColumnIndexes = new ArrayList<>();
+ final static String NO = "no";
- // contains all other annotations for each node. These can be the
- // consensus(CONS), reference annotation(RF), mask value(MM) or consensus
- // structure(CS)
- List<HashMap<String, Character>> annotations = new ArrayList<>();
+ int numberOfSymbols;
+
+ //keys for file properties hashmap
+ private final String NAME = "NAME";
- // contains the match emission for each symbol at each node
- List<List<Double>> matchEmissions = new ArrayList<>();
+ private final String ACCESSION_NUMBER = "ACC";
- // contains the insert emission for each symbol at each node
- List<List<Double>> insertEmissions = new ArrayList<>();
+ private final String DESCRIPTION = "DESC";
- // contains the state transition for each state transition. See
- // beginStateTransitions field for transition possibilities.
- List<List<Double>> stateTransitions = new ArrayList<>();
+ private final String LENGTH = "LENG";
- // contains cutoffs and thresholds from PFAM
- Map<String, Double[]> pfamData = new HashMap<>();
+ private final String MAX_LENGTH = "MAXL";
- // contains e-value statistic objects which contain the alignment mode
- // configuration, and the slope and location of each distribution
- Map<String, EValueStatistic> eValueStatistics = new HashMap<>();
+ private final String ALPHABET = "ALPH";
- final String yes = "yes";
+ private final String DATE = "DATE";
- final String no = "no";
+ private final String COMMAND_LOG = "COM";
- List<Character> symbols = new ArrayList<>();
+ private final String NUMBER_OF_SEQUENCES = "NSEQ";
- public List<Double> getBeginStateTransitions()
- {
- return beginStateTransitions;
- }
+ private final String EFF_NUMBER_OF_SEQUENCES = "EFFN";
- public void setBeginStateTransitions(List<Double> beginStateTransitionsL)
- {
- this.beginStateTransitions = beginStateTransitionsL;
- }
+ private final String CHECK_SUM = "CKSUM";
- public List<List<Double>> getStateTransitions()
- {
- return stateTransitions;
- }
+ private final String GATHERING_THRESHOLDS = "GA";
- public void setStateTransitions(List<List<Double>> stateTransitionsL)
- {
- this.stateTransitions = stateTransitionsL;
- }
+ private final String TRUSTED_CUTOFFS = "TC";
- public List<Character> getSymbols()
- {
- return symbols;
- }
+ private final String NOISE_CUTOFFS = "NC";
- public void setSymbols(List<Character> symbolsL)
- {
- this.symbols = symbolsL;
- }
+ private final String STATISTICS = "STATS";
- public List<Double> getAverageMatchStateEmissionProbabilities()
- {
- return averageMatchStateEmissionProbabilities;
- }
+ private final String COMPO = "COMPO";
+
+ private final String GATHERING_THRESHOLD = "GA";
+
+ private final String TRUSTED_CUTOFF = "TC";
+
+ private final String NOISE_CUTOFF = "NC";
+
+ private final String VITERBI = "VITERBI";
+
+ private final String MSV = "MSV";
+
+ private final String FORWARD = "FORWARD";
+
+ private final String MAP = "MAP";
- public void setAverageMatchStateEmissionProbabilities(
- List<Double> averageMatchStateEmissionProbabilitiesL)
+ private final String REFERENCE_ANNOTATION = "RF";
+
+ private final String CONSENSUS_RESIDUE = "CONS";
+
+ private final String CONSENSUS_STRUCTURE = "CS";
+
+ private final String MASKED_VALUE = "MM";
+
+ final static String[] TRANSITION_TYPES = new String[] { "m->m", "m->i",
+ "m->d", "i->m", "i->i", "d->m", "d->d" };
+
+ public String getTransitionType(int index)
{
- this.averageMatchStateEmissionProbabilities = averageMatchStateEmissionProbabilitiesL;
+ return TRANSITION_TYPES[index];
}
-
- public List<Double> getInsertZeroEmissions()
+ public Map<Integer, Integer> getNodeLookup()
{
- return insertZeroEmissions;
+ return nodeLookup;
}
- public void setInsertZeroEmissions(List<Double> insertZeroEmissionsL)
+ public void setNodeLookup(Map<Integer, Integer> nodeLookup)
{
- this.insertZeroEmissions = insertZeroEmissionsL;
+ this.nodeLookup = nodeLookup;
}
- public List<List<Double>> getMatchEmissions()
+ public String[] getTransitionTypes()
{
- return matchEmissions;
+ return TRANSITION_TYPES;
}
- public void setMatchEmissions(List<List<Double>> matchEmissionsL)
+ public List<Character> getSymbols()
{
- this.matchEmissions = matchEmissionsL;
+ return symbols;
}
- public List<List<Double>> getInsertEmissions()
+ public Map<String, String> getFileProperties()
{
- return insertEmissions;
+ return fileProperties;
}
- public void setInsertEmissions(List<List<Double>> insertEmissionsL)
+ public HMMNode getNode(int nodeIndex)
{
- this.insertEmissions = insertEmissionsL;
+ return getNodes().get(nodeIndex);
}
- public void fillSymbols(String line)
+
+ public void setSymbols(List<Character> symbolsL)
{
- Scanner scanner = new Scanner(line);
- scanner.next();
- while (scanner.hasNext())
- {
- symbols.add(scanner.next().charAt(0));
- }
- scanner.close();
+ this.symbols = symbolsL;
}
public String getName()
{
- return fileProperties.get("NAME");
+ return fileProperties.get(NAME);
}
public String getAccessionNumber()
{
- return fileProperties.get("ACC");
+ return fileProperties.get(ACCESSION_NUMBER);
}
public void setAccessionNumber(String value)
{
- fileProperties.put("ACC", value);
+ fileProperties.put(ACCESSION_NUMBER, value);
}
public String getDescription()
{
- return fileProperties.get("DESC");
+ return fileProperties.get(DESCRIPTION);
}
public void setDescription(String value)
{
- fileProperties.put("DESC", value);
+ fileProperties.put(DESCRIPTION, value);
}
public Integer getLength()
{
- if (fileProperties.get("LENG") == null)
+ if (fileProperties.get(LENGTH) == null)
{
return null;
}
- return Integer.parseInt(fileProperties.get("LENG"));
+ return Integer.parseInt(fileProperties.get(LENGTH));
}
public void setLength(int value)
{
- fileProperties.put("LENG", String.valueOf(value));
+ fileProperties.put(LENGTH, String.valueOf(value));
}
public Integer getMaxInstanceLength()
{
- if (fileProperties.get("MAXL") == null)
+ if (fileProperties.get(MAX_LENGTH) == null)
{
return null;
}
- return Integer.parseInt(fileProperties.get("MAXL"));
+ return Integer.parseInt(fileProperties.get(MAX_LENGTH));
}
public void setMaxInstanceLength(int value)
{
- fileProperties.put("MAXL", String.valueOf(value));
+ fileProperties.put(MAX_LENGTH, String.valueOf(value));
}
// gets type of symbol alphabet - "amino", "DNA", "RNA"
public String getAlphabetType()
{
- return fileProperties.get("ALPH");
+ return fileProperties.get(ALPHABET);
}
public void setAlphabetType(String value)
{
- fileProperties.put("ALPH", value);
+ fileProperties.put(ALPHABET, value);
}
- // returns boolean indicating whether the reference annotation character field
- // for each match state is valid or ignored
- public boolean getReferenceAnnotationFlag()
+ // not sure whether to implement this with Date object
+ public String getDate()
{
- if (fileProperties.get("RF") != null)
- {
- if (fileProperties.get("RF").equals(yes))
- {
- return true;
- }
- }
- return false;
+ return fileProperties.get(DATE);
}
- public void setReferenceAnnotationFlag(boolean value)
+ public void setDate(String value)
{
- if (value)
- {
- fileProperties.put("RF", yes);
- }
- else
- {
- fileProperties.put("RF", no);
- }
-
+ fileProperties.put(DATE, value);
}
- // returns boolean indicating whether the model mask annotation character
- // field
- // for each match state is valid or ignored
- public boolean getModelMaskedFlag()
+ // not sure whether to implement this
+ public String getCommandLineLog()
{
- if (fileProperties.get("MM") != null)
- {
- if (fileProperties.get("MM").equals(yes))
- {
- return true;
- }
- }
- return false;
+ return fileProperties.get(COMMAND_LOG);
}
- public void setModelMaskedFlag(boolean value)
+ public void setCommandLineLog(String value)
{
- if (value)
- {
- fileProperties.put("MM", yes);
- }
- else
- {
- fileProperties.put("MM", no);
- }
+ fileProperties.put(COMMAND_LOG, value);
}
- // returns boolean indicating whether the consensus residue field
- // for each match state is valid or ignored
- public boolean getConsensusResidueAnnotationFlag()
+ // gets the number of sequences that the HMM was trained on
+ public Integer getNumberOfSequences()
{
- if (fileProperties.get("CONS") != null)
+ if (fileProperties.get(NUMBER_OF_SEQUENCES) == null)
{
- if (fileProperties.get("CONS").equals(yes))
- {
- return true;
- }
+ return null;
}
- return false;
+ return Integer.parseInt(fileProperties.get(NUMBER_OF_SEQUENCES));
}
- public void setConsensusResidueeAnnotationFlag(boolean value)
+ public void setNumberOfSequences(int value)
{
- if (value)
- {
- fileProperties.put("CONS", yes);
- }
- else
- {
- fileProperties.put("CONS", no);
- }
+ fileProperties.put(NUMBER_OF_SEQUENCES, String.valueOf(value));
}
- // returns boolean indicating whether the consensus structure character field
- // for each match state is valid or ignored
- public boolean getConsensusStructureAnnotationFlag()
+ // gets the effective number determined during sequence weighting
+ public Double getEffectiveNumberOfSequences()
{
- if (fileProperties.get("CS") != null)
+ if (fileProperties.get(LENGTH) == null)
{
- if (fileProperties.get("CS").equals(yes))
- {
- return true;
- }
+ return null;
}
- return false;
+ return Double.parseDouble(fileProperties.get(EFF_NUMBER_OF_SEQUENCES));
}
- public void setConsensusStructureAnnotationFlag(boolean value)
+ public void setEffectiveNumberOfSequences(double value)
{
- if (value)
- {
- fileProperties.put("CS", yes);
- }
- else
- {
- fileProperties.put("CS", no);
- }
+ fileProperties.put(EFF_NUMBER_OF_SEQUENCES, String.valueOf(value));
}
- // returns boolean indicating whether the model mask annotation character
- // field
- // for each match state is valid or ignored
- public boolean getMapAnnotationFlag()
+ public Long getCheckSum()
{
- if (fileProperties.get("MAP") != null)
+ if (fileProperties.get(LENGTH) == null)
{
- if (fileProperties.get("MAP").equals(yes))
- {
- return true;
- }
+ return null;
}
- return false;
+ return Long.parseLong(fileProperties.get(CHECK_SUM));
}
- public void setMapAnnotationFlag(boolean value)
+ public void setCheckSum(long value)
{
- if (value)
- {
- fileProperties.put("MAP", yes);
- }
- else
- {
- fileProperties.put("MAP", no);
- }
+ fileProperties.put(CHECK_SUM, String.valueOf(value));
}
- // not sure whether to implement this with Date object
- public String getDate()
+ public List<HMMNode> getNodes()
{
- return fileProperties.get("DATE");
+ return nodes;
}
- public void setDate(String value)
+ public void setNodes(List<HMMNode> nodes)
{
- fileProperties.put("DATE", value);
+ this.nodes = nodes;
}
+
+ /**
+ * get match emission probability for a given symbol at a column in the
+ * alignment
+ *
+ * @param alignColumn
+ * @param symbol
+ * @return
+ *
+ */
+ public Double getMatchEmissionProbability(int alignColumn, char symbol)
+ {
+ int symbolIndex;
+ int nodeIndex;
+ Double probability;
+ symbolIndex = symbolIndexLookup.get(symbol);
+ nodeIndex = nodeLookup.get(alignColumn);
+ probability = getNode(nodeIndex).getMatchEmissions().get(symbolIndex);
+ return probability;
- // not sure whether to implement this
- public String getCommandLineLog()
- {
- return fileProperties.get("COM");
}
- public void setCommandLineLog(String value)
+ /**
+ * get insert emission probability for a given symbol at a column in the
+ * alignment
+ *
+ * @param alignColumn
+ * @param symbol
+ * @return
+ */
+ public Double getInsertEmissionProbability(int alignColumn, char symbol)
+ {
+ int symbolIndex;
+ int nodeIndex;
+ Double probability;
+ symbolIndex = symbolIndexLookup.get(symbol);
+ nodeIndex = nodeLookup.get(alignColumn);
+ probability = getNode(nodeIndex).getInsertEmissions().get(symbolIndex);
+ return probability;
+
+ }
+
+ /**
+ * get state transition probability for a given transition type at a column in
+ * the alignment
+ *
+ * @param alignColumn
+ * @param transition
+ * @return
+ */
+ public Double getStateTransitionProbability(int alignColumn,
+ String transition)
{
- fileProperties.put("COM", value);
- }
+ int transitionIndex;
+ int nodeIndex;
+ Double probability;
+ transitionIndex = getTransitionType(transition);
+ nodeIndex = nodeLookup.get(alignColumn);
+ probability = getNode(nodeIndex).getStateTransitions()
+ .get(transitionIndex);
+ return probability;
- // gets the number of sequences that the HMM was trained on
- public Integer getSequenceNumber()
+ }
+
+ public Integer getNodeAlignmentColumn(int nodeIndex)
{
- if (fileProperties.get("NSEQ") == null)
- {
- return null;
- }
- return Integer.parseInt(fileProperties.get("NSEQ"));
+ Integer value = nodes.get(nodeIndex).getAlignmentColumn();
+ return value;
}
-
- public void setSequenceNumber(int value)
+
+ public char getConsensusResidue(int nodeIndex)
{
- fileProperties.put("NSEQ", String.valueOf(value));
+ char value = nodes.get(nodeIndex).getConsensusResidue();
+ return value;
}
-
- // gets the effective number determined during sequence weighting
- public Double getEffectiveSequenceNumber()
+
+ public char getReferenceAnnotation(int nodeIndex)
{
- if (fileProperties.get("LENG") == null)
- {
- return null;
- }
- return Double.parseDouble(fileProperties.get("EFFN"));
+ char value = nodes.get(nodeIndex).getReferenceAnnotation();
+ return value;
}
-
- public void setEffectiveSequenceNumber(double value)
+
+ public char getMaskedValue(int nodeIndex)
{
- fileProperties.put("EFFN", String.valueOf(value));
+ char value = nodes.get(nodeIndex).getMaskValue();
+ return value;
}
-
- public Long getCheckSum()
+
+ public char getConsensusStructure(int nodeIndex)
{
- if (fileProperties.get("LENG") == null)
- {
- return null;
- }
- return Long.parseLong(fileProperties.get("CKSUM"));
+ char value = nodes.get(nodeIndex).getConsensusStructure();
+ return value;
+ }
+
+ /**
+ * returns the average match emission for a given symbol
+ * @param symbolIndex
+ * index of symbol
+ * @return
+ * average negative log propbability of a match emission of the given symbol
+ */
+ public double getAverageMatchEmission(int symbolIndex)
+ {
+ double value = nodes.get(0).getMatchEmissions().get(symbolIndex);
+ return value;
}
- public void setCheckSum(long value)
+ public int getNumberOfSymbols()
{
- fileProperties.put("CKSUM", String.valueOf(value));
+ return numberOfSymbols;
}
- public Double getGatheringThreshold1()
+ public void setNumberOfSymbols(int numberOfSymbols)
{
- try
- {
- return pfamData.get("GA")[0];
- } catch (NullPointerException e)
- {
- return null;
+ this.numberOfSymbols = numberOfSymbols;
+ }
+
+
+
+ /**
+ * fills symbol array and also finds numberOfSymbols
+ *
+ * @param parser
+ * scanner scanning symbol line in file
+ */
+ public void fillSymbols(Scanner parser)
+ {
+ int i = 0;
+ while (parser.hasNext())
+ {
+ String strSymbol = parser.next();
+ char[] symbol = strSymbol.toCharArray();
+ symbols.add(symbol[0]);
+ symbolIndexLookup.put(symbol[0], i);
+ i++;
}
+ numberOfSymbols = symbols.size();
}
- public void setPFAMData(String key, Double[] data)
+ /**
+ * adds file property
+ *
+ * @param key
+ * @param value
+ */
+ public void addFileProperty(String key, String value)
{
- pfamData.put(key, data);
+ fileProperties.put(key, value);
}
- public Double getGatheringThreshold2()
+ public boolean referenceAnnotationIsActive()
{
- try
- {
- return pfamData.get("GA")[1];
- } catch (NullPointerException e)
+ String status;
+ status = fileProperties.get(REFERENCE_ANNOTATION);
+ if (status == null)
{
- return null;
+ return false;
+ }
+ switch (status)
+ {
+ case YES:
+ return true;
+ case NO:
+ return false;
+ default:
+ return false;
}
}
- public Double getTrustedCutoff1()
+ public boolean maskValueIsActive()
{
- try
+ String status;
+ status = fileProperties.get(MASKED_VALUE);
+ if (status == null)
{
- return pfamData.get("TC")[0];
- } catch (NullPointerException e)
- {
- return null;
+ return false;
+ }
+ switch (status)
+ {
+ case YES:
+ return true;
+ case NO:
+ return false;
+ default:
+ return false;
}
}
- public Double getTrustedCutoff2()
+ public boolean consensusResidueIsActive()
{
- try
- {
- return pfamData.get("TC")[1];
- } catch (NullPointerException e)
+ String status;
+ status = fileProperties.get(CONSENSUS_RESIDUE);
+ if (status == null)
{
- return null;
+ return false;
+ }
+ switch (status)
+ {
+ case YES:
+ return true;
+ case NO:
+ return false;
+ default:
+ return false;
}
}
- public Double getNoiseCutoff1()
+ public boolean consensusStructureIsActive()
{
- try
- {
- return pfamData.get("NC")[0];
- } catch (NullPointerException e)
+ String status;
+ status = fileProperties.get(CONSENSUS_STRUCTURE);
+ if (status == null)
{
- return null;
+ return false;
+ }
+ switch (status)
+ {
+ case YES:
+ return true;
+ case NO:
+ return false;
+ default:
+ return false;
}
}
- public Double getNoiseCutoff2()
+ public boolean mapIsActive()
{
- try
- {
- return pfamData.get("NC")[1];
- } catch (NullPointerException e)
+ String status;
+ status = fileProperties.get(MAP);
+ if (status == null)
{
- return null;
+ return false;
+ }
+ switch (status)
+ {
+ case YES:
+ return true;
+ case NO:
+ return false;
+ default:
+ return false;
}
}
- public String getAlignmentModeConfiguration(String key)
+ public void setAlignmentColumn(int nodeIndex, int column)
{
- return eValueStatistics.get(key).alignmentModeConfiguration;
+ nodes.get(nodeIndex).setAlignmentColumn(column);
}
- public Double getSlopeOfDistribution(String scoreDistribution)
+ public void setReferenceAnnotation(int nodeIndex, char value)
{
- try
- {
- return eValueStatistics.get(scoreDistribution).slopeOfDistribution;
- } catch (NullPointerException e)
- {
- return null;
- }
+ nodes.get(nodeIndex).setReferenceAnnotation(value);
}
- public Double getLocationOfDistribution(String scoreDistribution)
+ public void setConsensusResidue(int nodeIndex, char value)
{
- try
- {
- return eValueStatistics.get(scoreDistribution).locationOfDistribution;
- } catch (NullPointerException e)
- {
- return null;
- }
+ nodes.get(nodeIndex).setConsensusResidue(value);
}
- public void addStatistic(String name, EValueStatistic stats)
+ public void setConsensusStructure(int nodeIndex, char value)
{
- eValueStatistics.put(name, stats);
+ nodes.get(nodeIndex).setConsensusStructure(value);
}
- /**
- * public double getBeginStateTransitions(Character symbol) { return
- * beginStateTransitions.get(symbol); }
- **/
+ public void setMaskValue(int nodeIndex, char value)
+ {
+ nodes.get(nodeIndex).setMaskValue(value);
+ }
- public void put(String key, String value)
+ public String getGatheringThreshold()
{
- fileProperties.put(key, value);
+ String value;
+ value = fileProperties.get("GA");
+ return value;
}
- public Map<String, EValueStatistic> getEValueStatistics()
+ public String getNoiseCutoff()
{
- return eValueStatistics;
+ String value;
+ value = fileProperties.get("NC");
+ return value;
}
- public void setEValueStatistics(
- Map<String, EValueStatistic> eValueStatisticsM)
+ public String getTrustedCutoff()
{
- this.eValueStatistics = eValueStatisticsM;
+ String value;
+ value = fileProperties.get("TC");
+ return value;
}
- public List<Integer> getAlignmentColumnIndexes()
+ public String getViterbi()
{
- return alignmentColumnIndexes;
+ String value;
+ value = fileProperties.get(VITERBI);
+ return value;
}
- public void setAlignmentColumnIndexes(
- List<Integer> alignmentColumnIndexesL)
+ public String getMSV()
{
- this.alignmentColumnIndexes = alignmentColumnIndexesL;
+ String value;
+ value = fileProperties.get(MSV);
+ return value;
}
- public List<HashMap<String, Character>> getAnnotations()
+ public String getForward()
{
- return annotations;
+ String value;
+ value = fileProperties.get(FORWARD);
+ return value;
}
- public void setAnnotations(List<HashMap<String, Character>> annotationsL)
+ public void setMAPStatus(boolean status)
{
- this.annotations = annotationsL;
+ if (status == true)
+ {
+ fileProperties.put(MAP, YES);
+ }
+ else
+ {
+ fileProperties.put(MAP, NO);
+ }
}
- public Map<String, String> getFileProperties()
+ public void setReferenceAnnotationStatus(boolean status)
{
- return fileProperties;
+ if (status == true)
+ {
+ fileProperties.put(REFERENCE_ANNOTATION, YES);
+ }
+ else
+ {
+ fileProperties.put(REFERENCE_ANNOTATION, NO);
+ }
+ }
+
+ public void setMaskedValueStatus(boolean status)
+ {
+ if (status == true)
+ {
+ fileProperties.put(MASKED_VALUE, YES);
+ }
+ else
+ {
+ fileProperties.put(MASKED_VALUE, NO);
+ }
}
- public void setFileProperties(Map<String, String> fileProperties)
+ public void setConsensusResidueStatus(boolean status)
{
- this.fileProperties = fileProperties;
+ if (status == true)
+ {
+ fileProperties.put(CONSENSUS_RESIDUE, YES);
+ }
+ else
+ {
+ fileProperties.put(CONSENSUS_RESIDUE, NO);
+ }
+ }
+
+ public void setConsensusStructureStatus(boolean status)
+ {
+ if (status == true)
+ {
+ fileProperties.put(CONSENSUS_STRUCTURE, YES);
+ }
+ else
+ {
+ fileProperties.put(CONSENSUS_STRUCTURE, NO);
+ }
+ }
+
+ /**
+ *
+ * @param transition
+ * type of transition occuring
+ * @return index value representing position along stateTransition array.
+ */
+ public Integer getTransitionType(String transition)
+ {
+ Integer index;
+ switch (transition)
+ {
+ case "mm":
+ index = 0;
+ break;
+ case "mi":
+ index = 1;
+ break;
+ case "md":
+ index = 2;
+ break;
+ case "im":
+ index = 3;
+ break;
+ case "ii":
+ index = 4;
+ break;
+ case "dm":
+ index = 5;
+ break;
+ case "dd":
+ index = 6;
+ break;
+ default:
+ index = null;
+ }
+ return index;
+ }
+
+ /**
+ * find the index of the node in a hidden Markov model based on the column in
+ * the alignment
+ *
+ * @param alignmentColumn
+ */
+
+ public Integer findNodeIndex(int alignmentColumn)
+ {
+ Integer index;
+ index = nodeLookup.get(alignmentColumn);
+ return index;
+ }
+
+ public static String findStringFromBoolean(boolean value)
+ {
+ if (value)
+ {
+ return YES;
+ }
+ else
+ {
+ return NO;
+ }
}
}