getNCBIGenesInfo: Get NCBI genes information

Description Usage Arguments Details Value Author(s) References Examples

View source: R/getNCBI.R

Description

NCBI Database API - Get NCBI gene or protein information from given NCBI gene IDs

Usage

1
getNCBIGenesInfo(NCBIGeneIDs, type = "gene", n = 1, maxEach = 10000)

Arguments

NCBIGeneIDs

A vector of NCBI gene or protein IDs.

type

Character string either "protein", "gene", "nuccore".

n

The number of CPUs or processors, and the default value is 1.

maxEach

The maximum retrieve number in each visit. The ESearch, EFetch, and ESummary, the max number in one query is 10,000.

Details

Get NCBI gene information, including gene name, description, genetic source, aliases, gene location. To retrieve thousands of proteins, use EPost to post record into the web server and then retrieve data using ESummary. If the gene ID is not found, return an error information in the list.

Value

A list containing gene information for each ID. A empty character vector (whose length is 0) will be returned for the items if the contents are not found.

Author(s)

Yulong Niu niuylscu@gmail.com

References

Entrez Programming Utilities Help http://www.ncbi.nlm.nih.gov/books/NBK25499/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
gene3 <- getNCBIGenesInfo(c('100286922', '948242', '15486644'), type = 'gene', n = 2)
protein2 <- getNCBIGenesInfo(c('WP_084863515', 'BAI64724'), type = 'protein', n = 2)
nuc3 <- getNCBIGenesInfo(c('AF538355.1', 'AY560609.1', 'CP048101.1'), type = 'nuccore')
## not found
ghostInfo <- getNCBIGenesInfo('111111111', n = 1)
## Not run: 
require(KEGGAPI)
## signle genome with two plasmids
smuGenes <- convKEGG('smu', 'ncbi-geneid')
smuGeneNames <- sapply(strsplit(smuGenes[, 1], split = ':', fixed = TRUE), '[[', 2)
smuInfo <- getNCBIGenesInfo(smuGeneNames, n = 4)

## two genomes with two plasmids
draGenes <- convKEGG('dra', 'ncbi-geneid')
draGeneNames <- sapply(strsplit(draGenes[, 1], split = ':', fixed = TRUE), '[[', 2)
draInfo <- getNCBIGenesInfo(draGeneNames, n = 4)

## End(Not run)

YulongNiu/NCBIAPI documentation built on Nov. 22, 2021, 3:25 a.m.