2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
\r
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
\r
5 * This file is part of Jalview.
\r
7 * Jalview is free software: you can redistribute it and/or
\r
8 * modify it under the terms of the GNU General Public License
\r
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
\r
11 * Jalview is distributed in the hope that it will be useful, but
\r
12 * WITHOUT ANY WARRANTY; without even the implied warranty
\r
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
14 * PURPOSE. See the GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
\r
23 import jalview.analysis.SequenceIdMatcher;
\r
24 import jalview.datamodel.*;
\r
25 import jalview.schemes.*;
\r
26 import jalview.util.Format;
\r
29 * Parse and create Jalview Features files Detects GFF format features files and
\r
30 * parses. Does not implement standard print() - call specific printFeatures or
\r
31 * printGFF. Uses AlignmentI.findSequence(String id) to find the sequence object
\r
32 * for the features annotation - this normally works on an exact match.
\r
35 * @version $Revision$
\r
37 public class FeaturesFile extends AlignFile
\r
40 * work around for GFF interpretation bug where source string becomes
\r
41 * description rather than a group
\r
43 private boolean doGffSource = true;
\r
46 * Creates a new FeaturesFile object.
\r
48 public FeaturesFile()
\r
53 * Creates a new FeaturesFile object.
\r
60 * @throws IOException
\r
63 public FeaturesFile(String inFile, String type) throws IOException
\r
65 super(inFile, type);
\r
68 public FeaturesFile(FileParse source) throws IOException
\r
74 * Parse GFF or sequence features file using case-independent matching, discarding URLs
\r
75 * @param align - alignment/dataset containing sequences that are to be annotated
\r
76 * @param colours - hashtable to store feature colour definitions
\r
77 * @param removeHTML - process html strings into plain text
\r
78 * @return true if features were added
\r
80 public boolean parse(AlignmentI align, Hashtable colours,
\r
83 return parse(align, colours, null, removeHTML, false);
\r
87 * Parse GFF or sequence features file optionally using case-independent matching, discarding URLs
\r
88 * @param align - alignment/dataset containing sequences that are to be annotated
\r
89 * @param colours - hashtable to store feature colour definitions
\r
90 * @param removeHTML - process html strings into plain text
\r
91 * @param relaxedIdmatching - when true, ID matches to compound sequence IDs are allowed
\r
92 * @return true if features were added
\r
94 public boolean parse(AlignmentI align,
\r
95 Hashtable colours, boolean removeHTML, boolean relaxedIdMatching)
\r
97 return parse(align, colours, null, removeHTML, relaxedIdMatching);
\r
101 * Parse GFF or sequence features file optionally using case-independent matching
\r
102 * @param align - alignment/dataset containing sequences that are to be annotated
\r
103 * @param colours - hashtable to store feature colour definitions
\r
104 * @param featureLink - hashtable to store associated URLs
\r
105 * @param removeHTML - process html strings into plain text
\r
106 * @return true if features were added
\r
108 public boolean parse(AlignmentI align, Hashtable colours,
\r
109 Hashtable featureLink, boolean removeHTML)
\r
111 return parse(align, colours, featureLink, removeHTML, false);
\r
116 * Parse GFF or sequence features file
\r
117 * @param align - alignment/dataset containing sequences that are to be annotated
\r
118 * @param colours - hashtable to store feature colour definitions
\r
119 * @param featureLink - hashtable to store associated URLs
\r
120 * @param removeHTML - process html strings into plain text
\r
121 * @param relaxedIdmatching - when true, ID matches to compound sequence IDs are allowed
\r
122 * @return true if features were added
\r
124 public boolean parse(AlignmentI align,
\r
125 Hashtable colours, Hashtable featureLink, boolean removeHTML, boolean relaxedIdmatching)
\r
128 String line = null;
\r
131 SequenceI seq = null;
\r
132 String type, desc, token = null;
\r
134 int index, start, end;
\r
136 StringTokenizer st;
\r
137 SequenceFeature sf;
\r
138 String featureGroup = null, groupLink = null;
\r
139 Hashtable typeLink = new Hashtable();
\r
141 * when true, assume GFF style features rather than Jalview style.
\r
143 boolean GFFFile = true;
\r
144 while ((line = nextLine()) != null)
\r
146 if (line.startsWith("#"))
\r
151 st = new StringTokenizer(line, "\t");
\r
152 if (st.countTokens() == 1)
\r
154 if (line.trim().equalsIgnoreCase("GFF"))
\r
156 // Start parsing file as if it might be GFF again.
\r
161 if (st.countTokens() > 1 && st.countTokens() < 4)
\r
164 type = st.nextToken();
\r
165 if (type.equalsIgnoreCase("startgroup"))
\r
167 featureGroup = st.nextToken();
\r
168 if (st.hasMoreElements())
\r
170 groupLink = st.nextToken();
\r
171 featureLink.put(featureGroup, groupLink);
\r
174 else if (type.equalsIgnoreCase("endgroup"))
\r
176 // We should check whether this is the current group,
\r
177 // but at present theres no way of showing more than 1 group
\r
179 featureGroup = null;
\r
184 Object colour = null;
\r
185 String colscheme = st.nextToken();
\r
186 if (colscheme.indexOf("|") > -1
\r
187 || colscheme.trim().equalsIgnoreCase("label"))
\r
189 // Parse '|' separated graduated colourscheme fields:
\r
190 // [label|][mincolour|maxcolour|[absolute|]minvalue|maxvalue|thresholdtype|thresholdvalue]
\r
191 // can either provide 'label' only, first is optional, next two
\r
192 // colors are required (but may be
\r
193 // left blank), next is optional, nxt two min/max are required.
\r
194 // first is either 'label'
\r
195 // first/second and third are both hexadecimal or word equivalent
\r
197 // next two are values parsed as floats.
\r
198 // fifth is either 'above','below', or 'none'.
\r
199 // sixth is a float value and only required when fifth is either
\r
200 // 'above' or 'below'.
\r
201 StringTokenizer gcol = new StringTokenizer(colscheme, "|",
\r
204 int threshtype = AnnotationColourGradient.NO_THRESHOLD;
\r
205 float min = Float.MIN_VALUE, max = Float.MAX_VALUE, threshval = Float.NaN;
\r
206 boolean labelCol = false;
\r
208 String mincol = gcol.nextToken();
\r
212 .println("Expected either 'label' or a colour specification in the line: "
\r
216 String maxcol = null;
\r
217 if (mincol.toLowerCase().indexOf("label") == 0)
\r
220 mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); // skip
\r
222 mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null);
\r
224 String abso = null, minval, maxval;
\r
225 if (mincol != null)
\r
227 // at least four more tokens
\r
228 if (mincol.equals("|"))
\r
234 gcol.nextToken(); // skip next '|'
\r
236 // continue parsing rest of line
\r
237 maxcol = gcol.nextToken();
\r
238 if (maxcol.equals("|"))
\r
244 gcol.nextToken(); // skip next '|'
\r
246 abso = gcol.nextToken();
\r
247 gcol.nextToken(); // skip next '|'
\r
248 if (abso.toLowerCase().indexOf("abso") != 0)
\r
255 minval = gcol.nextToken();
\r
256 gcol.nextToken(); // skip next '|'
\r
258 maxval = gcol.nextToken();
\r
259 if (gcol.hasMoreTokens())
\r
261 gcol.nextToken(); // skip next '|'
\r
265 if (minval.length() > 0)
\r
267 min = new Float(minval).floatValue();
\r
269 } catch (Exception e)
\r
272 .println("Couldn't parse the minimum value for graduated colour for type ("
\r
274 + ") - did you misspell 'auto' for the optional automatic colour switch ?");
\r
275 e.printStackTrace();
\r
279 if (maxval.length() > 0)
\r
281 max = new Float(maxval).floatValue();
\r
283 } catch (Exception e)
\r
286 .println("Couldn't parse the maximum value for graduated colour for type ("
\r
287 + colscheme + ")");
\r
288 e.printStackTrace();
\r
293 // add in some dummy min/max colours for the label-only
\r
300 colour = new jalview.schemes.GraduatedColor(
\r
301 new UserColourScheme(mincol).findColour('A'),
\r
302 new UserColourScheme(maxcol).findColour('A'), min,
\r
304 } catch (Exception e)
\r
307 .println("Couldn't parse the graduated colour scheme ("
\r
308 + colscheme + ")");
\r
309 e.printStackTrace();
\r
311 if (colour != null)
\r
313 ((jalview.schemes.GraduatedColor) colour)
\r
314 .setColourByLabel(labelCol);
\r
315 ((jalview.schemes.GraduatedColor) colour)
\r
316 .setAutoScaled(abso == null);
\r
317 // add in any additional parameters
\r
318 String ttype = null, tval = null;
\r
319 if (gcol.hasMoreTokens())
\r
321 // threshold type and possibly a threshold value
\r
322 ttype = gcol.nextToken();
\r
323 if (ttype.toLowerCase().startsWith("below"))
\r
325 ((jalview.schemes.GraduatedColor) colour)
\r
326 .setThreshType(AnnotationColourGradient.BELOW_THRESHOLD);
\r
328 else if (ttype.toLowerCase().startsWith("above"))
\r
330 ((jalview.schemes.GraduatedColor) colour)
\r
331 .setThreshType(AnnotationColourGradient.ABOVE_THRESHOLD);
\r
335 ((jalview.schemes.GraduatedColor) colour)
\r
336 .setThreshType(AnnotationColourGradient.NO_THRESHOLD);
\r
337 if (!ttype.toLowerCase().startsWith("no"))
\r
340 .println("Ignoring unrecognised threshold type : "
\r
345 if (((GraduatedColor) colour).getThreshType() != AnnotationColourGradient.NO_THRESHOLD)
\r
350 tval = gcol.nextToken();
\r
351 ((jalview.schemes.GraduatedColor) colour)
\r
352 .setThresh(new Float(tval).floatValue());
\r
353 } catch (Exception e)
\r
356 .println("Couldn't parse threshold value as a float: ("
\r
358 e.printStackTrace();
\r
361 // parse the thresh-is-min token ?
\r
362 if (gcol.hasMoreTokens())
\r
365 .println("Ignoring additional tokens in parameters in graduated colour specification\n");
\r
366 while (gcol.hasMoreTokens())
\r
368 System.err.println("|" + gcol.nextToken());
\r
370 System.err.println("\n");
\r
376 UserColourScheme ucs = new UserColourScheme(colscheme);
\r
377 colour = ucs.findColour('A');
\r
379 if (colour != null)
\r
381 colours.put(type, colour);
\r
383 if (st.hasMoreElements())
\r
385 String link = st.nextToken();
\r
386 typeLink.put(type, link);
\r
387 if (featureLink == null)
\r
389 featureLink = new Hashtable();
\r
391 featureLink.put(type, link);
\r
397 while (st.hasMoreElements())
\r
402 // Still possible this is an old Jalview file,
\r
403 // which does not have type colours at the beginning
\r
404 seqId = token = st.nextToken();
\r
405 seq = findName(align, seqId, relaxedIdmatching);
\r
408 desc = st.nextToken();
\r
409 String group = null;
\r
410 if (doGffSource && desc.indexOf(' ') == -1)
\r
412 // could also be a source term rather than description line
\r
413 group = new String(desc);
\r
415 type = st.nextToken();
\r
418 String stt = st.nextToken();
\r
419 if (stt.length() == 0 || stt.equals("-"))
\r
425 start = Integer.parseInt(stt);
\r
427 } catch (NumberFormatException ex)
\r
433 String stt = st.nextToken();
\r
434 if (stt.length() == 0 || stt.equals("-"))
\r
440 end = Integer.parseInt(stt);
\r
442 } catch (NumberFormatException ex)
\r
446 // TODO: decide if non positional feature assertion for input data
\r
447 // where end==0 is generally valid
\r
450 // treat as non-positional feature, regardless.
\r
455 score = new Float(st.nextToken()).floatValue();
\r
456 } catch (NumberFormatException ex)
\r
461 sf = new SequenceFeature(type, desc, start, end, score, group);
\r
465 sf.setValue("STRAND", st.nextToken());
\r
466 sf.setValue("FRAME", st.nextToken());
\r
467 } catch (Exception ex)
\r
471 if (st.hasMoreTokens())
\r
473 StringBuffer attributes = new StringBuffer();
\r
474 while (st.hasMoreTokens())
\r
476 attributes.append("\t" + st.nextElement());
\r
478 // TODO validate and split GFF2 attributes field ? parse out
\r
479 // ([A-Za-z][A-Za-z0-9_]*) <value> ; and add as
\r
480 // sf.setValue(attrib, val);
\r
481 sf.setValue("ATTRIBUTES", attributes.toString());
\r
484 seq.addSequenceFeature(sf);
\r
485 while ((seq = align.findName(seq, seqId, true)) != null)
\r
487 seq.addSequenceFeature(new SequenceFeature(sf));
\r
493 if (GFFFile && seq == null)
\r
499 desc = st.nextToken();
\r
501 if (!st.hasMoreTokens())
\r
504 .println("DEBUG: Run out of tokens when trying to identify the destination for the feature.. giving up.");
\r
505 // in all probability, this isn't a file we understand, so bail
\r
510 token = st.nextToken();
\r
512 if (!token.equals("ID_NOT_SPECIFIED"))
\r
514 seq = findName(align, seqId = token, relaxedIdmatching);
\r
522 index = Integer.parseInt(st.nextToken());
\r
523 seq = align.getSequenceAt(index);
\r
524 } catch (NumberFormatException ex)
\r
532 System.out.println("Sequence not found: " + line);
\r
536 start = Integer.parseInt(st.nextToken());
\r
537 end = Integer.parseInt(st.nextToken());
\r
539 type = st.nextToken();
\r
541 if (!colours.containsKey(type))
\r
543 // Probably the old style groups file
\r
544 UserColourScheme ucs = new UserColourScheme(type);
\r
545 colours.put(type, ucs.findColour('A'));
\r
547 sf = new SequenceFeature(type, desc, "", start, end, featureGroup);
\r
548 if (st.hasMoreTokens())
\r
552 score = new Float(st.nextToken()).floatValue();
\r
553 // update colourgradient bounds if allowed to
\r
554 } catch (NumberFormatException ex)
\r
558 sf.setScore(score);
\r
560 if (groupLink != null && removeHTML)
\r
562 sf.addLink(groupLink);
\r
563 sf.description += "%LINK%";
\r
565 if (typeLink.containsKey(type) && removeHTML)
\r
567 sf.addLink(typeLink.get(type).toString());
\r
568 sf.description += "%LINK%";
\r
571 parseDescriptionHTML(sf, removeHTML);
\r
573 seq.addSequenceFeature(sf);
\r
575 while (seqId != null
\r
576 && (seq = align.findName(seq, seqId, false)) != null)
\r
578 seq.addSequenceFeature(new SequenceFeature(sf));
\r
580 // If we got here, its not a GFFFile
\r
585 } catch (Exception ex)
\r
587 System.out.println(line);
\r
588 System.out.println("Error parsing feature file: " + ex + "\n" + line);
\r
589 ex.printStackTrace(System.err);
\r
597 private AlignmentI lastmatchedAl = null;
\r
599 private SequenceIdMatcher matcher = null;
\r
602 * clear any temporary handles used to speed up ID matching
\r
604 private void resetMatcher()
\r
606 lastmatchedAl = null;
\r
610 private SequenceI findName(AlignmentI align, String seqId,
\r
611 boolean relaxedIdMatching)
\r
613 SequenceI match = null;
\r
614 if (relaxedIdMatching)
\r
616 if (lastmatchedAl != align)
\r
618 matcher = new SequenceIdMatcher(
\r
619 (lastmatchedAl = align).getSequencesArray());
\r
621 match = matcher.findIdMatch(seqId);
\r
625 match = align.findName(seqId, true);
\r
630 public void parseDescriptionHTML(SequenceFeature sf, boolean removeHTML)
\r
632 if (sf.getDescription() == null)
\r
638 && sf.getDescription().toUpperCase().indexOf("<HTML>") == -1)
\r
640 removeHTML = false;
\r
643 StringBuffer sb = new StringBuffer();
\r
644 StringTokenizer st = new StringTokenizer(sf.getDescription(), "<");
\r
645 String token, link;
\r
648 while (st.hasMoreElements())
\r
650 token = st.nextToken("&>");
\r
651 if (token.equalsIgnoreCase("html") || token.startsWith("/"))
\r
657 startTag = token.indexOf("<");
\r
661 tag = token.substring(startTag + 1);
\r
662 token = token.substring(0, startTag);
\r
665 if (tag != null && tag.toUpperCase().startsWith("A HREF="))
\r
667 if (token.length() > 0)
\r
671 link = tag.substring(tag.indexOf("\"") + 1, tag.length() - 1);
\r
672 String label = st.nextToken("<>");
\r
673 sf.addLink(label + "|" + link);
\r
674 sb.append(label + "%LINK%");
\r
676 else if (tag != null && tag.equalsIgnoreCase("br"))
\r
678 sb.append(newline);
\r
680 else if (token.startsWith("lt;"))
\r
682 sb.append("<" + token.substring(3));
\r
684 else if (token.startsWith("gt;"))
\r
686 sb.append(">" + token.substring(3));
\r
688 else if (token.startsWith("amp;"))
\r
690 sb.append("&" + token.substring(4));
\r
700 sf.description = sb.toString();
\r
706 * generate a features file for seqs includes non-pos features by default.
\r
709 * source of sequence features
\r
711 * hash of feature types and colours
\r
712 * @return features file contents
\r
714 public String printJalviewFormat(SequenceI[] seqs, Hashtable visible)
\r
716 return printJalviewFormat(seqs, visible, true, true);
\r
720 * generate a features file for seqs with colours from visible (if any)
\r
723 * source of features
\r
725 * hash of Colours for each feature type
\r
727 * when true only feature types in 'visible' will be output
\r
729 * indicates if non-positional features should be output (regardless
\r
730 * of group or type)
\r
731 * @return features file contents
\r
733 public String printJalviewFormat(SequenceI[] seqs, Hashtable visible,
\r
734 boolean visOnly, boolean nonpos)
\r
736 StringBuffer out = new StringBuffer();
\r
737 SequenceFeature[] next;
\r
738 boolean featuresGen = false;
\r
739 if (visOnly && !nonpos && (visible == null || visible.size() < 1))
\r
741 // no point continuing.
\r
742 return "No Features Visible";
\r
745 if (visible != null && visOnly)
\r
747 // write feature colours only if we're given them and we are generating
\r
749 // TODO: decide if feature links should also be written here ?
\r
750 Enumeration en = visible.keys();
\r
751 String type, color;
\r
752 while (en.hasMoreElements())
\r
754 type = en.nextElement().toString();
\r
756 if (visible.get(type) instanceof GraduatedColor)
\r
758 GraduatedColor gc = (GraduatedColor) visible.get(type);
\r
759 color = (gc.isColourByLabel() ? "label|" : "")
\r
760 + Format.getHexString(gc.getMinColor()) + "|"
\r
761 + Format.getHexString(gc.getMaxColor())
\r
762 + (gc.isAutoScale() ? "|" : "|abso|") + gc.getMin() + "|"
\r
763 + gc.getMax() + "|";
\r
764 if (gc.getThreshType() != AnnotationColourGradient.NO_THRESHOLD)
\r
766 if (gc.getThreshType() == AnnotationColourGradient.BELOW_THRESHOLD)
\r
772 if (gc.getThreshType() != AnnotationColourGradient.ABOVE_THRESHOLD)
\r
774 System.err.println("WARNING: Unsupported threshold type ("
\r
775 + gc.getThreshType() + ") : Assuming 'above'");
\r
780 color += "|" + gc.getThresh();
\r
787 else if (visible.get(type) instanceof java.awt.Color)
\r
789 color = Format.getHexString((java.awt.Color) visible.get(type));
\r
793 // legacy support for integer objects containing colour triplet values
\r
794 color = Format.getHexString(new java.awt.Color(Integer
\r
795 .parseInt(visible.get(type).toString())));
\r
800 out.append(newline);
\r
803 // Work out which groups are both present and visible
\r
804 Vector groups = new Vector();
\r
805 int groupIndex = 0;
\r
806 boolean isnonpos = false;
\r
808 for (int i = 0; i < seqs.length; i++)
\r
810 next = seqs[i].getSequenceFeatures();
\r
813 for (int j = 0; j < next.length; j++)
\r
815 isnonpos = next[j].begin == 0 && next[j].end == 0;
\r
816 if ((!nonpos && isnonpos)
\r
817 || (!isnonpos && visOnly && !visible
\r
818 .containsKey(next[j].type)))
\r
823 if (next[j].featureGroup != null
\r
824 && !groups.contains(next[j].featureGroup))
\r
826 groups.addElement(next[j].featureGroup);
\r
832 String group = null;
\r
836 if (groups.size() > 0 && groupIndex < groups.size())
\r
838 group = groups.elementAt(groupIndex).toString();
\r
839 out.append(newline);
\r
840 out.append("STARTGROUP\t");
\r
842 out.append(newline);
\r
849 for (int i = 0; i < seqs.length; i++)
\r
851 next = seqs[i].getSequenceFeatures();
\r
854 for (int j = 0; j < next.length; j++)
\r
856 isnonpos = next[j].begin == 0 && next[j].end == 0;
\r
857 if ((!nonpos && isnonpos)
\r
858 || (!isnonpos && visOnly && !visible
\r
859 .containsKey(next[j].type)))
\r
861 // skip if feature is nonpos and we ignore them or if we only
\r
862 // output visible and it isn't non-pos and it's not visible
\r
867 && (next[j].featureGroup == null || !next[j].featureGroup
\r
873 if (group == null && next[j].featureGroup != null)
\r
877 // we have features to output
\r
878 featuresGen = true;
\r
879 if (next[j].description == null
\r
880 || next[j].description.equals(""))
\r
882 out.append(next[j].type + "\t");
\r
886 if (next[j].links != null
\r
887 && next[j].getDescription().indexOf("<html>") == -1)
\r
889 out.append("<html>");
\r
892 out.append(next[j].description + " ");
\r
893 if (next[j].links != null)
\r
895 for (int l = 0; l < next[j].links.size(); l++)
\r
897 String label = next[j].links.elementAt(l).toString();
\r
898 String href = label.substring(label.indexOf("|") + 1);
\r
899 label = label.substring(0, label.indexOf("|"));
\r
901 if (next[j].description.indexOf(href) == -1)
\r
903 out.append("<a href=\"" + href + "\">" + label + "</a>");
\r
907 if (next[j].getDescription().indexOf("</html>") == -1)
\r
909 out.append("</html>");
\r
915 out.append(seqs[i].getName());
\r
916 out.append("\t-1\t");
\r
917 out.append(next[j].begin);
\r
919 out.append(next[j].end);
\r
921 out.append(next[j].type);
\r
922 if (next[j].score != Float.NaN)
\r
925 out.append(next[j].score);
\r
927 out.append(newline);
\r
934 out.append("ENDGROUP\t");
\r
936 out.append(newline);
\r
944 } while (groupIndex < groups.size() + 1);
\r
948 return "No Features Visible";
\r
951 return out.toString();
\r
955 * generate a gff file for sequence features includes non-pos features by
\r
962 public String printGFFFormat(SequenceI[] seqs, Hashtable visible)
\r
964 return printGFFFormat(seqs, visible, true, true);
\r
967 public String printGFFFormat(SequenceI[] seqs, Hashtable visible,
\r
968 boolean visOnly, boolean nonpos)
\r
970 StringBuffer out = new StringBuffer();
\r
971 SequenceFeature[] next;
\r
974 for (int i = 0; i < seqs.length; i++)
\r
976 if (seqs[i].getSequenceFeatures() != null)
\r
978 next = seqs[i].getSequenceFeatures();
\r
979 for (int j = 0; j < next.length; j++)
\r
981 isnonpos = next[j].begin == 0 && next[j].end == 0;
\r
982 if ((!nonpos && isnonpos)
\r
983 || (!isnonpos && visOnly && !visible
\r
984 .containsKey(next[j].type)))
\r
989 source = next[j].featureGroup;
\r
990 if (source == null)
\r
992 source = next[j].getDescription();
\r
995 out.append(seqs[i].getName());
\r
997 out.append(source);
\r
999 out.append(next[j].type);
\r
1001 out.append(next[j].begin);
\r
1003 out.append(next[j].end);
\r
1005 out.append(next[j].score);
\r
1008 if (next[j].getValue("STRAND") != null)
\r
1010 out.append(next[j].getValue("STRAND"));
\r
1015 out.append(".\t");
\r
1018 if (next[j].getValue("FRAME") != null)
\r
1020 out.append(next[j].getValue("FRAME"));
\r
1026 // TODO: verify/check GFF - should there be a /t here before attribute
\r
1029 if (next[j].getValue("ATTRIBUTES") != null)
\r
1031 out.append(next[j].getValue("ATTRIBUTES"));
\r
1034 out.append(newline);
\r
1040 return out.toString();
\r
1044 * this is only for the benefit of object polymorphism - method does nothing.
\r
1046 public void parse()
\r
1052 * this is only for the benefit of object polymorphism - method does nothing.
\r
1054 * @return error message
\r
1056 public String print()
\r
1058 return "USE printGFFFormat() or printJalviewFormat()";
\r