*/
package jalview.analysis;
-import jalview.bin.Cache;
-
+import java.util.Locale;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import java.util.StringTokenizer;
+import jalview.bin.Console;
+
/**
* A singleton that provides instances of genetic code translation tables
*
}
} catch (IOException | NullPointerException e)
{
- Cache.log.error(
- "Error reading genetic codes data file " + fileName + ": "
- + e.getMessage());
+ Console.error("Error reading genetic codes data file " + fileName
+ + ": " + e.getMessage());
}
if (codeTables.isEmpty())
{
while (line != null)
{
line = readLine(dataIn);
- if (line != null && !"DNA".equals(line.toUpperCase()))
+ if (line != null && !"DNA".equals(line.toUpperCase(Locale.ROOT)))
{
String[] tokens = line.split("\\t");
if (tokens.length == 2)
{
- ambiguityCodes.put(tokens[0].toUpperCase(),
- tokens[1].toUpperCase());
+ ambiguityCodes.put(tokens[0].toUpperCase(Locale.ROOT),
+ tokens[1].toUpperCase(Locale.ROOT));
}
else
{
}
} catch (IOException e)
{
- Cache.log.error(
- "Error reading nucleotide ambiguity codes data file: "
- + e.getMessage());
+ Console.error("Error reading nucleotide ambiguity codes data file: "
+ + e.getMessage());
}
}
line.lastIndexOf(QUOTE));
if (aminos.length() != NUCS_COUNT_CUBED) // 4 * 4 * 4 combinations
{
- Cache.log.error("wrong data length in code table: " + line);
+ Console.error("wrong data length in code table: " + line);
}
else
{
@Override
public String translateCanonical(String codon)
{
- return codons.get(codon.toUpperCase());
+ return codons.get(codon.toUpperCase(Locale.ROOT));
}
@Override
public String translate(String codon)
{
- String upper = codon.toUpperCase();
+ String upper = codon.toUpperCase(Locale.ROOT);
String peptide = translateCanonical(upper);
/*