public String aa(String codons) {
		if (codons.isEmpty()) return "";

		char bases[] = codons.toCharArray();
		StringBuilder aas = new StringBuilder();

		for (int i = 0; i < bases.length;) {
			// Append bases to codon
			String cod = "";
			for (int j = 0; (j < 3) && (i < bases.length); j++, i++)
				cod += bases[i];

			// Translate codon to amino acid
			String aa = codon2aa.get(cod.toUpperCase());
			if (aa == null) aa = "?";
			aas.append(aa);
		}

		return aas.toString();
	}