*/
package jalview.analysis;
+import jalview.analysis.scoremodels.PairwiseSeqScoreModel;
import jalview.analysis.scoremodels.ScoreMatrix;
import jalview.analysis.scoremodels.ScoreModels;
import jalview.datamodel.AlignmentAnnotation;
int gapExtend = 20;
- float[][] lookup = ResidueProperties.getBLOSUM62();
+ float[][] lookup = ((ScoreMatrix) ScoreModels.getInstance().forName(
+ ScoreModels.BLOSUM62)).getMatrix();
+
+ // ResidueProperties.getBLOSUM62();
String[] intToStr = pep;
.append(String.valueOf(s2str.length())).append(")")
.append(NEWLINE).append(NEWLINE);
+ PairwiseSeqScoreModel pam250 = (PairwiseSeqScoreModel) ScoreModels
+ .getInstance().forName(ScoreModels.PAM250);
+
for (int j = 0; j < nochunks; j++)
{
// Print the first aligned sequence
output.append(NEWLINE);
output.append(new Format("%" + (maxid) + "s").form(" ")).append(" ");
- // Print out the matching chars
+ /*
+ * Print out the match symbols:
+ * | for exact match (ignoring case)
+ * . if PAM250 score is positive
+ * else a space
+ */
for (int i = 0; i < len; i++)
{
if ((i + (j * len)) < astr1.length())
{
- boolean sameChar = Comparison.isSameResidue(
- astr1.charAt(i + (j * len)), astr2.charAt(i + (j * len)),
- false);
- if (sameChar
- && !jalview.util.Comparison.isGap(astr1.charAt(i
- + (j * len))))
+ char c1 = astr1.charAt(i + (j * len));
+ char c2 = astr2.charAt(i + (j * len));
+ boolean sameChar = Comparison.isSameResidue(c1, c2, false);
+ if (sameChar && !Comparison.isGap(c1))
{
pid++;
output.append("|");
}
else if (type.equals("pep"))
{
- if (ResidueProperties.getPAM250(astr1.charAt(i + (j * len)),
- astr2.charAt(i + (j * len))) > 0)
+ if (pam250.getPairwiseScore(c1, c2) > 0)
{
output.append(".");
}