dat2fasta: Convert and Save sequence data frame to fasta file

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

View source: R/dat2fasta.R

Description

Convert and Save sequence data frame to fasta file.

Usage

1
dat2fasta(dat, outfile = "out.fasta")

Arguments

dat

data frame by read.phylip or read.fasta

outfile

a character string, representing the name of the fasta file to be generated

Details

The column of the data frame must be: 1. seq.name, 2. seq.text, represent the name of the sequences, the content of the sequence, eg. ATCGGGAAC.

Value

This is a routine without return value.

Author(s)

Jinlong Zhang <jinlongzhang01@gmail.com>

References

http://www.genomatix.de/online_help/help/sequence_formats.html

See Also

read.fasta,read.phylip

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cat(
">seq_2", "GTCTTATAAGAAAGAATAAGAAAG--AAATACAAA-------AAAAAAGA",
">seq_3", "GTCTTATAAGAAAGAAATAGAAAAGTAAAAAAAAA-------AAAAAAAG",
">seq_5", "GACATAAGACATAAAATAGAATACTCAATCAGAAACCAACCCATAAAAAC",
">seq_8", "ATTCCAAAATAAAATACAAAAAGAAAAAACTAGAAAGTTTTTTTTCTTTG",
">seq_9", "ATTCTTTGTTCTTTTTTTTCTTTAATCTTTAAATAAACCTTTTTTTTTTA",
file = "trn1.fasta", sep = "\n")

res <- read.fasta("trn1.fasta")
dat2fasta(res)
unlink("trn1.fasta")
unlink("out.fasta")

helixcn/phylotools documentation built on March 31, 2021, 5:45 a.m.