writeFasta2 {wrProteo}R Documentation

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.

Description

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.

Usage

writeFasta2(
  prot,
  fileNa = NULL,
  ref = NULL,
  lineLength = 60,
  eol = "\n",
  truSuf = "_tru",
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Arguments

prot

(character) vector of sequenes, names will be used for fasta-header

fileNa

(character) name (and path) for file to be written

ref

(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'

lineLength

(integer, length=1) number of sequence characters per line (default 60, should be >1 and <10000)

eol

(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

truSuf

(character) suffix to be added for sequences found truncated when comparing with ref

silent

(logical) suppress messages

debug

(logical) supplemental messages for debugging

callFrom

(character) allows easier tracking of messages produced

Details

Sequences without any names will be given generic headers like protein01 ... etc.

Value

This function writes the sequences from prot as fasta formatted-file

See Also

readFasta2 for reading fasta, write.fasta from the package seqinr

Examples

prots <- c(SEQU1="ABCDEFGHIJKL", SEQU2="CDEFGHIJKLMNOP")
writeFasta2(prots, fileNa=file.path(tempdir(),"testWrite.fasta"), lineLength=6)

[Package wrProteo version 1.12.0 Index]