Skip to contents

write.pml writes out the ML tree and the model parameters.

Usage

write.pml(x, file = "pml", save_rds = FALSE, digits = -1, ...)

Arguments

x

an object of class ancestral.

file

a file name. File endings are added.

save_rds

logical, if TRUE saves the pml object as a rds file, otherwise the alignment is saved as a fasta file.

digits

default is -1, no edge length for the bootstrap trees are exported. For digits larger than zero edge length are added.

...

Further arguments passed to or from other methods.

Value

write.pml returns the input x invisibly.

Details

write.pml creates several files. It exports the alignment as fasta file. It writes out the ML tree in a newick file and the estimates parameters in a txt file. It should be possible to (re-)create the pml object up to numerical inaccuracies. If bootstrap trees exist these are additionally exported in a nexus file.

Examples

data(woodmouse)
fit <- pml_bb(woodmouse, "JC", rearrangement = "none")
#> optimize edge weights:  -1861.403 --> -1857.165 
#> optimize edge weights:  -1857.165 --> -1857.165 
write.pml(fit, "woodmouse")
unlink(c("woodmouse.txt", "woodmouse_tree.nwk", "woodmouse_align.fasta"))