Skip to contents

Return the entire GenBank record for an accession ID. Equivalent to rettype='gb' in rentrez::entrez_fetch().

Usage

gb_record_get(id)

Arguments

id

character, sequence accession ID(s)

Value

named vector of records, if no results found NULL

Examples

library(restez)
restez_path_set(filepath = tempdir())
#> ... Creating '/tmp/RtmpTAsqCl/restez'
#> ... Creating '/tmp/RtmpTAsqCl/restez/downloads'
demo_db_create(n = 5)
(rec <- gb_record_get(id = 'demo_1'))
#>                                                                                                                                                                                                                                                                                                                                                                                                 demo_1 
#> "LOCUS       [This is a mock GenBank data record]\nDEFINITION  A demonstration sequence | id demo_1\nACCESSION   demo_1\nVERSION     1\nKEYWORDS    [keyword]\nSOURCE      [tissue, organism]\nORGANISM    Unreal organism 1\nREFERENCE   [reference data]\nAUTHORS     [all the authors]\nTITLE       [title]\nJOURNAL     [journal]\nFEATURES    [features]\n\nORIGIN      \n        1 accttcgact\n" 
(recs <- gb_record_get(id = c('demo_1', 'demo_2')))
#>                                                                                                                                                                                                                                                                                                                                                                                                 demo_1 
#> "LOCUS       [This is a mock GenBank data record]\nDEFINITION  A demonstration sequence | id demo_1\nACCESSION   demo_1\nVERSION     1\nKEYWORDS    [keyword]\nSOURCE      [tissue, organism]\nORGANISM    Unreal organism 1\nREFERENCE   [reference data]\nAUTHORS     [all the authors]\nTITLE       [title]\nJOURNAL     [journal]\nFEATURES    [features]\n\nORIGIN      \n        1 accttcgact\n" 
#>                                                                                                                                                                                                                                                                                                                                                                                                 demo_2 
#> "LOCUS       [This is a mock GenBank data record]\nDEFINITION  A demonstration sequence | id demo_2\nACCESSION   demo_2\nVERSION     3\nKEYWORDS    [keyword]\nSOURCE      [tissue, organism]\nORGANISM    Unreal organism 2\nREFERENCE   [reference data]\nAUTHORS     [all the authors]\nTITLE       [title]\nJOURNAL     [journal]\nFEATURES    [features]\n\nORIGIN      \n        1 aactccccga\n" 


# delete demo after example
db_delete(everything = TRUE)