I/O
Input
Annotation files are read with GenBank.Reader and GFF.Reader. Currently these assume that the file follows either standard GenBank format, or GFF3. Any metadata in GFF3 files, apart from the header, is ignored.
open(GenBank.Reader, "example.gbk") do reader
for record in reader
do_something()
end
endreadgbk(input) and readgff(input) are aliases for collect(open(GenBank.Reader, input)) and collect(open(GFF.Reader, input)), respectively.
GenomicAnnotations.GenBank.Reader — TypeGenBank.Reader(input::IO)Create a data reader of the GenBank file format.
open(GenBank.Reader, "test/example.gbk") do records
for record in record
print(record)
end
endGenomicAnnotations.GFF.Reader — TypeGFF.Reader(input::IO)Create a data reader of the GFF3 file format.
Output
Annotations can be printed with GenBank formatting using GenBank.Writer, and as GFF3 with GFF.Writer. Headers are not automatically converted between formats; GFF.Writer only prints the header of the first Record, and only if it starts with a #, while GenBank.Writer prints a default header if the stored one starts with #.
GenomicAnnotations.GenBank.Writer — TypeGenBank.Writer(output::IO; width=70)Create a data writer of the GenBank file format.
open(GenBank.Writer, outfile) do writer
write(writer, genome)
endGenomicAnnotations.GFF.Writer — TypeGFF.Writer(output::IO; width=70)Create a data writer of the GFF file format.
open(GFF.Writer, outfile) do writer
write(writer, genome)
endIn the REPL, instances of Gene are displayed as they would be in the annotation file.