private final static String NEWLINE = System.lineSeparator();
- private final static int THRESHOLD_IN_DAYS = 2;
+ // private final static int CACHE_THRESHOLD_IN_DAYS = 2;
+ //
+ // private final static int FAIL_SAFE_PID_THRESHOLD = 30;
private String curSourceDBRef;
// The line below is required for unit testing... don't comment it out!!!
System.out.println(">>> SIFTS File already downloaded for " + pdbId);
- if (isFileOlderThanThreshold(siftsFile, THRESHOLD_IN_DAYS))
+ if (isFileOlderThanThreshold(siftsFile,
+ SiftsSettings.getCacheThresholdInDays()))
{
// System.out.println("Downloaded file is out of date, hence re-downloading...");
siftsFile = downloadSiftsFile(pdbId.toLowerCase());
Integer[] keys = mapping.keySet().toArray(new Integer[0]);
Arrays.sort(keys);
+ if (keys.length < 1)
+ {
+ throw new SiftsException(">>> Empty SIFTS mapping generated!!");
+ }
seqStart = keys[0];
seqEnd = keys[keys.length - 1];
output.append(NEWLINE).append(NEWLINE);
}
float pid = (float) matchedSeqCount / seqRes.length() * 100;
- if (pid < 2)
+ if (pid < SiftsSettings.getFailSafePIDThreshold())
{
- throw new SiftsException("Low PID detected for SIFTs mapping...");
+ throw new SiftsException(
+">>> Low PID detected for SIFTs mapping...");
}
output.append("Length of alignment = " + seqRes.length()).append(
NEWLINE);