genbank_to_fasta {geneviewer} | R Documentation |
Convert GenBank to FASTA Format
Description
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.
Usage
genbank_to_fasta(path, output_dir = NULL)
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. |
Value
None explicitly, but writes the FASTA formatted data to a file.
Examples
# 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)
[Package geneviewer version 0.1.10 Index]