JAL-3855 try harder to ignore DNA/RNA only structures when deciding whether to downlo...
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index 8c3816e..ad57831 100644 (file)
@@ -410,7 +410,17 @@ public class StructureSelectionManager
         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)
     {
@@ -538,15 +548,14 @@ public class StructureSelectionManager
                     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);