*/
package MCview;
+import jalview.schemes.ResidueProperties;
+
import java.awt.Color;
public class Atom
name = str.substring(12, 15).trim();
resName = str.substring(17, 20);
+ // JAL-1828 treat MSE Selenomethionine as MET (etc)
+ resName = ResidueProperties.getCanonicalAminoAcid(resName);
chain = str.substring(21, 22);
lastrnum = group.getResno();
}
seq[len] = group.getGroup1();
+
+ /*
+ * JAL-1828 replace a modified amino acid with its standard
+ * equivalent (e.g. MSE with MET->M) to maximise sequence matching
+ */
+ String threeLetterCode = group.getGroup3();
+ String canonical = ResidueProperties.getCanonicalAminoAcid(threeLetterCode);
+ if (canonical != null
+ && !canonical.equalsIgnoreCase(threeLetterCode))
+ {
+ seq[len] = ResidueProperties
+ .getSingleCharacterCode(canonical);
+ }
switch (group.getProteinStructureSubType())
{
case HELIX310:
*/
package jalview.schemes;
+import jalview.analysis.scoremodels.FeatureScoreModel;
+import jalview.analysis.scoremodels.PIDScoreModel;
+import jalview.api.analysis.ScoreModelI;
+
import java.awt.Color;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Map;
import java.util.Vector;
-import jalview.analysis.scoremodels.FeatureScoreModel;
-import jalview.analysis.scoremodels.PIDScoreModel;
-import jalview.api.analysis.ScoreModelI;
-
public class ResidueProperties
{
public static Hashtable<String, ScoreModelI> scoreMatrices = new Hashtable();
public static final Map<String, String> nucleotideName = new HashMap<String, String>();
+ // lookup from modified amino acid (e.g. MSE) to canonical form (e.g. MET)
+ public static final Map<String, String> modifications = new HashMap<String, String>();
+
static
{
aaIndex = new int[255];
}
}
+ static
+ {
+ modifications.put("MSE", "MET"); // Selenomethionine
+ // the rest tbc; from
+ // http://sourceforge.net/p/jmol/mailman/message/12833570/
+ // modifications.put("CSE", "CYS"); // Selenocysteine
+ // modifications.put("PTR", "TYR"); // Phosphotyrosine
+ // modifications.put("SEP", "SER"); // Phosphoserine
+ // modifications.put("HYP", "PRO"); // 4-hydroxyproline
+ // modifications.put("5HP", "GLU"); // Pyroglutamic acid; 5-hydroxyproline
+ // modifications.put("PCA", "GLU"); // Pyroglutamic acid
+ // modifications.put("LYZ", "LYS"); // 5-hydroxylysine
+ }
+
+ public static String getCanonicalAminoAcid(String aa)
+ {
+ String canonical = modifications.get(aa);
+ return canonical == null ? aa : canonical;
+ }
+
/**
* translate to RNA secondary structure representation
*
return result;
}
+ /**
+ * Returns the single letter code for a three letter code, or '0' if not known
+ *
+ * @param threeLetterCode
+ * not case sensitive
+ * @return
+ */
+ public static char getSingleCharacterCode(String threeLetterCode)
+ {
+ if (threeLetterCode == null)
+ {
+ return '0';
+ }
+ Integer index = ResidueProperties.aa3Hash.get(threeLetterCode
+ .toUpperCase());
+ return index == null ? '0' : aa[index].charAt(0);
+ }
}
"[ALA, ARG, ASN, ASP, ASX, CYS, GLN, GLU, GLX, GLY, HIS, ILE, LEU, LYS, MET, PHE, PRO, SER, THR, TRP, TYR, VAL, XAA]",
residues.toString());
}
+
+ @Test(groups = { "Functional" })
+ public void testGetCanonicalAminoAcid()
+ {
+ assertEquals("MET", ResidueProperties.getCanonicalAminoAcid("MET"));
+ assertEquals("MET", ResidueProperties.getCanonicalAminoAcid("MSE"));
+ assertEquals(null, ResidueProperties.getCanonicalAminoAcid(null));
+ }
+
+ @Test(groups = { "Functional" })
+ public void testGetSingleCharacterCode()
+ {
+ assertEquals('0', ResidueProperties.getSingleCharacterCode(null));
+ assertEquals('0', ResidueProperties.getSingleCharacterCode(null));
+ assertEquals('0', ResidueProperties.getSingleCharacterCode(""));
+ assertEquals('Q', ResidueProperties.getSingleCharacterCode("GLN"));
+ assertEquals('Q', ResidueProperties.getSingleCharacterCode("Gln"));
+ assertEquals('Q', ResidueProperties.getSingleCharacterCode("gln"));
+ }
}