Allow residue prefix to dataset
authoramwaterhouse <Andrew Waterhouse>
Wed, 2 Nov 2005 16:07:05 +0000 (16:07 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 2 Nov 2005 16:07:05 +0000 (16:07 +0000)
src/jalview/io/SequenceFeatureFetcher.java

index 44ce60b..108fe08 100755 (executable)
@@ -220,13 +220,38 @@ public class SequenceFeatureFetcher implements Runnable
       int absStart = entry.getUniprotSequence().getContent().indexOf(\r
           nonGapped.toString());\r
 \r
+      int residueOffset = 0;\r
       if (absStart == -1)\r
       {\r
-        unknownSequences.add(sequence.getName());\r
-        sbuffer.append(sequence.getName() +\r
-                       " SEQUENCE NOT %100 MATCH \n");\r
+        // Is UniprotSequence contained in dataset sequence?\r
+        absStart = nonGapped.toString().indexOf(entry.getUniprotSequence().getContent());\r
+        if(absStart == -1)\r
+        {\r
+          unknownSequences.add(sequence.getName());\r
+          sbuffer.append(sequence.getName() +\r
+                         " SEQUENCE NOT %100 MATCH \n");\r
+\r
+          continue;\r
+        }\r
+        else\r
+        {\r
+          if(entry.getFeatures()!=null)\r
+          {\r
+            Enumeration e = entry.getFeatures().elements();\r
+            while (e.hasMoreElements())\r
+            {\r
+              SequenceFeature sf = (SequenceFeature) e.nextElement();\r
+              sf.setBegin(sf.getBegin() + absStart + 1);\r
+              sf.setEnd(sf.getEnd() + absStart + 1);\r
+            }\r
+          }\r
+\r
+          sbuffer.append(sequence.getName() +\r
+                         " HAS "+absStart+" PREFIXED RESIDUES COMPARED TO UNIPROT - ANY SEQUENCE FEATURES"\r
+                        +" HAVE BEEN ADJUSTED ACCORDINGLY \n");\r
+          absStart = 0;\r
+        }\r
 \r
-        continue;\r
       }\r
 \r
       int absEnd = absStart + nonGapped.toString().length();\r