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
end

readgbk(input) and readgff(input) are aliases for collect(open(GenBank.Reader, input)) and collect(open(GFF.Reader, input)), respectively.

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.WriterType
GenBank.Writer(output::IO; width=70)

Create a data writer of the GenBank file format.

open(GenBank.Writer, outfile) do writer
    write(writer, genome)
end
source
GenomicAnnotations.GFF.WriterType
GFF.Writer(output::IO; width=70)

Create a data writer of the GFF file format.

open(GFF.Writer, outfile) do writer
    write(writer, genome)
end
source

In the REPL, instances of Gene are displayed as they would be in the annotation file.