From 53079f65dd7c537f74906971666b253599b4c0ad Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 13 Mar 2015 09:04:01 +0000 Subject: [PATCH] JAL-1684 allow X in protein to map to untranslatable in DNA (grc in EMBLCDS AAK20930) --- src/jalview/analysis/AlignmentUtils.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index 26b1beb..15b3fe4 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -409,17 +409,24 @@ public class AlignmentUtils { 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); -- 1.7.10.2