Allow for uniprot in name
authoramwaterhouse <Andrew Waterhouse>
Mon, 5 Dec 2005 13:39:01 +0000 (13:39 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 5 Dec 2005 13:39:01 +0000 (13:39 +0000)
src/jalview/io/SequenceFeatureFetcher.java

index b766627..d980b0a 100755 (executable)
@@ -48,6 +48,7 @@ public class SequenceFeatureFetcher implements Runnable
   ArrayList unknownSequences;\r
   CutAndPasteTransfer output = new CutAndPasteTransfer();\r
   StringBuffer sbuffer = new StringBuffer();\r
+  boolean uniprotFlag = false;\r
 \r
   public SequenceFeatureFetcher()\r
   {}\r
@@ -129,6 +130,12 @@ public class SequenceFeatureFetcher implements Runnable
           StringBuffer remainingIds = new StringBuffer("uniprot:");\r
           for (int i = 0; i < ids.size(); i++)\r
            {\r
+             if(ids.get(i).toString().indexOf("|")>-1)\r
+             {\r
+               remainingIds.append(ids.get(i).toString().substring(\r
+                   ids.get(i).toString().lastIndexOf("|") + 1));\r
+               uniprotFlag = true;\r
+             }\r
              remainingIds.append(ids.get(i) + ";");\r
            }\r
           EBIFetchClient ebi = new EBIFetchClient();\r
@@ -218,13 +225,21 @@ public class SequenceFeatureFetcher implements Runnable
         sequence = dataset.findName(idmatch);\r
       }\r
 \r
-      if (sequence == null)\r
+      if(sequence!=null)\r
+        ids.remove(sequence.getName());\r
+\r
+      else  if (sequence == null && uniprotFlag)\r
+      {\r
+          sequence = dataset.findName("UniProt/Swiss-Prot|"+entry.getAccession().elementAt(0)+"|"+idmatch);\r
+          ids.remove(idmatch);\r
+      }\r
+\r
+      if(sequence ==null)\r
       {\r
         System.out.println(idmatch+" not found");\r
         continue;\r
       }\r
 \r
-      ids.remove(sequence.getName());\r
       unknownSequences.remove(sequence);\r
 \r
       String nonGapped = AlignSeq.extractGaps("-. ", sequence.getSequence());\r