{
int aaResidue = 0;
for (int i = cdnaStart; i < cdnaSeqChars.length - 2
- && aaResidue < aaSeqChars.length; i += 3)
+ && aaResidue < aaSeqChars.length; i += 3, aaResidue++)
{
String codon = String.valueOf(cdnaSeqChars, i, 3);
final String translated = ResidueProperties.codonTranslate(
codon);
+ /*
+ * ? allow X in protein to match untranslatable in dna ?
+ */
+ final char aaRes = aaSeqChars[aaResidue];
+ if (translated == null && aaRes == 'X')
+ {
+ continue;
+ }
if (translated == null
- || !(aaSeqChars[aaResidue] == translated.charAt(0)))
+ || !(aaRes == translated.charAt(0)))
{
return false;
}
- aaResidue++;
}
// fail if we didn't match all of the aa sequence
return (aaResidue == aaSeqChars.length);