fixes bug 0013013 but reveals lack of a 'features retrieved' flag that should be...
authorjprocter <Jim Procter>
Mon, 13 Mar 2006 16:52:54 +0000 (16:52 +0000)
committerjprocter <Jim Procter>
Mon, 13 Mar 2006 16:52:54 +0000 (16:52 +0000)
src/jalview/io/SequenceFeatureFetcher.java

index 7f11149..00afc39 100755 (executable)
@@ -113,8 +113,14 @@ public class SequenceFeatureFetcher implements Runnable
              seqIndex++, i++)\r
         {\r
           Sequence sequence = (Sequence) sequences.get(seqIndex);\r
-          if(sequence.getSequenceFeatures()==null)\r
+          Vector uprefs = jalview.util.DBRefUtils.selectRefs(sequence.getDBRef(), new String[] { "Uniprot"});\r
+          if (uprefs!=null)\r
           {\r
+            // we know the id for this entry, so don't note its ID in the unknownSequences list\r
+            for (int j=0,k=uprefs.size(); j<k; j++)\r
+              ids.add(((DBRefEntry) uprefs.get(j)).getAccessionId());\r
+            unknownSequences.add(sequence);\r
+          } else {\r
             if (!ids.contains(sequence.getName()))\r
             {\r
               ids.add(sequence.getName());\r
@@ -301,10 +307,12 @@ public class SequenceFeatureFetcher implements Runnable
       }\r
 \r
       sequence.setPDBId(onlyPdbEntries);\r
-      e = entry.getFeature().elements();\r
-      while(e.hasMoreElements())\r
-      {\r
-          sequence.addSequenceFeature((SequenceFeature)e.nextElement());\r
+      if (entry.getFeature()!=null) {\r
+        e = entry.getFeature().elements();\r
+        while (e.hasMoreElements())\r
+        {\r
+          sequence.addSequenceFeature( (SequenceFeature) e.nextElement());\r
+        }\r
       }\r
       sequence.setStart(absStart);\r
       sequence.setEnd(absEnd);\r