readSeq {GeneR}R Documentation

Sequence extraction from a bank

Description

These functions load a sequence from a Fasta, Embl or GeneBank sequence bank file into a GeneR sequence buffer or as a character string..

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

Usage

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

Arguments

file

String/scalar, File name of the bank

name

String/scalar, Sequence name (default : first sequence)

upper

upper case letters conversion (TRUE: The whole sequence is converted to upper case letters, FALSE : no conversion (only implemented for Fasta sequence)).

type

String/scalar, Bank format ("F" -> fasta. "E" -> embl, "G" -> GenBank)

seqno

Integer/scalar, Sequence number (buffer number)

from, to

Integer/scalar, Absolute addresses of the begin and the end of the fragment, (1 means the first nucleotide and 0 conventionally the last one; from must not be larger than to)

index

String/scalar, type of index ( "ix" -> sequence name is the accession number
"id" -> sequence name is the identifier)

Value

integer: 1 if OK; -1 if error. strReadFasta, strReadGbk and strReadEmbl returns the 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",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 2.24.0 Index]