Mapping now performed in PDBChain
authoramwaterhouse <Andrew Waterhouse>
Mon, 28 Nov 2005 17:14:49 +0000 (17:14 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 28 Nov 2005 17:14:49 +0000 (17:14 +0000)
src/jalview/analysis/AlignSeq.java

index 0e6f1bd..6b40e91 100755 (executable)
@@ -69,8 +69,8 @@ public class AlignSeq
     int maxj;\r
     int[] aseq1;\r
     int[] aseq2;\r
-    String astr1 = "";\r
-    String astr2 = "";\r
+    public String astr1 = "";\r
+    public String astr2 = "";\r
 \r
     /** DOCUMENT ME!! */\r
     public int seq1start;\r
@@ -406,15 +406,15 @@ public class AlignSeq
     public int [] getExactMapping()\r
     {\r
         // Print out the matching chars\r
-        int size = s2.getLength();\r
+        int size = s2.getLength()+1;\r
         int [] mapping = new int[size];\r
         for(int i=0; i<size; i++)\r
           mapping[i] = -1;\r
 \r
-        int pdbpos = seq2start-2;\r
-        int alignpos = seq1start-2;\r
-\r
+        int pdbpos = s2.getStart() + seq2start-3;\r
+        int alignpos = s1.getStart() + seq1start-3;\r
 \r
+System.out.println(pdbpos+" "+alignpos);\r
         for(int i=0; i<astr1.length(); i++)\r
         {\r
             if (astr1.charAt(i) != '-')\r
@@ -432,16 +432,18 @@ public class AlignSeq
               mapping[pdbpos] = alignpos;\r
             }\r
         }\r
+System.out.println(s1.getStart()+" "+s2.getStart()+" "+seq1start+" "+seq2start+"\n"+\r
+                           s1.getSequence()+"\n"+s2.getSequence()+"\n"+astr1+"\n"+astr2);\r
 \r
-      /*  for(int i=0; i<mapping.length; i++)\r
+        for(int i=0; i<mapping.length; i++)\r
         {\r
           if(mapping[i]!=-1)\r
             System.out.println(i+" "+s2.getCharAt(i) + " " + mapping[i] + " " +\r
-                               s1.findIndex(mapping[i])+" "+\r
+                               s1.findIndex(mapping[i]+1)+" "+\r
                                s1.getCharAt(s1.findIndex(mapping[i])));\r
           else\r
             System.out.println(i+" "+"XX"+s2.getCharAt(i));\r
-        }*/\r
+        }\r
 \r
         return mapping;\r
     }\r