private List<AlignedCodonFrame> codonFrameList;
+ HiddenMarkovModel hmm;
+
private void initAlignment(SequenceI[] seqs)
{
groups = Collections.synchronizedList(new ArrayList<SequenceGroup>());
{
hiddenCols = cols;
}
+
+ @Override
+ public HiddenMarkovModel getHMM()
+ {
+
+ return hmm;
+ }
+
+ @Override
+ public void setHMM(HiddenMarkovModel markov)
+ {
+
+ hmm = markov;
+ }
+
}
public void setHiddenColumns(HiddenColumns cols);
+
+
}
* alignment, parent group).
*/
AnnotatedCollectionI getContext();
+
+ public HiddenMarkovModel getHMM();
+
+ public void setHMM(HiddenMarkovModel hmm);
}
int symbolIndex;
int nodeIndex;
Double probability;
+ if (symbol == '-')
+ {
+ return 0d;
+ }
symbolIndex = symbolIndexLookup.get(symbol);
- nodeIndex = nodeLookup.get(alignColumn);
- probability = getNode(nodeIndex).getMatchEmissions().get(symbolIndex);
- return probability;
+ if (nodeLookup.containsKey(alignColumn + 1))
+ {
+ nodeIndex = nodeLookup.get(alignColumn + 1);
+ probability = getNode(nodeIndex).getMatchEmissions().get(symbolIndex);
+ probability = Math.pow(Math.E, -probability);
+ return probability;
+ }
+ else
+ {
+ return 0d;
+ }
}
int symbolIndex;
int nodeIndex;
Double probability;
+ if (symbol == '-')
+ {
+ return 0d;
+ }
symbolIndex = symbolIndexLookup.get(symbol);
- nodeIndex = nodeLookup.get(alignColumn);
- probability = getNode(nodeIndex).getInsertEmissions().get(symbolIndex);
- return probability;
+ if (nodeLookup.containsKey(alignColumn + 1))
+ {
+ nodeIndex = nodeLookup.get(alignColumn + 1);
+ probability = getNode(nodeIndex).getInsertEmissions()
+ .get(symbolIndex);
+ probability = Math.pow(Math.E, -probability);
+ return probability;
+ }
+ else
+ {
+ return 0d;
+ }
}
int nodeIndex;
Double probability;
transitionIndex = getTransitionType(transition);
- nodeIndex = nodeLookup.get(alignColumn);
- probability = getNode(nodeIndex).getStateTransitions()
+ if (nodeLookup.containsKey(alignColumn + 1))
+ {
+ nodeIndex = nodeLookup.get(alignColumn + 1);
+ probability = getNode(nodeIndex).getStateTransitions()
.get(transitionIndex);
- return probability;
+ probability = Math.pow(Math.E, -probability);
+ return probability;
+ }
+ else
+ {
+ return 0d;
+ }
}
boolean colourText = false;
+ HiddenMarkovModel hmm;
+
/**
* True if the group is defined as a group on the alignment, false if it is
* just a selection.
{
return (startRes <= apos && endRes >= apos) && sequences.contains(seq);
}
+
+ @Override
+ public HiddenMarkovModel getHMM()
+ {
+ // TODO Auto-generated method stub
+ return hmm;
+ }
+
+ @Override
+ public void setHMM(HiddenMarkovModel markov)
+ {
+ hmm = markov;
+
+ }
}
{
HMMFile hmm = new HMMFile(new FileParse(file, sourceType));
hmm.parse();
- System.out.println("successful");
+
+ getViewport().getAlignment().setHMM(hmm.getHMM());
+
+
+
+
+
}
else if (FileFormat.Jnet.equals(format))
{
NucleotideColourScheme.class), PurinePyrimidine(
"Purine/Pyrimidine", PurinePyrimidineColourScheme.class),
RNAHelices("RNA Helices", RNAHelicesColour.class), TCoffee(
- "T-Coffee Scores", TCoffeeColourScheme.class);
+ "T-Coffee Scores", TCoffeeColourScheme.class),
+ HMMER("HMMER", HMMERColourScheme.class);
// RNAInteraction("RNA Interaction type", RNAInteractionColourScheme.class)
private String name;