output source in gff file
authoramwaterhouse <Andrew Waterhouse>
Fri, 28 Jul 2006 11:08:11 +0000 (11:08 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 28 Jul 2006 11:08:11 +0000 (11:08 +0000)
src/jalview/io/FeaturesFile.java

index d7c3775..7299628 100755 (executable)
@@ -173,7 +173,17 @@ public class FeaturesFile extends AlignFile
                 catch (Exception ex)\r
                 {}\r
 \r
-                seq.getDatasetSequence().addSequenceFeature(sf);\r
+                if(st.hasMoreTokens())\r
+                {\r
+                  StringBuffer attributes = new StringBuffer();\r
+                  while (st.hasMoreTokens())\r
+                  {\r
+                    attributes.append("\t"+st.nextElement());\r
+                  }\r
+                  sf.setValue("ATTRIBUTES", attributes.toString());\r
+                }\r
+\r
+                seq.addSequenceFeature(sf);\r
 \r
                 break;\r
               }\r
@@ -403,6 +413,7 @@ public class FeaturesFile extends AlignFile
     {\r
       StringBuffer out = new StringBuffer();\r
       SequenceFeature [] next;\r
+      String source;\r
 \r
       for(int i=0; i<seqs.length; i++)\r
       {\r
@@ -414,8 +425,12 @@ public class FeaturesFile extends AlignFile
             if(!visible.containsKey(next[j].type))\r
               continue;\r
 \r
+            source = next[j].featureGroup;\r
+            if(source==null)\r
+              source = next[j].getDescription();\r
+\r
             out.append(seqs[i].getName() + "\t"\r
-                       + next[j].description + "\t"\r
+                       + source + "\t"\r
                        + next[j].type  + "\t"\r
                        + next[j].begin + "\t"\r
                        + next[j].end   + "\t"\r
@@ -426,10 +441,16 @@ public class FeaturesFile extends AlignFile
               out.append(next[j].getValue("STRAND")+"\t");\r
             else\r
               out.append(".\t");\r
+\r
             if(next[j].getValue("FRAME")!=null)\r
-              out.append(next[j].getValue("FRAME")+"\n");\r
+              out.append(next[j].getValue("FRAME"));\r
             else\r
-              out.append(".\n");\r
+              out.append(".");\r
+\r
+            if(next[j].getValue("ATTRIBUTES")!=null)\r
+              out.append(next[j].getValue("ATTRIBUTES"));\r
+\r
+            out.append("\n");\r
 \r
           }\r
         }\r