Learn R Programming

wrProteo (version 2.0.0.2)

writeFasta2: Write Sequences In Fasta Format To File This function writes sequences from character vector or parsed matrix to file as fasta formatted file (close to UniProt) 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 or parsed matrix to file as fasta formatted file (close to UniProt) 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,
  sep = "|",
  suplSep = " ",
  suplColumns = c("ProteinName", "OS=", "OX=", "GN=", "PE=", "SV="),
  ref = NULL,
  lineLength = 60,
  eol = "\n",
  truSuf = "_tru",
  substName = "protein",
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Value

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

Arguments

prot

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

fileNa

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

sep

(character) primary separator for fasta-header (when prot is matrix)

suplSep

(character) supplemental saparator for additional UniProt fields

suplColumns

(character) column names to be used for supplemental saparator (for additional UniProt fields)

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

substName

(character, length=1) in case no names/elements are given to be used as fasta-headers this term will be enumerated

silent

(logical) suppress messages

debug

(logical) supplemental messages for debugging

callFrom

(character) allows easier tracking of messages produced

Details

If a named character vector is entered as prot, names will be used as annotatin of the sequence entries Sequences without any names will be given generic headers like protein01 ... etc.

If prot is a matrix the column named 'sequence' or 'seq' will be considered as sequence and the rest will get concatenated to form theb fasta-header using the separator given by argument sep

See Also

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

Examples

Run this code
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