JAL-2136 New Phyre2 branch + attempt to resynced with develop
[jalview.git] / src / jalview / ws / sifts / SiftsClient.java
index 2ff4a8b..53a2b8c 100644 (file)
@@ -31,6 +31,7 @@ import jalview.datamodel.SequenceI;
 import jalview.io.StructureFile;
 import jalview.schemes.ResidueProperties;
 import jalview.structure.StructureMapping;
+import jalview.structures.models.MappingOutputModel;
 import jalview.util.Comparison;
 import jalview.util.DBRefUtils;
 import jalview.util.Format;
@@ -82,9 +83,13 @@ public class SiftsClient implements SiftsClientI
    */
   private static File mockSiftsFile;
 
+  private static final int UNASSIGNED = StructureMapping.UNASSIGNED; // -1
+
+  private static final int PDB_RES_POS = StructureMapping.PDB_RES_NUM_INDEX; // 0
+
   private Entry siftsEntry;
 
-  private StructureFile pdb;
+  private StructureFile structureFile;
 
   private String pdbId;
 
@@ -94,10 +99,6 @@ public class SiftsClient implements SiftsClientI
 
   private static final int BUFFER_SIZE = 4096;
 
-  public static final int UNASSIGNED = -1;
-
-  private static final int PDB_RES_POS = 0;
-
   private static final int PDB_ATOM_POS = 1;
 
   private static final String NOT_OBSERVED = "Not_Observed";
@@ -150,10 +151,10 @@ public class SiftsClient implements SiftsClientI
    * @param pdbId
    * @throws SiftsException
    */
-  public SiftsClient(StructureFile pdb) throws SiftsException
+  public SiftsClient(StructureFile structureFile) throws SiftsException
   {
-    this.pdb = pdb;
-    this.pdbId = pdb.getId();
+    this.structureFile = structureFile;
+    this.pdbId = structureFile.getId();
     File siftsFile = getSiftsFile(pdbId);
     siftsEntry = parseSIFTs(siftsFile);
   }
@@ -532,7 +533,7 @@ public class SiftsClient implements SiftsClientI
 
     if (os != null)
     {
-      MappingOutputPojo mop = new MappingOutputPojo();
+      MappingOutputModel mop = new MappingOutputModel();
       mop.setSeqStart(seqStart);
       mop.setSeqEnd(seqEnd);
       mop.setSeqName(seq.getName());
@@ -656,7 +657,7 @@ public class SiftsClient implements SiftsClientI
   {
     try
     {
-      PDBChain chain = pdb.findChain(chainId);
+      PDBChain chain = structureFile.findChain(chainId);
 
       if (chain == null || mapping == null)
       {
@@ -965,7 +966,7 @@ public class SiftsClient implements SiftsClientI
   }
 
   @Override
-  public StringBuilder getMappingOutput(MappingOutputPojo mp)
+  public StringBuilder getMappingOutput(MappingOutputModel mp)
           throws SiftsException
   {
     String seqRes = mp.getSeqResidue();
@@ -1127,4 +1128,5 @@ public class SiftsClient implements SiftsClientI
     mockSiftsFile = file;
   }
 
+
 }