read.gb: Opens files with .gb extensions

Description Usage Arguments Value Examples

View source: R/read.gb.R

Description

This function opens complete record(s) with .gb extension from the NCBI/GenBank Nucleotide database and returns a list containing shaped record(s). These kind of files contains detailed records of DNA samples (locus, organism, type of sequence, source of the sequence...). An example of record can be found at https://www.ncbi.nlm.nih.gov/nuccore/HE799070. Records with > 200'000 bp may experience long processing times, especially if they have numerous FEATURES items. Also works for reports obtained with rentrez package.

Usage

1
read.gb(x, DNA = TRUE, Type = "full", Source = "File")

Arguments

x

character. The name of the file which the data are to be read from, or the character string containing the data. It can contains several records

DNA

logical. If TRUE, the DNA sequence in the ORIGIN part will be merged in one character string. If FALSE, the default layout will be kept. Default if TRUE

Type

character. Should the output contain FEATURES and REFERENCE parts ? Possible values are "full" for a full record, "nofeat" to ignore FEATURES part, "noref" to ignore REFERENCE part and "nfnr" to ignore both parts. Default is "full"

Source

character. If x is a character string, use "Char". If x is a filename use "File". Default is "File"

Value

Returns a table containing the data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
read.gb(File = "sequence.gb", DNA = TRUE, Type = "full", Source = "File")

## End(Not run)

## Not run: 
require(rentrez)
data <- rentrez::entrez_fetch(db = "Nucleotide", id = "508082122", rettype = "gb")
read.gb(File = data, DNA = TRUE, Type = "full", Source = "Char")

## End(Not run)

read.gb documentation built on Sept. 6, 2021, 5:08 p.m.

Related to read.gb in read.gb...