ncbi_acc_get: Get accession numbers by querying NCBI GenBank

View source: R/db-setup-tools.R

ncbi_acc_getR Documentation

Get accession numbers by querying NCBI GenBank

Description

The query string can be formatted using GenBank advanced query terms to obtain accession numbers corresponding to a specific set of criteria.

Usage

ncbi_acc_get(query, strict = TRUE, drop_ver = TRUE)

Arguments

query

Character vector of length 1; query string to search GenBank.

strict

Logical vector of length 1; should an error be issued if the number of unique accessions retrieved does not match the number of hits from GenBank? Default TRUE.

drop_ver

Logical vector of length 1; should the version part of the accession number (e.g., '.1' in 'AB001538.1') be dropped? Default TRUE.

Details

Note this queries NCBI GenBank, not the local database generated with restez.

It can be used either to restrict the accessions used to construct the local database (acc_filter argument of db_create()) or to specify accessions to read from the local database (id argument of gb_fasta_get() and other gb_*_get() functions).

Value

Character vector; accession numbers resulting from query.

See Also

db_create(), gb_fasta_get()

Examples

## Not run: 
  # requires an internet connection
  cmin_accs <- ncbi_acc_get("Crepidomanes minutum")
  length(cmin_accs)
  head(cmin_accs)

## End(Not run)

restez documentation built on Oct. 25, 2023, 5:06 p.m.