{
public static final String PEP = "pep";
public static final String DNA = "dna";
- /** DOCUMENT ME!! */
- public static java.util.Hashtable dnaHash = new java.util.Hashtable();
-
- static
- {
- dnaHash.put("C", new Integer(0));
- dnaHash.put("T", new Integer(1));
- dnaHash.put("A", new Integer(2));
- dnaHash.put("G", new Integer(3));
- dnaHash.put("-", new Integer(4));
- }
-
+
static String[] dna =
{
- "C", "T", "A", "G", "-"};
+ "A", "C", "G", "T", "-"};
+ //"C", "T", "A", "G", "-"};
static String[] pep =
{
"A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F",
if ( (aseq1[count] != defInt) && (i >= 0))
{
aseq1[count] = seq1[i];
- astr1 = intToStr[seq1[i]] + astr1;
+ astr1 = s1str.charAt(i) + astr1;
}
if ( (aseq2[count] != defInt) && (j > 0))
{
aseq2[count] = seq2[j];
- astr2 = intToStr[seq2[j]] + astr2;
+ astr2 = s2str.charAt(j) + astr2;
}
trace = findTrace(i, j);
if (aseq1[count] != defInt)
{
aseq1[count] = seq1[i];
- astr1 = intToStr[seq1[i]] + astr1;
+ astr1 = s1str.charAt(i) + astr1;
}
if (aseq2[count] != defInt)
{
aseq2[count] = seq2[j];
- astr2 = intToStr[seq2[j]] + astr2;
+ astr2 = s2str.charAt(j) + astr2;
}
}
*/
public void printAlignment(java.io.PrintStream os)
{
+ // TODO: Use original sequence characters rather than re-translated characters in output
// Find the biggest id length for formatting purposes
int maxid = s1.getName().length();
-
if (s2.getName().length() > maxid)
{
maxid = s2.getName().length();
output.append(" : " + s2.getStart() + " - " + s2.getEnd() +
" (Sequence length = " +
s2str.length() + ")\n\n");
-
+
for (int j = 0; j < nochunks; j++)
{
// Print the first aligned sequence
for (int i = 0; i < len; i++)
{
- if ( (count + i + (j * len)) < aseq1.length)
+ if ( (i + (j * len)) < astr1.length())
{
- output.append(new Format("%s").form(intToStr[aseq1[count + i +
- (j * len)]]));
+ output.append(astr1.charAt(i +
+ (j * len)));
}
}
// Print out the matching chars
for (int i = 0; i < len; i++)
{
- if ( (count + i + (j * len)) < aseq1.length)
+ if ( (i + (j * len)) < astr1.length())
{
- if (intToStr[aseq1[count + i + (j * len)]].equals(
- intToStr[aseq2[count + i + (j * len)]]) &&
- !intToStr[aseq1[count + i + (j * len)]].equals("-"))
+ if (astr1.charAt(i + (j * len))==astr2.charAt(i + (j * len)) &&
+ !jalview.util.Comparison.isGap(astr1.charAt(i + (j * len))))
{
pid++;
output.append("|");
else if (type.equals("pep"))
{
if (ResidueProperties.getPAM250(
- intToStr[aseq1[count + i + (j * len)]],
- intToStr[aseq2[count + i + (j * len)]]) > 0)
+ astr1.charAt(i + (j * len)),
+ astr2.charAt(i + (j * len)))>0)
{
output.append(".");
}
for (int i = 0; i < len; i++)
{
- if ( (count + i + (j * len)) < aseq1.length)
+ if ( (i + (j * len)) < astr2.length())
{
- output.append(new Format("%s").form(intToStr[aseq2[count + i +
- (j * len)]]));
+ output.append(astr2.charAt(i + (j * len)));
}
}
if (type.equals("pep"))
{
seq1[i] = ResidueProperties.aaIndex[c];
+ if (seq1[i] > 23)
+ {
+ seq1[i] = 23;
+ }
}
else if (type.equals("dna"))
{
seq1[i] = ResidueProperties.nucleotideIndex[c];
+ if (seq1[i] > 4)
+ {
+ seq1[i] = 4;
+ }
}
- if (seq1[i] > 23)
- {
- seq1[i] = 23;
- }
}
catch (Exception e)
{