fetch_gene: Extract a gene sequence from a genbank file

fetch_geneR Documentation

Extract a gene sequence from a genbank file

Description

If duplicates are detected via 'detect_dups' and 'rename' is TRUE, duplicates will be differentiated by appending a numeral to the name, e.g. "accession-gene-1", "accession-gene-2", etc.

Usage

fetch_gene(gene_name, rec, rename = TRUE, detect_dups = TRUE)

Arguments

gene_name

Name of gene to extract. Must match genbank data exactly, case-sensitive.

rec

An instance of the gbRecord class. Typically a (sub)genome containing the gene of interest.

rename

Logical; should the sequence be renamed as "accession-gene"?

detect_dups

Logical; should duplicates be detected? If TRUE, a text warning will be returned in the case that this gene has duplicate copies in the genome; if false, all copies will be returned.

Details

See https://github.com/gschofl/biofiles

Value

object of class DNAbin

Examples

## Not run: 
gb_file <- reutils::efetch(uid = "KY427346", db = "nuccore",
  rettype = "gbwithparts", retmode = "text")
# Parse GenBank record text file
this_rec <- biofiles::gbRecord(gb_file)
fetch_gene("rbcL", this_rec)

## End(Not run)


joelnitta/gbfetch documentation built on March 2, 2024, 7:03 p.m.