2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
23 import javax.xml.parsers.ParserConfigurationException;
\r
25 import org.xml.sax.SAXException;
\r
27 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
\r
28 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
\r
29 import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
\r
30 import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
\r
32 import jalview.analysis.SequenceIdMatcher;
\r
33 import jalview.datamodel.*;
\r
34 import jalview.schemes.*;
\r
35 import jalview.util.Format;
\r
38 * Parse and create Jalview Features files Detects GFF format features files and
\r
39 * parses. Does not implement standard print() - call specific printFeatures or
\r
40 * printGFF. Uses AlignmentI.findSequence(String id) to find the sequence object
\r
41 * for the features annotation - this normally works on an exact match.
\r
44 * @version $Revision$
\r
46 public class FeaturesFile extends AlignFile
\r
49 * work around for GFF interpretation bug where source string becomes
\r
50 * description rather than a group
\r
52 private boolean doGffSource = true;
\r
55 * Creates a new FeaturesFile object.
\r
57 public FeaturesFile()
\r
62 * Creates a new FeaturesFile object.
\r
69 * @throws IOException
\r
71 * @throws SAXException
\r
72 * @throws ParserConfigurationException
\r
73 * @throws ExceptionFileFormatOrSyntax
\r
74 * @throws ExceptionLoadingFailed
\r
75 * @throws ExceptionPermissionDenied
\r
76 * @throws InterruptedException
\r
77 * @throws ExceptionUnmatchedClosingParentheses
\r
79 public FeaturesFile(String inFile, String type) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
\r
81 super(inFile, type);
\r
84 public FeaturesFile(FileParse source) throws IOException, ExceptionFileFormatOrSyntax, ParserConfigurationException, SAXException, ExceptionPermissionDenied, ExceptionLoadingFailed, InterruptedException, ExceptionUnmatchedClosingParentheses
\r
90 * Parse GFF or sequence features file using case-independent matching, discarding URLs
\r
91 * @param align - alignment/dataset containing sequences that are to be annotated
\r
92 * @param colours - hashtable to store feature colour definitions
\r
93 * @param removeHTML - process html strings into plain text
\r
94 * @return true if features were added
\r
96 public boolean parse(AlignmentI align, Hashtable colours,
\r
99 return parse(align, colours, null, removeHTML, false);
\r
103 * Parse GFF or sequence features file optionally using case-independent matching, discarding URLs
\r
104 * @param align - alignment/dataset containing sequences that are to be annotated
\r
105 * @param colours - hashtable to store feature colour definitions
\r
106 * @param removeHTML - process html strings into plain text
\r
107 * @param relaxedIdmatching - when true, ID matches to compound sequence IDs are allowed
\r
108 * @return true if features were added
\r
110 public boolean parse(AlignmentI align,
\r
111 Map colours, boolean removeHTML, boolean relaxedIdMatching)
\r
113 return parse(align, colours, null, removeHTML, relaxedIdMatching);
\r
117 * Parse GFF or sequence features file optionally using case-independent matching
\r
118 * @param align - alignment/dataset containing sequences that are to be annotated
\r
119 * @param colours - hashtable to store feature colour definitions
\r
120 * @param featureLink - hashtable to store associated URLs
\r
121 * @param removeHTML - process html strings into plain text
\r
122 * @return true if features were added
\r
124 public boolean parse(AlignmentI align, Map colours,
\r
125 Map featureLink, boolean removeHTML)
\r
127 return parse(align, colours, featureLink, removeHTML, false);
\r
132 * Parse GFF or sequence features file
\r
133 * @param align - alignment/dataset containing sequences that are to be annotated
\r
134 * @param colours - hashtable to store feature colour definitions
\r
135 * @param featureLink - hashtable to store associated URLs
\r
136 * @param removeHTML - process html strings into plain text
\r
137 * @param relaxedIdmatching - when true, ID matches to compound sequence IDs are allowed
\r
138 * @return true if features were added
\r
140 public boolean parse(AlignmentI align,
\r
141 Map colours, Map featureLink, boolean removeHTML, boolean relaxedIdmatching)
\r
144 String line = null;
\r
147 SequenceI seq = null;
\r
148 String type, desc, token = null;
\r
150 int index, start, end;
\r
152 StringTokenizer st;
\r
153 SequenceFeature sf;
\r
154 String featureGroup = null, groupLink = null;
\r
155 Map typeLink = new Hashtable();
\r
157 * when true, assume GFF style features rather than Jalview style.
\r
159 boolean GFFFile = true;
\r
160 while ((line = nextLine()) != null)
\r
162 if (line.startsWith("#"))
\r
167 st = new StringTokenizer(line, "\t");
\r
168 if (st.countTokens() == 1)
\r
170 if (line.trim().equalsIgnoreCase("GFF"))
\r
172 // Start parsing file as if it might be GFF again.
\r
177 if (st.countTokens() > 1 && st.countTokens() < 4)
\r
180 type = st.nextToken();
\r
181 if (type.equalsIgnoreCase("startgroup"))
\r
183 featureGroup = st.nextToken();
\r
184 if (st.hasMoreElements())
\r
186 groupLink = st.nextToken();
\r
187 featureLink.put(featureGroup, groupLink);
\r
190 else if (type.equalsIgnoreCase("endgroup"))
\r
192 // We should check whether this is the current group,
\r
193 // but at present theres no way of showing more than 1 group
\r
195 featureGroup = null;
\r
200 Object colour = null;
\r
201 String colscheme = st.nextToken();
\r
202 if (colscheme.indexOf("|") > -1
\r
203 || colscheme.trim().equalsIgnoreCase("label"))
\r
205 // Parse '|' separated graduated colourscheme fields:
\r
206 // [label|][mincolour|maxcolour|[absolute|]minvalue|maxvalue|thresholdtype|thresholdvalue]
\r
207 // can either provide 'label' only, first is optional, next two
\r
208 // colors are required (but may be
\r
209 // left blank), next is optional, nxt two min/max are required.
\r
210 // first is either 'label'
\r
211 // first/second and third are both hexadecimal or word equivalent
\r
213 // next two are values parsed as floats.
\r
214 // fifth is either 'above','below', or 'none'.
\r
215 // sixth is a float value and only required when fifth is either
\r
216 // 'above' or 'below'.
\r
217 StringTokenizer gcol = new StringTokenizer(colscheme, "|",
\r
220 int threshtype = AnnotationColourGradient.NO_THRESHOLD;
\r
221 float min = Float.MIN_VALUE, max = Float.MAX_VALUE, threshval = Float.NaN;
\r
222 boolean labelCol = false;
\r
224 String mincol = gcol.nextToken();
\r
228 .println("Expected either 'label' or a colour specification in the line: "
\r
232 String maxcol = null;
\r
233 if (mincol.toLowerCase().indexOf("label") == 0)
\r
236 mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); // skip
\r
238 mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null);
\r
240 String abso = null, minval, maxval;
\r
241 if (mincol != null)
\r
243 // at least four more tokens
\r
244 if (mincol.equals("|"))
\r
250 gcol.nextToken(); // skip next '|'
\r
252 // continue parsing rest of line
\r
253 maxcol = gcol.nextToken();
\r
254 if (maxcol.equals("|"))
\r
260 gcol.nextToken(); // skip next '|'
\r
262 abso = gcol.nextToken();
\r
263 gcol.nextToken(); // skip next '|'
\r
264 if (abso.toLowerCase().indexOf("abso") != 0)
\r
271 minval = gcol.nextToken();
\r
272 gcol.nextToken(); // skip next '|'
\r
274 maxval = gcol.nextToken();
\r
275 if (gcol.hasMoreTokens())
\r
277 gcol.nextToken(); // skip next '|'
\r
281 if (minval.length() > 0)
\r
283 min = new Float(minval).floatValue();
\r
285 } catch (Exception e)
\r
288 .println("Couldn't parse the minimum value for graduated colour for type ("
\r
290 + ") - did you misspell 'auto' for the optional automatic colour switch ?");
\r
291 e.printStackTrace();
\r
295 if (maxval.length() > 0)
\r
297 max = new Float(maxval).floatValue();
\r
299 } catch (Exception e)
\r
302 .println("Couldn't parse the maximum value for graduated colour for type ("
\r
303 + colscheme + ")");
\r
304 e.printStackTrace();
\r
309 // add in some dummy min/max colours for the label-only
\r
316 colour = new jalview.schemes.GraduatedColor(
\r
317 new UserColourScheme(mincol).findColour('A'),
\r
318 new UserColourScheme(maxcol).findColour('A'), min,
\r
320 } catch (Exception e)
\r
323 .println("Couldn't parse the graduated colour scheme ("
\r
324 + colscheme + ")");
\r
325 e.printStackTrace();
\r
327 if (colour != null)
\r
329 ((jalview.schemes.GraduatedColor) colour)
\r
330 .setColourByLabel(labelCol);
\r
331 ((jalview.schemes.GraduatedColor) colour)
\r
332 .setAutoScaled(abso == null);
\r
333 // add in any additional parameters
\r
334 String ttype = null, tval = null;
\r
335 if (gcol.hasMoreTokens())
\r
337 // threshold type and possibly a threshold value
\r
338 ttype = gcol.nextToken();
\r
339 if (ttype.toLowerCase().startsWith("below"))
\r
341 ((jalview.schemes.GraduatedColor) colour)
\r
342 .setThreshType(AnnotationColourGradient.BELOW_THRESHOLD);
\r
344 else if (ttype.toLowerCase().startsWith("above"))
\r
346 ((jalview.schemes.GraduatedColor) colour)
\r
347 .setThreshType(AnnotationColourGradient.ABOVE_THRESHOLD);
\r
351 ((jalview.schemes.GraduatedColor) colour)
\r
352 .setThreshType(AnnotationColourGradient.NO_THRESHOLD);
\r
353 if (!ttype.toLowerCase().startsWith("no"))
\r
356 .println("Ignoring unrecognised threshold type : "
\r
361 if (((GraduatedColor) colour).getThreshType() != AnnotationColourGradient.NO_THRESHOLD)
\r
366 tval = gcol.nextToken();
\r
367 ((jalview.schemes.GraduatedColor) colour)
\r
368 .setThresh(new Float(tval).floatValue());
\r
369 } catch (Exception e)
\r
372 .println("Couldn't parse threshold value as a float: ("
\r
374 e.printStackTrace();
\r
377 // parse the thresh-is-min token ?
\r
378 if (gcol.hasMoreTokens())
\r
381 .println("Ignoring additional tokens in parameters in graduated colour specification\n");
\r
382 while (gcol.hasMoreTokens())
\r
384 System.err.println("|" + gcol.nextToken());
\r
386 System.err.println("\n");
\r
392 UserColourScheme ucs = new UserColourScheme(colscheme);
\r
393 colour = ucs.findColour('A');
\r
395 if (colour != null)
\r
397 colours.put(type, colour);
\r
399 if (st.hasMoreElements())
\r
401 String link = st.nextToken();
\r
402 typeLink.put(type, link);
\r
403 if (featureLink == null)
\r
405 featureLink = new Hashtable();
\r
407 featureLink.put(type, link);
\r
413 while (st.hasMoreElements())
\r
418 // Still possible this is an old Jalview file,
\r
419 // which does not have type colours at the beginning
\r
420 seqId = token = st.nextToken();
\r
421 seq = findName(align, seqId, relaxedIdmatching);
\r
424 desc = st.nextToken();
\r
425 String group = null;
\r
426 if (doGffSource && desc.indexOf(' ') == -1)
\r
428 // could also be a source term rather than description line
\r
429 group = new String(desc);
\r
431 type = st.nextToken();
\r
434 String stt = st.nextToken();
\r
435 if (stt.length() == 0 || stt.equals("-"))
\r
441 start = Integer.parseInt(stt);
\r
443 } catch (NumberFormatException ex)
\r
449 String stt = st.nextToken();
\r
450 if (stt.length() == 0 || stt.equals("-"))
\r
456 end = Integer.parseInt(stt);
\r
458 } catch (NumberFormatException ex)
\r
462 // TODO: decide if non positional feature assertion for input data
\r
463 // where end==0 is generally valid
\r
466 // treat as non-positional feature, regardless.
\r
471 score = new Float(st.nextToken()).floatValue();
\r
472 } catch (NumberFormatException ex)
\r
477 sf = new SequenceFeature(type, desc, start, end, score, group);
\r
481 sf.setValue("STRAND", st.nextToken());
\r
482 sf.setValue("FRAME", st.nextToken());
\r
483 } catch (Exception ex)
\r
487 if (st.hasMoreTokens())
\r
489 StringBuffer attributes = new StringBuffer();
\r
490 while (st.hasMoreTokens())
\r
492 attributes.append("\t" + st.nextElement());
\r
494 // TODO validate and split GFF2 attributes field ? parse out
\r
495 // ([A-Za-z][A-Za-z0-9_]*) <value> ; and add as
\r
496 // sf.setValue(attrib, val);
\r
497 sf.setValue("ATTRIBUTES", attributes.toString());
\r
500 seq.addSequenceFeature(sf);
\r
501 while ((seq = align.findName(seq, seqId, true)) != null)
\r
503 seq.addSequenceFeature(new SequenceFeature(sf));
\r
509 if (GFFFile && seq == null)
\r
515 desc = st.nextToken();
\r
517 if (!st.hasMoreTokens())
\r
520 .println("DEBUG: Run out of tokens when trying to identify the destination for the feature.. giving up.");
\r
521 // in all probability, this isn't a file we understand, so bail
\r
526 token = st.nextToken();
\r
528 if (!token.equals("ID_NOT_SPECIFIED"))
\r
530 seq = findName(align, seqId = token, relaxedIdmatching);
\r
538 index = Integer.parseInt(st.nextToken());
\r
539 seq = align.getSequenceAt(index);
\r
540 } catch (NumberFormatException ex)
\r
548 System.out.println("Sequence not found: " + line);
\r
552 start = Integer.parseInt(st.nextToken());
\r
553 end = Integer.parseInt(st.nextToken());
\r
555 type = st.nextToken();
\r
557 if (!colours.containsKey(type))
\r
559 // Probably the old style groups file
\r
560 UserColourScheme ucs = new UserColourScheme(type);
\r
561 colours.put(type, ucs.findColour('A'));
\r
563 sf = new SequenceFeature(type, desc, "", start, end, featureGroup);
\r
564 if (st.hasMoreTokens())
\r
568 score = new Float(st.nextToken()).floatValue();
\r
569 // update colourgradient bounds if allowed to
\r
570 } catch (NumberFormatException ex)
\r
574 sf.setScore(score);
\r
576 if (groupLink != null && removeHTML)
\r
578 sf.addLink(groupLink);
\r
579 sf.description += "%LINK%";
\r
581 if (typeLink.containsKey(type) && removeHTML)
\r
583 sf.addLink(typeLink.get(type).toString());
\r
584 sf.description += "%LINK%";
\r
587 parseDescriptionHTML(sf, removeHTML);
\r
589 seq.addSequenceFeature(sf);
\r
591 while (seqId != null
\r
592 && (seq = align.findName(seq, seqId, false)) != null)
\r
594 seq.addSequenceFeature(new SequenceFeature(sf));
\r
596 // If we got here, its not a GFFFile
\r
601 } catch (Exception ex)
\r
603 System.out.println(line);
\r
604 System.out.println("Error parsing feature file: " + ex + "\n" + line);
\r
605 ex.printStackTrace(System.err);
\r
613 private AlignmentI lastmatchedAl = null;
\r
615 private SequenceIdMatcher matcher = null;
\r
618 * clear any temporary handles used to speed up ID matching
\r
620 private void resetMatcher()
\r
622 lastmatchedAl = null;
\r
626 private SequenceI findName(AlignmentI align, String seqId,
\r
627 boolean relaxedIdMatching)
\r
629 SequenceI match = null;
\r
630 if (relaxedIdMatching)
\r
632 if (lastmatchedAl != align)
\r
634 matcher = new SequenceIdMatcher(
\r
635 (lastmatchedAl = align).getSequencesArray());
\r
637 match = matcher.findIdMatch(seqId);
\r
641 match = align.findName(seqId, true);
\r
646 public void parseDescriptionHTML(SequenceFeature sf, boolean removeHTML)
\r
648 if (sf.getDescription() == null)
\r
652 jalview.util.ParseHtmlBodyAndLinks parsed = new jalview.util.ParseHtmlBodyAndLinks(sf.getDescription(), removeHTML, newline);
\r
654 sf.description = (removeHTML) ? parsed.getNonHtmlContent() : sf.description;
\r
655 for (String link:parsed.getLinks())
\r
663 * generate a features file for seqs includes non-pos features by default.
\r
666 * source of sequence features
\r
668 * hash of feature types and colours
\r
669 * @return features file contents
\r
671 public String printJalviewFormat(SequenceI[] seqs, Hashtable visible)
\r
673 return printJalviewFormat(seqs, visible, true, true);
\r
677 * generate a features file for seqs with colours from visible (if any)
\r
680 * source of features
\r
682 * hash of Colours for each feature type
\r
684 * when true only feature types in 'visible' will be output
\r
686 * indicates if non-positional features should be output (regardless
\r
687 * of group or type)
\r
688 * @return features file contents
\r
690 public String printJalviewFormat(SequenceI[] seqs, Hashtable visible,
\r
691 boolean visOnly, boolean nonpos)
\r
693 StringBuffer out = new StringBuffer();
\r
694 SequenceFeature[] next;
\r
695 boolean featuresGen = false;
\r
696 if (visOnly && !nonpos && (visible == null || visible.size() < 1))
\r
698 // no point continuing.
\r
699 return "No Features Visible";
\r
702 if (visible != null && visOnly)
\r
704 // write feature colours only if we're given them and we are generating
\r
706 // TODO: decide if feature links should also be written here ?
\r
707 Enumeration en = visible.keys();
\r
708 String type, color;
\r
709 while (en.hasMoreElements())
\r
711 type = en.nextElement().toString();
\r
713 if (visible.get(type) instanceof GraduatedColor)
\r
715 GraduatedColor gc = (GraduatedColor) visible.get(type);
\r
716 color = (gc.isColourByLabel() ? "label|" : "")
\r
717 + Format.getHexString(gc.getMinColor()) + "|"
\r
718 + Format.getHexString(gc.getMaxColor())
\r
719 + (gc.isAutoScale() ? "|" : "|abso|") + gc.getMin() + "|"
\r
720 + gc.getMax() + "|";
\r
721 if (gc.getThreshType() != AnnotationColourGradient.NO_THRESHOLD)
\r
723 if (gc.getThreshType() == AnnotationColourGradient.BELOW_THRESHOLD)
\r
729 if (gc.getThreshType() != AnnotationColourGradient.ABOVE_THRESHOLD)
\r
731 System.err.println("WARNING: Unsupported threshold type ("
\r
732 + gc.getThreshType() + ") : Assuming 'above'");
\r
737 color += "|" + gc.getThresh();
\r
744 else if (visible.get(type) instanceof java.awt.Color)
\r
746 color = Format.getHexString((java.awt.Color) visible.get(type));
\r
750 // legacy support for integer objects containing colour triplet values
\r
751 color = Format.getHexString(new java.awt.Color(Integer
\r
752 .parseInt(visible.get(type).toString())));
\r
757 out.append(newline);
\r
760 // Work out which groups are both present and visible
\r
761 Vector groups = new Vector();
\r
762 int groupIndex = 0;
\r
763 boolean isnonpos = false;
\r
765 for (int i = 0; i < seqs.length; i++)
\r
767 next = seqs[i].getSequenceFeatures();
\r
770 for (int j = 0; j < next.length; j++)
\r
772 isnonpos = next[j].begin == 0 && next[j].end == 0;
\r
773 if ((!nonpos && isnonpos)
\r
774 || (!isnonpos && visOnly && !visible
\r
775 .containsKey(next[j].type)))
\r
780 if (next[j].featureGroup != null
\r
781 && !groups.contains(next[j].featureGroup))
\r
783 groups.addElement(next[j].featureGroup);
\r
789 String group = null;
\r
793 if (groups.size() > 0 && groupIndex < groups.size())
\r
795 group = groups.elementAt(groupIndex).toString();
\r
796 out.append(newline);
\r
797 out.append("STARTGROUP\t");
\r
799 out.append(newline);
\r
806 for (int i = 0; i < seqs.length; i++)
\r
808 next = seqs[i].getSequenceFeatures();
\r
811 for (int j = 0; j < next.length; j++)
\r
813 isnonpos = next[j].begin == 0 && next[j].end == 0;
\r
814 if ((!nonpos && isnonpos)
\r
815 || (!isnonpos && visOnly && !visible
\r
816 .containsKey(next[j].type)))
\r
818 // skip if feature is nonpos and we ignore them or if we only
\r
819 // output visible and it isn't non-pos and it's not visible
\r
824 && (next[j].featureGroup == null || !next[j].featureGroup
\r
830 if (group == null && next[j].featureGroup != null)
\r
834 // we have features to output
\r
835 featuresGen = true;
\r
836 if (next[j].description == null
\r
837 || next[j].description.equals(""))
\r
839 out.append(next[j].type + "\t");
\r
843 if (next[j].links != null
\r
844 && next[j].getDescription().indexOf("<html>") == -1)
\r
846 out.append("<html>");
\r
849 out.append(next[j].description + " ");
\r
850 if (next[j].links != null)
\r
852 for (int l = 0; l < next[j].links.size(); l++)
\r
854 String label = next[j].links.elementAt(l).toString();
\r
855 String href = label.substring(label.indexOf("|") + 1);
\r
856 label = label.substring(0, label.indexOf("|"));
\r
858 if (next[j].description.indexOf(href) == -1)
\r
860 out.append("<a href=\"" + href + "\">" + label + "</a>");
\r
864 if (next[j].getDescription().indexOf("</html>") == -1)
\r
866 out.append("</html>");
\r
872 out.append(seqs[i].getName());
\r
873 out.append("\t-1\t");
\r
874 out.append(next[j].begin);
\r
876 out.append(next[j].end);
\r
878 out.append(next[j].type);
\r
879 if (next[j].score != Float.NaN)
\r
882 out.append(next[j].score);
\r
884 out.append(newline);
\r
891 out.append("ENDGROUP\t");
\r
893 out.append(newline);
\r
901 } while (groupIndex < groups.size() + 1);
\r
905 return "No Features Visible";
\r
908 return out.toString();
\r
912 * generate a gff file for sequence features includes non-pos features by
\r
919 public String printGFFFormat(SequenceI[] seqs, Hashtable visible)
\r
921 return printGFFFormat(seqs, visible, true, true);
\r
924 public String printGFFFormat(SequenceI[] seqs, Hashtable visible,
\r
925 boolean visOnly, boolean nonpos)
\r
927 StringBuffer out = new StringBuffer();
\r
928 SequenceFeature[] next;
\r
931 for (int i = 0; i < seqs.length; i++)
\r
933 if (seqs[i].getSequenceFeatures() != null)
\r
935 next = seqs[i].getSequenceFeatures();
\r
936 for (int j = 0; j < next.length; j++)
\r
938 isnonpos = next[j].begin == 0 && next[j].end == 0;
\r
939 if ((!nonpos && isnonpos)
\r
940 || (!isnonpos && visOnly && !visible
\r
941 .containsKey(next[j].type)))
\r
946 source = next[j].featureGroup;
\r
947 if (source == null)
\r
949 source = next[j].getDescription();
\r
952 out.append(seqs[i].getName());
\r
954 out.append(source);
\r
956 out.append(next[j].type);
\r
958 out.append(next[j].begin);
\r
960 out.append(next[j].end);
\r
962 out.append(next[j].score);
\r
965 if (next[j].getValue("STRAND") != null)
\r
967 out.append(next[j].getValue("STRAND"));
\r
975 if (next[j].getValue("FRAME") != null)
\r
977 out.append(next[j].getValue("FRAME"));
\r
983 // TODO: verify/check GFF - should there be a /t here before attribute
\r
986 if (next[j].getValue("ATTRIBUTES") != null)
\r
988 out.append(next[j].getValue("ATTRIBUTES"));
\r
991 out.append(newline);
\r
997 return out.toString();
\r
1001 * this is only for the benefit of object polymorphism - method does nothing.
\r
1003 public void parse()
\r
1009 * this is only for the benefit of object polymorphism - method does nothing.
\r
1011 * @return error message
\r
1013 public String print()
\r
1015 return "USE printGFFFormat() or printJalviewFormat()";
\r