+ if(result[r].indexOf("<sequence")>-1)\r
+ {\r
+ StringBuffer seqString = new StringBuffer();\r
+\r
+ if(out!=null)\r
+ try { out.writeBytes(result[r]+"\n"); } catch (Exception ex){}\r
+\r
+ while(result[++r].indexOf("</sequence>")==-1)\r
+ {\r
+ seqString.append(result[r]);\r
+ if(out!=null)\r
+ try { out.writeBytes(result[r]+"\n"); } catch (Exception ex){}\r
+ }\r
+\r
+ if(out!=null)\r
+ try { out.writeBytes(result[r]+"\n"); } catch (Exception ex){}\r
+\r
+ StringBuffer nonGapped = new StringBuffer();\r
+ for (int i = 0; i < sequence.getSequence().length(); i++)\r
+ {\r
+ if (!jalview.util.Comparison.isGap(sequence.getCharAt(i)))\r
+ nonGapped.append(sequence.getCharAt(i));\r
+ }\r
+\r
+ int absStart = seqString.toString().indexOf(nonGapped.toString());\r
+ if(absStart==-1)\r
+ {\r
+ unknownSequences.add(sequence.getName());\r
+ features = null;\r
+ System.out.println(sequence.getName()+ "does not match ");\r
+ continue;\r
+ }\r
+\r
+ int absEnd = absStart + nonGapped.toString().length();\r
+ absStart+=1;\r
+\r
+ if(absStart!=sequence.getStart() || absEnd!=sequence.getEnd())\r
+ System.out.println("Updated: "+sequence.getName()+" "+\r
+ sequence.getStart()+"/"+sequence.getEnd()+" to "+ absStart+"/"+absEnd);\r
+\r
+\r
+ sequence.setStart(absStart);\r
+ sequence.setEnd(absEnd);\r
+\r
+ }\r
+\r