JAL-2106 tighten DBRefEntry primary seq test for PDB
[jalview.git] / src / jalview / datamodel / Sequence.java
index 620bcc1..bb63466 100755 (executable)
@@ -1450,7 +1450,14 @@ public class Sequence extends ASequence implements SequenceI
                 DBRefUtils.getCanonicalName(ref.getSource())))
         {
           // PDB dbrefs imply there should be a PDBEntry associated
-          if (getPDBEntry(ref.getAccessionId()) != null)
+          // TODO: tighten PDB dbrefs
+          // formally imply Jalview has actually downlaoded and
+          // parsed the pdb file. That means there should be a cached file
+          // handle on the PDBEntry, and a real mapping between sequence and
+          // extracted sequence from PDB file
+          PDBEntry pdbentry = getPDBEntry(ref.getAccessionId());
+          if (pdbentry != null && pdbentry.getType() != null
+                  && pdbentry.getType().equalsIgnoreCase("PDB"))
           {
             primaries.add(ref);
           }