Merge commit 'alpha/update_2_12_for_2_11_2_series_merge^2' into HEAD
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index 636a460..bd3d7b3 100644 (file)
@@ -434,7 +434,17 @@ public class StructureSelectionManager implements ApplicationSingletonI
         registerPDBFile(pdb.getId().trim(), pdbFile);
       }
       // if PDBId is unavailable then skip SIFTS mapping execution path
-      isMapUsingSIFTs = isMapUsingSIFTs && pdb.isPPDBIdAvailable();
+      // TODO: JAL-3868 need to know if structure is actually from 
+      // PDB (has valid PDB ID and has provenance suggesting it 
+      // actually came from PDB)
+      boolean isProtein = false;
+      for (SequenceI s:sequenceArray) {
+        if (s.isProtein()) {
+          isProtein = true;
+          break;
+        }
+      }
+      isMapUsingSIFTs = isMapUsingSIFTs && pdb.isPPDBIdAvailable() && !pdb.getId().startsWith("AF-") && isProtein;
 
     } catch (Exception ex)
     {
@@ -562,15 +572,14 @@ public class StructureSelectionManager implements ApplicationSingletonI
                     pdb, maxChain, sqmpping, maxAlignseq, siftsClient);
             seqToStrucMapping.add(siftsMapping);
             maxChain.makeExactMapping(siftsMapping, seq);
-            maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS");// FIXME: is this
-                                                       // "IEA:SIFTS" ?
+            maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS");
             maxChain.transferResidueAnnotation(siftsMapping, null);
             ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
 
           } catch (SiftsException e)
           {
             // fall back to NW alignment
-            System.err.println(e.getMessage());
+            Cache.log.error(e.getMessage());
             StructureMapping nwMapping = getNWMappings(seq, pdbFile,
                     targetChainId, maxChain, pdb, maxAlignseq);
             seqToStrucMapping.add(nwMapping);
@@ -1275,35 +1284,35 @@ public class StructureSelectionManager implements ApplicationSingletonI
   {
     if (mappings != null)
     {
-    mappings.clear();
+      mappings.clear();
     }
     if (seqmappings != null)
     {
-    seqmappings.clear();
+      seqmappings.clear();
     }
     if (sel_listeners != null)
     {
-    sel_listeners.clear();
+      sel_listeners.clear();
     }
     if (listeners != null)
     {
-    listeners.clear();
+      listeners.clear();
     }
     if (commandListeners != null)
     {
-    commandListeners.clear();
+      commandListeners.clear();
     }
     if (view_listeners != null)
     {
-    view_listeners.clear();
+      view_listeners.clear();
     }
     if (pdbFileNameId != null)
     {
-    pdbFileNameId.clear();
+      pdbFileNameId.clear();
     }
     if (pdbIdFileName != null)
     {
-    pdbIdFileName.clear();
+      pdbIdFileName.clear();
     }
   }