develop merge
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index 2f81ec4..00b3143 100644 (file)
@@ -385,10 +385,10 @@ public class StructureSelectionManager
       pdb = new PDBfile(addTempFacAnnot, parseSecStr, secStructServices,
               pdbFile, protocol);
 
-      if (pdb.id != null && pdb.id.trim().length() > 0
+      if (pdb.getId() != null && pdb.getId().trim().length() > 0
               && AppletFormatAdapter.FILE.equals(protocol))
       {
-        registerPDBFile(pdb.id.trim(), pdbFile);
+        registerPDBFile(pdb.getId().trim(), pdbFile);
       }
     } catch (Exception ex)
     {
@@ -449,7 +449,7 @@ public class StructureSelectionManager
       String maxChainId = " ";
       PDBChain maxChain = null;
       boolean first = true;
-      for (PDBChain chain : pdb.chains)
+      for (PDBChain chain : pdb.getChains())
       {
         if (targetChainId.length() > 0 && !targetChainId.equals(chain.id)
                 && !infChain)
@@ -483,7 +483,7 @@ public class StructureSelectionManager
 
       if (protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
       {
-        pdbFile = "INLINE" + pdb.id;
+        pdbFile = "INLINE" + pdb.getId();
       }
 
       ArrayList<StructureMapping> seqToStrucMapping = new ArrayList<StructureMapping>();
@@ -501,7 +501,7 @@ public class StructureSelectionManager
         }
         else
         {
-          for (PDBChain chain : pdb.chains)
+          for (PDBChain chain : pdb.getChains())
           {
             StructureMapping mapping = getStructureMapping(seq, pdbFile,
                     chain.id, pdb, chain, sqmpping, maxAlignseq);
@@ -535,11 +535,17 @@ public class StructureSelectionManager
     {
       StructureMapping curChainMapping = siftsClient
               .getSiftsStructureMapping(seq, pdbFile, targetChainId);
+      try
+      {
       PDBChain chain = pdb.findChain(targetChainId);
       if (chain != null)
       {
         chain.transferResidueAnnotation(curChainMapping, sqmpping);
       }
+      } catch (Exception e)
+      {
+        e.printStackTrace();
+      }
       return curChainMapping;
     } catch (SiftsException e)
     {
@@ -626,7 +632,7 @@ public class StructureSelectionManager
     } while (index < maxChain.atoms.size());
 
     StructureMapping nwMapping = new StructureMapping(seq, pdbFile,
-            pdb.id, maxChainId, mapping, mappingDetails.toString());
+            pdb.getId(), maxChainId, mapping, mappingDetails.toString());
     maxChain.transferResidueAnnotation(nwMapping, sqmpping);
     return nwMapping;
   }