Jalview features format adds links as hrefs
authoramwaterhouse <Andrew Waterhouse>
Fri, 18 Aug 2006 08:51:58 +0000 (08:51 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 18 Aug 2006 08:51:58 +0000 (08:51 +0000)
src/jalview/io/FeaturesFile.java

index 7299628..4497bc7 100755 (executable)
@@ -383,7 +383,29 @@ public class FeaturesFile extends AlignFile
                 if(next[j].description==null || next[j].description.equals(""))\r
                   out.append(next[j].type+"\t");\r
                 else\r
-                  out.append(next[j].description + "\t");\r
+                {\r
+                  out.append(next[j].description+" ");\r
+                  if(next[j].links!=null)\r
+                    {\r
+                      for(int l=0; l<next[j].links.size(); l++)\r
+                      {\r
+                        String label = next[j].links.elementAt(l).toString();\r
+                        String href = label.substring(label.indexOf("|")+1);\r
+                        label = label.substring(0, label.indexOf("|"));\r
+\r
+                        if(next[j].description.indexOf(href)==-1)\r
+                        {\r
+                          out.append("<a href=\""\r
+                                     + href\r
+                                     + "\">"\r
+                                     + label\r
+                                     + "</a>");\r
+                        }\r
+                      }\r
+                    }\r
+                   out.append("\t");\r
+                }\r
+\r
 \r
                 out.append(  seqs[i].getName() + "\t-1\t"\r
                            + next[j].begin + "\t"\r