/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
return null;
}
- public static String codonTranslate(String codon)
+ public static String codonTranslate(String lccodon)
{
+ String codon=lccodon.toUpperCase();
+ // all base ambiguity codes yield an 'X' amino acid residue
+ if (codon.indexOf('X')>-1 || codon.indexOf('N')>-1)
+ {
+ return "X";
+ }
Enumeration e = codonHash.keys();
while (e.hasMoreElements())
String key = (String) e.nextElement();
Vector tmp = (Vector) codonHash.get(key);
- if (tmp.contains(codon.toUpperCase()))
+ if (tmp.contains(codon))
{
return key;
}