Learn R Programming

geneviewer (version 0.1.10)

genbank_to_fasta: 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)

Value

None explicitly, but writes the FASTA formatted data to a file.

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

Run this code
# \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)
# }


Run the code above in your browser using DataLab