read.gb {read.gb} | R Documentation |
Opens files with .gb extensions
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
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
## 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)