public static final String DNA = "dna";
+ private static final String NEWLINE = System.lineSeparator();
+
static String[] dna =
{ "A", "C", "G", "T", "-" };
*/
private void SeqInit(String string1, String string2)
{
- s1str = extractGaps(jalview.util.Comparison.GapChars, string1);
- s2str = extractGaps(jalview.util.Comparison.GapChars, string2);
+ s1str = extractGaps(Comparison.GapChars, string1);
+ s2str = extractGaps(Comparison.GapChars, string2);
if (s1str.length() == 0 || s2str.length() == 0)
{
int nochunks = ((aseq1.length - count) / len) + 1;
pid = 0;
- output.append("Score = " + score[maxi][maxj] + "\n");
- output.append("Length of alignment = " + (aseq1.length - count) + "\n");
+ output.append("Score = ").append(score[maxi][maxj]).append(NEWLINE);
+ output.append("Length of alignment = ")
+ .append(String.valueOf(aseq1.length - count)).append(NEWLINE);
output.append("Sequence ");
output.append(new Format("%" + maxid + "s").form(s1.getName()));
- output.append(" : " + s1.getStart() + " - " + s1.getEnd()
- + " (Sequence length = " + s1str.length() + ")\n");
+ output.append(" : ").append(String.valueOf(s1.getStart()))
+ .append(" - ").append(String.valueOf(s1.getEnd()));
+ output.append(" (Sequence length = ")
+ .append(String.valueOf(s1str.length())).append(")")
+ .append(NEWLINE);
output.append("Sequence ");
output.append(new Format("%" + maxid + "s").form(s2.getName()));
- output.append(" : " + s2.getStart() + " - " + s2.getEnd()
- + " (Sequence length = " + s2str.length() + ")\n\n");
+ output.append(" : ").append(String.valueOf(s2.getStart()))
+ .append(" - ").append(String.valueOf(s2.getEnd()));
+ output.append(" (Sequence length = ")
+ .append(String.valueOf(s2str.length())).append(")")
+ .append(NEWLINE).append(NEWLINE);
for (int j = 0; j < nochunks; j++)
{
// Print the first aligned sequence
- output.append(new Format("%" + (maxid) + "s").form(s1id) + " ");
+ output.append(new Format("%" + (maxid) + "s").form(s1id)).append(" ");
for (int i = 0; i < len; i++)
{
}
}
- output.append("\n");
- output.append(new Format("%" + (maxid) + "s").form(" ") + " ");
+ output.append(NEWLINE);
+ output.append(new Format("%" + (maxid) + "s").form(" ")).append(" ");
// Print out the matching chars
for (int i = 0; i < len; i++)
if ((i + (j * len)) < astr1.length())
{
if (astr1.charAt(i + (j * len)) == astr2.charAt(i + (j * len))
- && !jalview.util.Comparison.isGap(astr1.charAt(i
+ && !Comparison.isGap(astr1.charAt(i
+ (j * len))))
{
pid++;
}
// Now print the second aligned sequence
- output = output.append("\n");
- output = output.append(new Format("%" + (maxid) + "s").form(s2id)
- + " ");
+ output = output.append(NEWLINE);
+ output = output.append(new Format("%" + (maxid) + "s").form(s2id))
+ .append(" ");
for (int i = 0; i < len; i++)
{
}
}
- output = output.append("\n\n");
+ output.append(NEWLINE).append(NEWLINE);
}
pid = pid / (aseq1.length - count) * 100;
output = output.append(new Format("Percentage ID = %2.2f\n\n")
- .form(pid));
+ .formDouble(pid));
try
{
Format.print(System.out, "%3s", s1str.substring(i, i + 1));
}
- Format.print(System.out, "%3d ", mat[i][j] / 10);
+ Format.printLong(System.out, "%3d ", mat[i][j] / 10);
}
System.out.println();
*
* @return mapping from positions in S1 to corresponding positions in S2
*/
- public jalview.datamodel.Mapping getMappingFromS1(boolean allowmismatch)
+ public Mapping getMappingFromS1(boolean allowmismatch)
{
ArrayList<Integer> as1 = new ArrayList<Integer>(), as2 = new ArrayList<Integer>();
int pdbpos = s2.getStart() + getSeq2Start() - 2;
}
MapList map = new MapList(mapseq1, mapseq2, 1, 1);
- jalview.datamodel.Mapping mapping = new Mapping(map);
+ Mapping mapping = new Mapping(map);
mapping.setTo(s2);
return mapping;
}