ReadSeq {GeneR}R Documentation

Read a sequence from a Fasta, Embl or GeneBank file.

Description

Read a sequence from a Fasta, Embl or GeneBank file, and put it in a buffer.

readSeq is the generic function, readFasta, readGbk and readEmbl are aliases.

Usage

readSeq(file,name=NA, path="", type="E", seqno=0, 
        from=1, to=0,upper=TRUE, index="ix")
readFasta(file,name=NA, path="", seqno=0,
        from=1, to=0,upper = TRUE, index="ix")
strReadFasta (file, name = NA, path = "", from = 1,
                         to = 0, index = "ix") 
readGbk(file,name=NA, path="", seqno=0, from=1, to=0,
index="ix")
strReadGbk (file, name = NA, path = "", from = 1,
                         to = 0, index = "ix") 
readEmbl(file,name=NA, path="", seqno=0, from=1, to=0,
index="ix")
strReadEmbl (file, name = NA, path = "", from = 1,
                         to = 0, index = "ix") 

Arguments

file file of the bank
name Name of the sequence in the bank (default: first sequence)
path Path to the bank
upper if TRUE: all sequence is converted to upper case (default), else sequence is read directly (only implemented for Fasta).
type One of: "F" -> fasta. "E" -> embl.
seqno Integer. Number of bufseq where the sequence will be stored
from,to Begining and ending of sequence, can be vectors. 0 represent the last nucleotide and 1 the first one.
index "ix": name is accn of sequence.
"id" : name is id of sequence.

Value

integer: 1 if if get the sequence; -1 if error. strReadEmbl return sequence as character string.

Author(s)

L.Cottret, A. Lucas.

See Also

GeneR, globals, readEmblLocation, readGbkLocation, getSeq, sizeSeqEmbl, sizeSeqFasta

Examples

## Get a sequence from Ncbi
seqNcbi("BY608190",file="BY608190.gbk",type="G")

## Read Gbk file to buffer 0
readGbk("BY608190.gbk")

## Or to a character string
strReadGbk("BY608190.gbk")

## Write to Fasta file
writeFasta(file='toto.fa')

## Make an index to this file
indexFasta('toto.fa')
readFasta (file="toto.fa",path=".",seqno=0,from=1,to=159)

## Show seqence on buffer 0
getSeq()

## Make a Fake file
writeEmblLine(file='toto.embl',code='AC',header='tmp',append=FALSE)
writeEmblSeq(file='toto.embl')

## Make index on file toto.embl
indexEmbl('toto.embl')

## Read Embl file to buffer 0
readEmbl('toto.embl')

## Or read "directly"
strReadEmbl('toto.embl')


[Package GeneR version 1.4.2 Index]