public class SiftsClient implements SiftsClientI
{
+ /*
+ * for use in mocking out file fetch for tests only
+ * - reset to null after testing!
+ */
+ private static File mockSiftsFile;
+
private Entry siftsEntry;
private StructureFile pdb;
*/
public static File getSiftsFile(String pdbId) throws SiftsException
{
+ /*
+ * return mocked file if it has been set
+ */
+ if (mockSiftsFile != null)
+ {
+ return mockSiftsFile;
+ }
+
String siftsFileName = SiftsSettings.getSiftDownloadDirectory()
+ pdbId.toLowerCase() + ".xml.gz";
File siftsFile = new File(siftsFileName);
if (os != null)
{
MappingOutputPojo mop = new MappingOutputPojo();
- mop.setSeqStart(pdbStart);
- mop.setSeqEnd(pdbEnd);
+ mop.setSeqStart(seqStart);
+ mop.setSeqEnd(seqEnd);
mop.setSeqName(seq.getName());
mop.setSeqResidue(matchedSeq);
- mop.setStrStart(seqStart);
- mop.setStrEnd(seqEnd);
+ mop.setStrStart(pdbStart);
+ mop.setStrEnd(pdbEnd);
mop.setStrName(structId);
mop.setStrResidue(targetStrucSeqs.toString());
return siftsEntry.getDbVersion();
}
+ public static void setMockSiftsFile(File file)
+ {
+ mockSiftsFile = file;
+ }
+
}