export.fasta: Writes a MSA file in FASTA format

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Writes a multiple sequence alignment (MSA) file in FASTA format.

Usage

1
export.fasta(x, outfile = "alignment.fa", ncol = 60, open = "w")

Arguments

x

an object of class 'align', obtained from import.fasta or import.msf, or an element list from the extract.cluster function return.

outfile

a string of characters or string vector to indicate the name of the MSA file(s) to be written. If x is an object of class 'align', default is "alignment.fa". If x is an element list, for each element in x, default is the element name, followed by the ".alignement.fa" extension.

ncol

an integer value indicating the number of characters per line for the sequences in outfile.Default is 60.

open

a character value indicating the opening mode for outfile. This should be either of "w" to write into a new file, or "a" to append at the end of an already existing file. Default is "w".

Details

Initially, FASTA (for FAST-ALL) was the input format of the FASTA program, used for protein comparison and searching in databases. Presently, FASTA format is a standard format for biological sequences.

The FASTA formatted file of a single sequence displays:

For multiple alignments, the FASTA formatted sequences are concatenated to create a multiple FASTA format.

Value

Produces a FASTA file for an 'align' object or a FASTA file for each cluster in list.

Note

For further information about FASTA format, see: http://www.ncbi.nlm.nih.gov/BLAST/fasta.shtml

Author(s)

Jean-Michel Becu

See Also

write.fasta function from seqinr package.

Examples

1
2
3
4
5
6
# reading of the multiple sequence alignment of human GPCRS in FASTA format:
wd <- tempdir()
#wd <- getwd()
file1 <- file.path(wd,"alignment.fa")
aln <- import.fasta(system.file("msa/human_gpcr.fa", package = "bios2mds"))
export.fasta(aln,file1)

Example output

Loading required package: amap
Loading required package: e1071
Loading required package: scales
Loading required package: cluster
Loading required package: rgl
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

bios2mds documentation built on April 14, 2020, 5:08 p.m.