prot
.
This function also allows comparing the main vector of sequences with a reference vector ref
to check if any of the sequences therein are truncated.Write sequences in fasta format to file
This function writes sequences from character vector as fasta formatted file (from UniProt)
Line-headers are based on names of elements of input vector prot
.
This function also allows comparing the main vector of sequences with a reference vector ref
to check if any of the sequences therein are truncated.
writeFasta2(
prot,
fileNa = NULL,
ref = NULL,
lineLength = 60,
eol = "\n",
truSuf = "_tru",
silent = FALSE,
debug = FALSE,
callFrom = NULL
)
This function writes the sequences from prot
as fasta formatted-file
(character) vector of sequenes, names will be used for fasta-header
(character) name (and path) for file to be written
(character) optional/additional set of (reference-) sequences (only for comparison to prot
), length of proteins from prot
will be checked to mark truncated proteins by '_tru'
(integer, length=1) number of sequence characters per line (default 60, should be >1 and <10000)
(character) the character(s) to print at the end of each line (row); for example, eol = "\r\n" will produce Windows' line endings on a Unix-alike OS
(character) suffix to be added for sequences found truncated when comparing with ref
(logical) suppress messages
(logical) supplemental messages for debugging
(character) allows easier tracking of messages produced
Sequences without any names will be given generic headers like protein01 ... etc.
readFasta2
for reading fasta, write.fasta
from the package seqinr
prots <- c(SEQU1="ABCDEFGHIJKL", SEQU2="CDEFGHIJKLMNOP")
writeFasta2(prots, fileNa=file.path(tempdir(),"testWrite.fasta"), lineLength=6)
Run the code above in your browser using DataLab