package jalview.analysis;
import java.util.Locale;
-
-import jalview.bin.Cache;
-
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
*
InputStream is = getClass().getResourceAsStream(fileName);
if (is == null)
{
- System.err.println("Resource file not found: " + fileName);
+ jalview.bin.Console.errPrintln("Resource file not found: " + fileName);
return;
}
BufferedReader dataIn = new BufferedReader(new InputStreamReader(is));
}
} catch (IOException | NullPointerException e)
{
- Cache.error(
- "Error reading genetic codes data file " + fileName + ": "
- + e.getMessage());
+ Console.error("Error reading genetic codes data file " + fileName
+ + ": " + e.getMessage());
}
if (codeTables.isEmpty())
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"No genetic code tables loaded, check format of file "
+ fileName);
}
InputStream is = getClass().getResourceAsStream(fileName);
if (is == null)
{
- System.err.println("Resource file not found: " + fileName);
+ jalview.bin.Console.errPrintln("Resource file not found: " + fileName);
return;
}
BufferedReader dataIn = new BufferedReader(new InputStreamReader(is));
String[] tokens = line.split("\\t");
if (tokens.length == 2)
{
- ambiguityCodes.put(tokens[0].toUpperCase(Locale.ROOT),
- tokens[1].toUpperCase(Locale.ROOT));
+ ambiguityCodes.put(tokens[0].toUpperCase(Locale.ROOT),
+ tokens[1].toUpperCase(Locale.ROOT));
}
else
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Unexpected data in " + fileName + ": " + line);
}
}
}
} catch (IOException e)
{
- Cache.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.error("wrong data length in code table: " + line);
+ Console.error("wrong data length in code table: " + line);
}
else
{