This function reads a GenBank file, extracts the sequence and writes it to a new file in FASTA format. It parses the DEFINITION and VERSION for the header and sequences from the ORIGIN section.
Arguments
- path
Path to the GenBank file.
- output_dir
Optional path for the output FASTA file. If NULL, the output is saved in the same directory as the input file with the same base name but with a .fasta extension.
Examples
# \donttest{
# Path to the example GenBank file in the package
gbk_file <- system.file("extdata", "BGC0000001.gbk", package = "geneviewer")
# Convert the GenBank file to FASTA format
genbank_to_fasta(gbk_file)
# }