writeFasta
- FASTA file writing function
filename : | String (pass by value) |
The name of the file. | |
data : | AbstractHomologousDiscreteCharacterData (pass by value) |
The character data object. |
# let's make up some taxa
taxa = v("horse", "whale", "unicorn", "narwhal")
# convert these to the taxon datatype
for(i in 1:4) { taxa[i] = taxon(taxa[i]) }
# 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 FASTA file with a simulated molecular matrix
# to the working directory
writeFasta(filename="test.fasta", full_model)