loadAmbiguityCodes(AMBIGUITY_CODES_FILE);
loadCodes(RESOURCE_FILE);
}
- };
+ }
/**
* Returns the singleton instance of this class
try
{
InputStream is = getClass().getResourceAsStream(fileName);
+ if (is == null)
+ {
+ System.err.println("Resource file not found: " + fileName);
+ return;
+ }
BufferedReader dataIn = new BufferedReader(new InputStreamReader(is));
/*
} catch (IOException | NullPointerException e)
{
Cache.log.error(
- "Error reading genetic codes data file: "
+ "Error reading genetic codes data file " + fileName + ": "
+ e.getMessage());
}
+ if (codeTables.isEmpty())
+ {
+ System.err.println(
+ "No genetic code tables loaded, check format of file "
+ + fileName);
+ }
}
/**
try
{
InputStream is = getClass().getResourceAsStream(fileName);
+ if (is == null)
+ {
+ System.err.println("Resource file not found: " + fileName);
+ return;
+ }
BufferedReader dataIn = new BufferedReader(new InputStreamReader(is));
String line = "";
while (line != null)
if (line != null && !"DNA".equals(line.toUpperCase()))
{
String[] tokens = line.split("\\t");
+ if (tokens.length == 2)
+ {
ambiguityCodes.put(tokens[0].toUpperCase(),
tokens[1].toUpperCase());
+ }
+ else
+ {
+ System.err.println(
+ "Unexpected data in " + fileName + ": " + line);
+ }
}
}
} catch (IOException e)