private static final String DNA = "DNA";
+ private static final String RNA = "RNA";
+
/*
* Quick look-up of String value of char 'A' to 'Z'
*/
}
}
+
/**
* Calculate the consensus symbol(s) for each column in the given range.
*
}
/**
- * produces a HMM profile for a column in an alignment
+ * Produces a HMM profile for a column in an alignment
*
* @param aa
- * Alignment annotation for which the profile is being calculated
+ * Alignment annotation for which the profile is being calculated.
* @param column
- * column in the alignment the profile is being made for
+ * Column in the alignment the profile is being made for.
* @param removeBelowBackground
- * boolean, indicating whether to ignore residues with probabilities
- * less than their background frequencies
+ * Boolean indicating whether to ignore residues with probabilities
+ * less than their background frequencies.
* @return
*/
- public static int[] getHMMProfileFor(AlignmentAnnotation aa, int column,
+ public static int[] getHMMProfileFor(HiddenMarkovModel hmm, int column,
boolean removeBelowBackground)
{
- HiddenMarkovModel hmm;
- hmm = aa.getHMM();
if (hmm != null)
{
String alph = hmm.getAlphabetType();
value = hmm.getMatchEmissionProbability(column, symbol);
double freq;
- if (alph == AMINO && removeBelowBackground)
+ if (AMINO.equals(alph) && removeBelowBackground)
{
freq = ResidueProperties.aminoBackgroundFrequencies.get(symbol);
if (value < freq)
value = 0d;
}
}
- else if (alph == DNA && removeBelowBackground)
+ else if (DNA.equals(alph) && removeBelowBackground)
+ {
+ freq = ResidueProperties.dnaBackgroundFrequencies.get(symbol);
+ if (value < freq)
+ {
+ value = 0d;
+ }
+ }
+ else if (RNA.equals(alph) && removeBelowBackground)
{
- freq = ResidueProperties.nucleotideBackgroundFrequencies
+ freq = ResidueProperties.rnaBackgroundFrequencies
.get(symbol);
if (value < freq)
{