WriteFasta {GeneR}R Documentation

Write sequences into fasta file format

Description

Write one or more parts of sequences into Fasta file format.

Usage


writeFasta(file ="data.fasta",seqno = 0, from = getBegSeq(seqno),
                 to = getEndSeq(seqno), name = getAccn(seqno),
                 comment = paste("from", from, "to", to),
                 cpl = 60, append = FALSE)
strWriteFasta(s,file="data.fasta", name="Seq_R",
              comment=as.character(nchar(s)),
              cpl=60,append = FALSE)

Arguments

seqno Integer, number of the sequence. (bufseq)
s A character string containing the sequence
from,to Begining and ending of sub-sequences to extract. Can be vectors. 0 represent the last nucleotide and 1 the first one.
name Sequence name.
comment Comment.
file Output File.
cpl Number of caracteres by line.
append Scalar boolean. TRUE -> sequence is added at the end of the file. FALSE -> file is written over.

Value

1 or -1 if error.

Author(s)

L.Cottret

Examples


s<-"cgtagctagctagctagctagctacgtagctagctgactgtcgat"
placeString(s)
from <- c(1,14)
to <- c(10,0)
writeFasta(file="bank.fasta",from =from, to=to, append=FALSE)


strWriteFasta(s="ATGTCGTGGTaaattaatTTGGTCCC",file="bank.fasta",append=TRUE)

## Show file
cat(paste(readLines("bank.fasta"),collapse='\n'))



[Package GeneR version 2.18.1 Index]