Get sequence and definition data in FASTA format. Equivalent to rettype='fasta' in entrez_fetch.

gb_fasta_get(id, width = 70)

Arguments

id

character, sequence accession ID(s)

width

integer, maximum number of characters in a line

Value

named vector of fasta sequences, if no results found NULL

See also

Examples

library(restez) restez_path_set(filepath = tempdir())
#> ... Creating '/var/folders/ps/g89999v12490dmp0jnsfmykm0043m3/T//Rtmp6jFXFa/restez' #> ... Creating '/var/folders/ps/g89999v12490dmp0jnsfmykm0043m3/T//Rtmp6jFXFa/restez/downloads'
#> Remember to run `restez_disconnect()`
(fasta <- gb_fasta_get(id = 'demo_1'))
#> demo_1 #> ">demo_1.1 A demonstration sequence | id demo_1\nTTCCGTCACG\n\n"
(fastas <- gb_fasta_get(id = c('demo_1', 'demo_2')))
#> demo_1 #> ">demo_1.1 A demonstration sequence | id demo_1\nTTCCGTCACG\n\n" #> demo_2 #> ">demo_2.1 A demonstration sequence | id demo_2\nCGCGTGCTAA\n\n"
# delete demo after example db_delete(everything = TRUE)