Package htsjdk.tribble.gff
Class Gff3Writer
java.lang.Object
htsjdk.tribble.gff.Gff3Writer
- All Implemented Interfaces:
Closeable
,AutoCloseable
A class to write out gff3 files. Features are added using
addFeature(Gff3Feature)
, directives using addDirective(Gff3Codec.Gff3Directive)
,
and comments using addComment(String)
. Note that the version 3 directive is automatically added at creation, so should not be added separately.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addComment
(String comment) Add comment linevoid
addDirective
(Gff3Codec.Gff3Directive directive) Add a directivevoid
addDirective
(Gff3Codec.Gff3Directive directive, Object object) Add a directive with an objectvoid
addFeature
(Gff3Feature feature) add a featurevoid
close()
protected String
escape a String.
-
Constructor Details
-
Gff3Writer
- Throws:
IOException
-
Gff3Writer
-
-
Method Details
-
addFeature
add a feature- Parameters:
feature
- the feature to be added- Throws:
IOException
-
escapeString
escape a String. Default behavior is to callencodeString(String)
- Parameters:
s
- the string to be escaped- Returns:
- the escaped string
-
addDirective
Add a directive with an object- Parameters:
directive
- the directive to be addedobject
- the object to be encoded with the directive- Throws:
IOException
-
addDirective
Add a directive- Parameters:
directive
- the directive to be added- Throws:
IOException
-
addComment
Add comment line- Parameters:
comment
- the comment line (not including leading #)- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-