Skip to contents

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

Usage

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

Examples

library(restez)
restez_path_set(filepath = tempdir())
#> ... Creating '/tmp/RtmpoytYpe/restez'
#> ... Creating '/tmp/RtmpoytYpe/restez/downloads'
demo_db_create(n = 5)
(fasta <- gb_fasta_get(id = 'demo_1'))
#>                                                           demo_1 
#> ">demo_1.4 A demonstration sequence | id demo_1\nCTTCGTTTAA\n\n" 
(fastas <- gb_fasta_get(id = c('demo_1', 'demo_2')))
#>                                                           demo_1 
#> ">demo_1.4 A demonstration sequence | id demo_1\nCTTCGTTTAA\n\n" 
#>                                                           demo_2 
#> ">demo_2.4 A demonstration sequence | id demo_2\nCAGGTAACGA\n\n" 


# delete demo after example
db_delete(everything = TRUE)