fasta_to_nexus: convert fasta to nexus data block.

Description Usage Arguments Details Value Examples

View source: R/paup.R

Description

internal function for write_paup()

Usage

1
fasta_to_nexus(fasta, datatype, missing = "?", gap = "-")

Arguments

fasta

tibble. see Value of biozhuoer::read_fasta(). Sequence must be aligned (in the same length). 'U' would be replaced by 'X' since paup doesn't recognized it

datatype

string. what kind of data is you fasta. ('dna', 'rna', 'protein', or 'standard')

missing

string. symbol used for missing data

gap

string. symbol used for gap

Details

the return value will be printed when call at console, if the file is big, it will take a while, and you can't do anything. Consider fasta_to_nexus() -> x to avoid automatically printing.

Alternatively, you can use seaview But it may take several seconds if each sequence lies on only one line in the original file, because seaview always force the line width less than 80.

Value

character. A Nexus data block. Note that begining '#nexus' isn't included.

Examples

1
2
fasta <- biozhuoer::read_fasta(system.file('extdata', 'EOG090F05Z3.fasta', package = 'mcapomorphy'))
fasta_to_nexus(fasta, 'protein');

dongzhuoer/mcapomorphy documentation built on Jan. 9, 2020, 3:28 a.m.