Return a vector of all IDs in a database.

list_db_ids(db = "nucleotide", n = 100)

Arguments

db

character, database name

n

Maximum number of IDs to return, if NULL returns all

Value

vector of characters

Details

Warning: can return very large vectors for large databases.

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'
demo_db_create(n = 5) # Warning: not recommended for real databases # with potentially millions of IDs restez_connect()
#> Remember to run `restez_disconnect()`
all_ids <- list_db_ids()
#> Warning: Number of ids returned was limited to [100]. #> Set `n=NULL` to return all ids.
# What shall we do with these IDs? # ... how about make a mock fasta file seqs <- gb_sequence_get(id = all_ids) defs <- gb_definition_get(id = all_ids) # paste together fasta_seqs <- paste0('>', defs, '\n', seqs) fasta_file <- paste0(fasta_seqs, collapse = '\n') cat(fasta_file)
#> >A demonstration sequence | id demo_1 #> CTGCTGGACA #> >A demonstration sequence | id demo_2 #> CCAGGTCGTT #> >A demonstration sequence | id demo_3 #> AATACGCTCT #> >A demonstration sequence | id demo_4 #> CTGGATCTCC #> >A demonstration sequence | id demo_5 #> AGAGCGTTTG
# delete after example db_delete(everything = TRUE)