FAQ
From TNT
This is very much a work in progress. Please add/edit as you see fit. We are particularly interested in treating questions not covered in the official site.
Getting Started
- How do I install TNT?
Input
What kinds of data can TNT use to build a phylogenetic tree?
- Any character with up to 32 states (ordered or unordered)
- Aligned sequence data (Nucleotides and Aminoacids)
- Continuous characters
- Landmark data
Where can I find simple examples of matrices in legal TNT format?
- for continuous characters. Go here
- for ordered characters Go here
- for an interleaved matrix with all of continuous, molecular, and standard characters Go here
Can I make an interleaved matrix with only partially overlapping sets of terminals in each interleave?
- ??
Why won't TNT read the file on my Windows desktop?
TNT is fussy, and can't(?) handle spaces in path names. Create a new folder in a path that doesn't contain spaces (like C:\data) and load your input files from there.
Can TNT align my sequence data?
No. If you load a fasta with uneven number of nucleotides in each sequence,TNT automatically fills the shortest sequences with gaps at the end. Hence it is NOT an alignment.
Can TNT read FASTA formatted files?
For most versions/builds yes. This is apparently not available for the Mac-OS-X build (1.1, December 2007).
Can TNT read Nexus file?
Yes, but just a plain Nexus file. If you have a nexus file obtained from Mesquite, Tree base or other sources, it is possible that TNT will have problems to read it. One possible solution is to open the file in PAUP and then export it again in Nexus format, From the PAUP command line use:
export format=nexus;
Another possibility is to open it in Mesquite and export it in Nona format that is very similar to TNT format. The PAUP export trick does not appear to work on the PPC version.
How does TNT treat inapplicable (e.g. scored "-"), versus missing ("?") states as coded in morphological matrices?
TNT treats both in the same way: it adds no steps to the tree irrespective of the possition of the taxon that bears it.
I can't find the command line in Windows version. Where is it?
It is at the bottom of the window. If you do not see it go to File tab and click on Command line
Can I concatenate matrices in TNT format from different files?
First make sure that your Data format is set to DNA (Windows GUI) via Format->Data format->DNA. Then do File->Merge data files. Provide a filename for the new file that will contain the merged data and click Save. After this shift click the files you want to merge (2 or more) and click Open. The data are then checked and saved into the new file.
Can I concatenate matrices in FASTA format from different files?
You'll have to read the files from the command line with proc &my_file one a time, then save them in TNT's "native" format. Then follow the steps above.
Do concatenated matrices need to have identical sets of terminals?
No. The terminals have to be named identically in each block, though. Terminals not included in a block are considered to have missing entries for each of the characters in the block.
How do you read/open tree files from the command line? When I try to use tsave it writes over my tree file with a blank file.
- ??
Analysis
Scripts sound useful, but how do I run them?
I am using an exact solution in PAUP* and TNT. Why does TNT find fewer trees than PAUP*?
TNT (by default) collapses the trees more strictly than PAUP* (by default). If you set collapse rule 3 in TNT you will get results comparable to the default of PAUP, and if you set "Pset collapse=minbrlen" in PAUP*, comparable to the default of TNT.
Does TNT perform maximum likelihood (ML) analyses?
No. However, a parsimony tree corresponds to the tree that would be found with the no common mechanism model of Tuffley & Steel (1997), in which case, for 4-state DNA data, -lnL = (-1 -length) * 1.386294361
How do I know if I have found the shortest trees?
Unless you run an exact search, you don't.
Are there ways to minimize the chance of me not finding the shortest trees?
For starters you might see the pages on determining search parameters.
How do I calculate the CI for a given character?
If macros are enable (Macro=), the command minsteps gives you the numerator to calculate the CI. The denominator is the length of the character on the tree that can be obtained with the command cscores
How do I calculate the composite CI and RI for my dataset?
This script will provide these statistics.
How do I report the characters with the most homoplasy (including ties) for a given tree?
The command chomo reports the homoplasy for each character of a given tree. If you want the character with the most homoplasy you can either ask the program to give the homoplasy for every character how?, or, alternatively you can automate that writing a simple script.
How do I calculate a majority rule and strict consensus from a given set of trees?
Can I tell TNT to exclude terminals (or characters) with less than some % of the data coded?
For example I might want to analyze a subset of the data with more than 80% of the matrix coded.
Yes. Siddall wrote a script for excluding terminals missing a percentage of characters.
And another one for characters missing for a percentage of taxa.
How do I determine which individual terminal adds the most length to the tree (number of steps, reporting ties if they exist)?
Here is a script to do that: termlens
How can I calculate the RF distance between two topologies?
TNT does not do RF distances directly, but it can be done by counting the nodes in trees produced by the tcomp command. Here is a script to do it.
I found a small set of trees using NT methods, how do I check for other optimal trees of the same length? I.e., how do I swap on an existing set of trees, retaining all trees in memory?
See Commands/bbreak
I found a set of trees using NT methods, how do I maintain these trees in memory and perform another NT search such that both results are available after its conclusion?
using xmult, do I need to save the trees to file?
How do I find "jumping" terminals? I.e. terminals that move from clade to clade in a set of equally optimal solutions (thus causing poor resolution in a nelsen tree)?
See here
How do I set an outgroup with multiple taxa
The outgroup shouldn't matter unless you have ordered characters; it is something you can impose on the tree during tree display in a graphical program. However, if you have ordered characters, or would like TNT's output trees to reflect the polarity imposed by a multi-taxon outgroup, it may be useful.
It is not clear if TNT can have an outgroup consisting of a clade with multiple taxa in it. But you can force a constraint on the analysis that forces all of the ingroup taxa to be a monophyletic clade, then set one of the outgroup taxa as "the" outgroup, then re-root the tree between ingroup and outgroup in a tree viewing program later.
Here is how force an ingroup constraint, on a dataset with 43 taxa (which TNT numbers 0-42):
/* Force 1 monophyletic group, the ingroup, and set the others to outgroup */ force + [6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42]; /* Set the outgroup (default is 0 anyway)*/ outgroup 0; /* Make sure constraints are on */ constrain =; /* Constraints is ON */ /* Double-check the constraints & that they are on. */ force ; force *;
Then you can run the rest of your analysis as usual.
constrain -;
...to remove constraints.
Can I differentially weight codon positions of DNA coding for amino acids?
Yep. There's a script for that too.
Can I calculate the Incongruence Length Difference test on partitions of data?
Of course you can.
Output
I generated trees in a command line version of TNT, what's the easiest way to visualize them graphically?
You can use treeview
Can TNT export Newick formatted trees?
Not directly, but you can export them in Nexus format, and see below for converting them.
How can I view Newick trees in a graphical format?
- FigTree
- TreeView
- Dendroscope (http://www-ab.informatik.uni-tuebingen.de/software/dendroscope)
- others?
Can I map characters to trees or nodes prior to exporting them, so that programs like FigTree or Mesquite can display annotated nodes/branches?
With some editing, yes.
For tree 0...
taxname=; tsave *afilename.tre; ttags=; blen *0; save *; tsave/;
Then, edit the treefile by replacing
first "=" with ":" then " :" with ":" then " " with "," then ",)" with ")"
How do I save a consensus tree?
The command nelsen has the option of keeping the consensus as the last tree in memory (nelsen* ). Once you do that you can open a tree file and save the last tree in memory in that file (save/). Finally you have to close the file (tsave/). Alternative, you can click the box "save to ram" in the Tree/Consensus menue and then open, save and close the tree file accesing by the File menue.
How can I export trees then convert them to Newick format?
First generate trees, or have trees in memory, then:
taxname=; tsave *my_filename; save; tsave /;
Then open the file in a text editor, do the following search and replaces (in order):
- replace any * at the end of the lines with ";"
- replace all whitespace with commas
- replace ")(" with "),("
- replace ",)" with ")"
- if you are using vi/vim to do these replacements use s/\s/,//g then s/)(/),(//g then s/,)/)/g
- delete all lines that don't contain a tree string
The file should now be readable in FigTree.
How can I export trees in TNT format then convert them to Newick format in an automated way, with a Python script?
Use this Python script below. It will convert all TNT-format trees (which it identifies by the files having ".tnttree" as the suffix; change this, or your filenames, if your files have a different suffix) to Newick format, producing a ".tnttree.newick" file for each one.
#!/usr/bin/python ################################################################################ # tnt2newick_v2.py # # Copyright Nicholas J. Matzke, 2010 # matzke@berkeley.edu # # Please cite Matzke and the source location if you use this code. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see <http://www.gnu.org/licenses/>. # ################################################################################ #next line was needed - Siddall 10/28/11 #import.os def tntfile2newick(fn): """ # Convert a TNT parenthentical format tree (with e.g. Bremer supports) to # regular Newick format # # Implementing, in Python, instructions online here: # http://tnt.insectmuseum.org/index.php/FAQ#How_can_I_export_trees__then__convert_them_to_Newick_format.3F # # How can I export trees then convert them to Newick format? First generate trees, or have trees in memory, then: taxname=; tsave *my_filename; save; tsave /; Then open the file in a text editor, do the following search and replaces (in order): * replace any * at the end of the lines with ";" * replace all whitespace with commas * replace ")(" with "),(" * replace ",)" with ")" * if you are using vi/vim to do these replacements use s/\s/,//g then s/)(/),(//g then s/,)/)/g * delete all lines that don't contain a tree string The file should now be readable in FigTree. """ """ TNT parenthetical format file can be produced by TNT as follows: tnt proc example.tnt; XMult; comcomp ; ttags = KWBremer; ttags ; tsave *tmp_bremer.tnttree; save *; tsave/; A simple though less effective way to get bremers on nodes, is with taxname =; to calculate trees (e.g., xmult;) then a consensus saving as the last tree (e.g., nelsen *;) then pick that tree as a starting tree (tchoose N;) for suboptimal (using suboptimal N; and hold N; and bbreak;) then bsupport; ttags; hit <return> not <esc> when you see the tree, and use tsave *; save *; and tsave/; OR for branch lengths of tree 0 (Siddall 10/28/11) taxname=; tsave *afilename.tnttree; ttags=; blen *0; save *; tsave/; Example file: ===================== tread 'tree(s) from TNT, for data in example.tnt' (0 (70 (64 65 66 67 69 71 72 (2 21 (3 (27 (1 4 )=1 (5 (11 12 13 (7 (8 9 (6 22 26 )=1 )=0 (10 14 15 16 17 )=0 )=1 )=1 )=1 )=1 (23 24 25 )=1 )=0 (20 (18 19 )=|O|1 )=1 )=1 ((((42 (32 ((29 33 35 (28 30 )=0 (31 34 36 )=1 )=[-1] (37 38 )=1 )=|O|0 )=4 (41 (39 40 )=3 )=1 )=2 ((43 44 )=0 ((45 46 )=0 (48 (47 49 )=1 )=1 )=1 )=1 (62 63 )=|O|0 ((73 74 )=1 (79 (80 81 )=1 )=|O|1 )=3 )=0 (51 (50 52 )=2 )=0 )=0 (53 54 55 56 57 58 )=1 (60 (59 61 )=1 )=6 )=1 (68 (82 83 )=1 )=|O|1 (75 76 77 78 )=4 )=1 )=0 ); proc-; ===================== """ # open TNT parenthetical format file print fn fh = open(fn, 'r') # list of text strings, one for each tree treeslist = [] for line in fh: # check for tree if line.startswith("("): pass # continue within loop else: continue # skip to next iteration print print line tntstr = line tntstr2 = tntstr2newick(tntstr) treeslist.append(tntstr2) print tntstr2 #FigTree expects .nwk not .newick - Siddall 10/28/11 #outfn = fn + ".nwk" is more convenient or ".tre" outfn = fn + ".newick" outfh = open(outfn, 'w') for newickstr in treeslist: outfh.write(newickstr + "\n") outfh.close() fh.close() print outfn return outfh def tntstr2newick(tntstr): """ Do just the string conversion """ # If it's a tree, continue: # edit the line as indicated # replace any * at the end of the lines with ";" if tntstr.endswith("*"): tntstr = tntstr.rstrip("*") tntstr = tntstr + ";" # replace all whitespace with commas tntstr = tntstr.replace(" ", ",") # spaces tntstr = tntstr.replace(" ", ",") # tabs # replace ")(" with "),(" tntstr = tntstr.replace(")(", "),(") # replace ",)" with ")" tntstr = tntstr.replace(",)", ")") #the following code did not work for branch lengths - Siddall 10/28/11 #because branch lengths also are terminal, not just internal #instead I replaced with this code #tntstr = tntstr.replace("=", ":") #tntstr = tntstr.replace(",:", ":") # replace "=" with "b" (= is presumably the bremer support) tntstr = tntstr.replace("=", "") # if you are using vi/vim to do these replacements use s/\s/,//g then s/)(/),(//g then s/,)/)/g # delete all lines that don't contain a tree string # - done # return the result return tntstr """ To run the functions above, do the below. This assumes that the TNT trees are saved in files ending with ".tnttree." """ """ Convert a TNT parenthetical tree to a Newick file. Run with: cd {directory with trees} python tnt2newick_v2.py ...or... run tnt2newick_v2.py """ filenames = os.listdir(".") i = 0 for fn in filenames: if fn.endswith(".tnttree"): tntfile2newick(fn) i=i+1 print "" print "tnt2newick:", i, "TNT trees converted to Newick format."
Error messages
When opening a file I get Found alien symbol for taxon 0 ...?
If you have DNA data you may need to set the Format to DNA through the Data->Format->Data format menu.
The TNT Wiki
This wiki changes a lot, can I keep track of changes some how?
Click on Special:RecentChanges then in the toolbox click on 'RSS'. If you're using Firefox you'll be presented with some options that allow you to create a dynamic bookmark that periodically updates itself with pages that have been recently updated.