writeNexus
- Nexus file writer
filename : | String (pass by value) |
The name of the file. | |
data : | AbstractHomologousDiscreteCharacterData (pass by value) |
The character data matrix to print. |
# let's make up some taxa
taxa = v("horse", "whale", "unicorn", "narwhal")
# simulate a tree
tau ~ dnUniformTimeTree(rootAge=1, taxa=taxa)
# we also need a molecular substitution model
molecular_model := fnJC(4)
# together these form a continuous time Markov chain over the tree
full_model ~ dnPhyloCTMC(tree=tau, Q=molecular_model, nSites = 100, type="DNA")
# this will print a Nexus file with a simulated molecular matrix
# to the working directory
writeNexus(filename="test.nex", full_model)