changeset 2:03c10736e497 draft

planemo upload for repository https://github.com/TGAC/earlham-galaxytools/tree/master/tools/ete commit 91b634b8f9b131045bbbbf43cc8edbea59ac686b-dirty
author earlhaminst
date Tue, 07 Nov 2017 11:45:13 -0500
parents a4ba317fc713
children 077021c45b96
files ete_init_taxdb.py ete_init_taxdb.xml ete_lineage_generator.py ete_lineage_generator.xml ete_macros.xml ete_mod.xml ete_species_tree_generator.py ete_species_tree_generator.xml test-data/lineage-compress-lower.txt test-data/lineage-compress.txt test-data/lineage-full.txt test-data/lineage.txt test-data/out.nhx test-data/taxdump.sqlite test-data/taxdump.tar.gz test-data/tree1.nhx test-data/tree1_ladder.nhx test-data/tree1_ogA.nhx test-data/tree1_pruneAC.nhx test-data/tree1_pruneACpreserve.nhx test-data/tree1_unroot.nhx test-data/tree1_unroot_resolve.nhx test-data/tree2.nhx test-data/tree2_sort.nhx test-data/tree3.nhx test-data/tree3_stand.nhx
diffstat 26 files changed, 762 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ete_init_taxdb.py	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,24 @@
+import optparse
+
+import ete3.ncbi_taxonomy
+from six.moves.urllib.request import urlretrieve
+
+parser = optparse.OptionParser()
+parser.add_option('-t', '--taxdump', dest='taxdump', default=None,
+                  help='NCBI taxdump (tar.gz) will be downloaded if not given')
+parser.add_option('-d', '--database', dest="database", default=None,
+                  help='ETE sqlite data base to use (default: ~/.etetoolkit/taxa.sqlite)')
+options, args = parser.parse_args()
+if options.database is None:
+    parser.error("-d option must be specified")
+if options.taxdump is not None:
+    taxdump = options.taxdump
+else:
+    urlretrieve("http://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz", "taxdump.tar.gz")
+    taxdump = "taxdump.tar.gz"
+
+# will remove a taxdump.tar.gz file at the end
+# which will lead to an errmessage if not present
+# if the tool is run on a taxdump in the current dir it will be
+# deleted in the end
+ete3.ncbi_taxonomy.ncbiquery.update_db(dbfile=options.database, targz_file=taxdump)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ete_init_taxdb.xml	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,48 @@
+<tool id="ete_init_taxdb" name="ETE taxa DB generator" version="@VERSION@">
+    <description>generates the ETE sqlite DB from the NCBI taxdump.tar.gz</description>
+    <macros>
+        <import>ete_macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <command detect_errors="exit_code"><![CDATA[
+python '$__tool_directory__/ete_init_taxdb.py'
+#if $latestcond.latest == "local"
+    -t '$latestcond.taxdump'
+#end if
+-d '$database'
+    ]]></command>
+    <inputs>
+        <conditional name="latestcond">
+            <param name="latest" type="select" label="Get latest version" help="Get the latest version of the taxdump from the NCBI website">
+                <option value="local" selected="true">Use a local taxdump</option>
+                <option value="latest">Get latest taxdump online</option>
+            </param>
+            <when value="local">
+                <param name="taxdump" type="data" format="tar" label="NCBI taxdump" help="NCBI taxonomy database dump in tar.gz format" />
+            </when>
+            <when value="latest" />
+        </conditional>
+    </inputs>
+    <outputs>
+        <data name="database" format="sqlite" label="${tool.name} on ${on_string}" />
+    </outputs>
+    <tests>
+        <test>
+            <param name="latest" value="local" />
+            <param name="taxdump" ftype="tar" value="taxdump.tar.gz" />
+            <output name="database" file="taxdump.sqlite" compare="sim_size" />
+        </test>
+    </tests>
+    <help><![CDATA[
+Generates the ETE sqlite data base from the NCBI taxdump.tar.gz using the .. _ETE Toolkit: http://etetoolkit.org/
+
+**Input**
+
+- NCBI taxdump: NCBI taxdump in tar.gz format. If not given the latest is downloaded from ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
+
+**Output**
+
+- *(ETE3) Taxonomy Database* a sqlite database that has been created by ETE from the NCBI taxonomy dump
+    ]]></help>
+    <expand macro="citations" />
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ete_lineage_generator.py	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,128 @@
+import optparse
+import sys
+
+from ete3 import NCBITaxa
+
+# - compared to gi2taxonomy the root is excluded, since
+#   the value is always "root", i.e. useless information
+# - additional levels that appear in the ncbi taxdb have
+#   been added
+#   (order from https://en.wikipedia.org/wiki/Taxonomic_rank#All_ranks)
+# TODO the full list of ranks could be derived from the input DB
+LONG_RANKS = [u"superkingdom", u"kingdom", u"subkingdom",
+              u"superphylum", u"phylum", u"subphylum",
+              u"superclass", u"class", u"subclass", "infraclass",
+              u"cohort",
+              u"superorder", u"order", u"suborder", u"infraorder", u"parvorder",
+              u"superfamily", u"family", u"subfamily",
+              u"tribe", u"subtribe",
+              u"genus", u"subgenus",
+              u"species group", u"species subgroup", u"species", u"subspecies",
+              u"varietas", "forma"]
+
+SHORT_RANKS = [u"kingdom",
+               u"phylum",
+               u"class",
+               u"order",
+               u"family",
+               u"genus",
+               u"species"]
+
+
+def process_taxid(ncbi, taxid, ranks, RANK_IDX, lower=False):
+    """
+    process one taxid:
+        - get lineage (as list of taxids, ranks, and names)
+        - reverse the lineage if lower ranks are to be used for filling
+        - fill the ranks with the data from the lineage
+    ncbi: ete NCBITaxa object
+    taxid: a taxid (int)
+    ranks: list of ranks (should be initialized with "NA" x number of levels of interest)
+    RANK_IDX: mapping from rank names to indices (distance to root/leaf?)
+    lower: use lower taxa for filling "NA"s
+    """
+    lineage = ncbi.get_lineage(taxid)
+    lineage_ranks = ncbi.get_rank(lineage)
+    lineage_names = ncbi.get_taxid_translator(lineage, try_synonyms=True)
+    if lower:
+        lineage.reverse()
+    for l in lineage:
+        if not lineage_ranks[l] in RANK_IDX:
+            continue
+        if ranks[RANK_IDX[lineage_ranks[l]]] != "NA":
+            continue
+        ranks[RANK_IDX[lineage_ranks[l]]] = lineage_names[l]
+
+
+# get command line options
+parser = optparse.OptionParser()
+parser.add_option('-s', '--species', dest="input_species_filename",
+                  help='Species/taxid list in text format one species in each line')
+parser.add_option('-d', '--database', dest="database", default=None,
+                  help='ETE sqlite data base to use (default: ~/.etetoolkit/taxa.sqlite)')
+parser.add_option('-o', '--output', dest="output", help='output file name (default: stdout)')
+parser.add_option('-f', dest="full", action="store_true", default=False,
+                  help='Show all available (named) taxonomic ranks (default: only primary levels)')
+parser.add_option('-c', dest="compress", action="store_true", default=False,
+                  help='Fill unnamed ranks with super/sub ranks (see -l)')
+parser.add_option('-l', dest="lower", action="store_true", default=False,
+                  help='Prefer lower levels when compressed')
+parser.add_option('-r', '--rank', dest='ranks', action="append",
+                  help='include rank - multiple ones can be specified')
+
+options, args = parser.parse_args()
+# check command line options
+if options.input_species_filename is None:
+    parser.error("-s option must be specified, Species list in text format one species in each line")
+if options.full and options.ranks:
+    parser.error("-f and -r can not be used at the same time")
+if options.ranks:
+    for r in options.ranks:
+        if r not in LONG_RANKS:
+            parser.error("unknown rank %s" % r)
+# setup output
+if not options.output:   # if filename is not given
+    of = sys.stdout
+else:
+    of = open(options.output, "w")
+# load NCBI taxonomy DB
+ncbi = NCBITaxa(dbfile=options.database)
+# get list of ranks that are of interest
+if options.ranks:
+    RANKS = []
+    for r in LONG_RANKS:
+        if r in options.ranks:
+            RANKS.append(r)
+else:
+    if options.full:
+        RANKS = LONG_RANKS
+    else:
+        RANKS = SHORT_RANKS
+RANK_IDX = {item: index for index, item in enumerate(RANKS)}
+COMP_RANK_IDX = RANK_IDX
+if options.compress:
+    for ir in range(len(RANKS)):
+        for ilr in range(len(LONG_RANKS)):
+            if RANKS[ir] in LONG_RANKS[ilr]:
+                COMP_RANK_IDX[LONG_RANKS[ilr]] = ir
+with open(options.input_species_filename) as f:
+    for line in f.readlines():
+        line = line.strip().replace('_', ' ')
+        try:
+            taxid = int(line)
+        except ValueError:
+            # TODO: one could use fuzzy name lookup (i.e. accept typos in the species names),
+            # but then a pysqlite version that supports this is needed (needs to be enabled
+            # during compilation)
+            name2tax = ncbi.get_name_translator([line])
+            if line in name2tax:
+                taxid = name2tax[line][0]
+            else:
+                sys.stderr.write("[%s] could not be translated into a taxid!\n" % line)
+                continue
+        ranks = ["NA"] * len(RANKS)
+        process_taxid(ncbi, taxid, ranks, RANK_IDX)
+        if options.compress:
+            process_taxid(ncbi, taxid, ranks, COMP_RANK_IDX, options.lower)
+        of.write("%s\t%s\n" % (line, "\t".join(ranks)))
+of.close()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ete_lineage_generator.xml	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,145 @@
+<tool id="ete_lineage_generator" name="ETE lineage generator" version="@VERSION@">
+    <description>from a list of species/taxids using the ETE Toolkit</description>
+    <macros>
+        <import>ete_macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <command detect_errors="exit_code"><![CDATA[
+python '$__tool_directory__/ete_lineage_generator.py'
+-s '$speciesFile'
+-d '$database'
+-o '$outputFile'
+#if $ranks.levels == "full"
+    -f
+#elif $ranks.levels == "manual"
+    #for $rank in $ranks.manualranks:
+        -r $rank
+    #end for
+#end if
+#if $compresscond.compress == "-c"
+    $compresscond.compress
+    $compresscond.lower
+#end if
+    ]]></command>
+    <inputs>
+        <param name="speciesFile" type="data" format="txt" label="Species file" help="List with one species/taxid per line" />
+        <param name="database" type="data" format="sqlite" label="(ETE3) Taxonomy Database" help="The sqlite formatted Taxonomy used by ETE3 (which is derived from NCBI taxonomy)" />
+        <conditional name="ranks">
+            <param name="levels" type="select" label="Taxonomic levels" help="Taxonomic levels to include in the output">
+                <option value="primary" selected="true">Primary</option>
+                <option value="full">Full</option>
+                <option value="manual">Manual</option>
+            </param>
+            <when value="manual">
+                <param name="manualranks" type="select" multiple="true" label="Manual selection of ranks">
+                    <option value="superkingdom">superkingdom</option>
+                    <option value="kingdom" selected="true">kingdom</option>
+                    <option value="subkingdom">subkingdom</option>
+                    <option value="superphylum">superphylum</option>
+                    <option value="phylum" selected="true">phylum</option>
+                    <option value="subphylum">subphylum</option>
+                    <option value="superclass">superclass</option>
+                    <option value="class" selected="true">class</option>
+                    <option value="subclass">subclass</option>
+                    <option value="infraclass">infraclass</option>
+                    <option value="cohort">cohort</option>
+                    <option value="superorder">superorder</option>
+                    <option value="order" selected="true">order</option>
+                    <option value="suborder">suborder</option>
+                    <option value="infraorder">infraorder</option>
+                    <option value="parvorder">parvorder</option>
+                    <option value="superfamily">superfamily</option>
+                    <option value="family" selected="true">family</option>
+                    <option value="subfamily">subfamily</option>
+                    <option value="tribe">tribe</option>
+                    <option value="subtribe">subtribe</option>
+                    <option value="genus" selected="true">genus</option>
+                    <option value="subgenus">subgenus</option>
+                    <option value="species group">species group</option>
+                    <option value="species subgroup">species subgroup</option>
+                    <option value="species" selected="true">species</option>
+                    <option value="subspecies">subspecies</option>
+                    <option value="varietas">varietas</option>
+                    <option value="forma">forma</option>
+                </param>
+            </when>
+            <when value="primary" />
+            <when value="full" />
+        </conditional>
+        <conditional name="compresscond">
+            <param name="compress" type="select" label="Fill unnamed ranks" help="Fill unnamed ranks with super/sub ranks (see -l)">
+                <option value="-c">Yes</option>
+                <option value="">No</option>
+            </param>
+            <when value="-c">
+                <param name="lower" type="select" label="Prefer lower ranks for filling" help="Prefer lower levels for filling">
+                    <option value="-l">Yes</option>
+                    <option value="">No</option>
+                </param>
+            </when>
+            <when value="" />
+        </conditional>
+    </inputs>
+    <outputs>
+        <data name="outputFile" format="tsv" label="${tool.name} on ${on_string}"/>
+    </outputs>
+    <tests>
+        <test>
+            <param name="speciesFile" ftype="txt" value="species.txt" />
+            <param name="database" ftype="sqlite" value="taxdump.sqlite" />
+            <param name="compress" value="" />
+            <param name="levels" value="primary" />
+            <output name="outputFile" file="lineage.txt" />
+        </test>
+        <test>
+            <param name="speciesFile" ftype="txt" value="species.txt" />
+            <param name="database" ftype="sqlite" value="taxdump.sqlite" />
+            <param name="compress" value="-c" />
+            <param name="levels" value="primary" />
+            <output name="outputFile" file="lineage-compress.txt" />
+        </test>
+        <test>
+            <param name="speciesFile" ftype="txt" value="species.txt" />
+            <param name="database" ftype="sqlite" value="taxdump.sqlite" />
+            <param name="compress" value="-c" />
+            <param name="levels" value="primary" />
+            <param name="lower" value="-l" />
+            <output name="outputFile" file="lineage-compress-lower.txt" />
+        </test>
+        <test>
+            <param name="speciesFile" ftype="txt" value="species.txt" />
+            <param name="database" ftype="sqlite" value="taxdump.sqlite" />
+            <param name="compress" value="" />
+            <param name="levels" value="full" />
+            <output name="outputFile" file="lineage-full.txt" />
+        </test>
+    </tests>
+    <help><![CDATA[
+Generates a table with lineage information for a list of species (also taxids and arbitrary taxons are accepted) using the .. _ETE Toolkit: http://etetoolkit.org/
+
+**Input**
+
+- *Species file* a single column tabular file
+- *(ETE3) Taxonomy Database* a sqlite database that has been created by ETE from the NCBI taxonomy dump
+
+**Options**
+
+- *Taxonomic levels* the columns to be incuded in the output table. There are two presets (full and primary)
+
+    - *Full* contains all 29 ranks included in the NCBI taxonomy
+    - *Primary* contains the primary ranks (kingdom, phylum, class, order, family, genus, species)
+    - *Manual* the ranks of interest can be chosen by the user. The primary levels are chosen by default.
+
+- *Fill unnamed ranks* Get missing data from "nearby" levels:
+
+    - Some nodes in the NCBI taxonomy tree have no name (no rank) these are shown by default as "NA" in the output. If the *compress* option is selected then the rank is accepted if the level name is included (e.g. superorder is accepted as order if the order is unnamed but the name of the superorder is given)
+
+- *Prefer lower ranks for filling* for compressing lower levels are prefered over higher ones
+
+**Output**
+
+Table (tab separated). The first column contains the species names. The following columns contain the
+rank names of the levels of interest.
+    ]]></help>
+    <expand macro="citations" />
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ete_macros.xml	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<macros>
+    <token name="@VERSION@">3.0.0b35</token>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="@VERSION@">ete3</requirement>
+        </requirements>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.1093/molbev/msw046</citation>
+        </citations>
+    </xml>
+</macros>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ete_mod.xml	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,108 @@
+<tool id="ete3_mod" name="ETE mod" version="@VERSION@">
+    <description>manipulates tree topology by rooting, pruning or sorting branches</description>
+    <macros>
+        <import>ete_macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <command detect_errors="exit_code"><![CDATA[
+ete3 mod -t
+#for $input_tree in $input_trees:
+    '$input_tree'
+#end for
+-v '$verbosity'
+#if $outgroup:
+    --outgroup '$outgroup'
+#end if
+## #if float($ultrametric) > 0.0:
+##     --ultrametric $ultrametric
+## #end if
+#if $prune:
+    #set node_list = "'" + "' '".join($prune.split(',')) + "'"
+    --prune $node_list
+#end if
+$prune_preserve_lengths
+$unroot
+$sort_branches
+$ladderize
+$resolve_polytomies
+$standardize
+> '$output_tree'
+    ]]></command>
+    <inputs>
+        <param name="input_trees" argument="-t" type="data" format="nhx" multiple="true" label="Newick trees" />
+        <param name="verbosity" argument="-v" type="integer" value="0" min="0" max="4" label="Verbosity level"
+            help="0=totally quite, 1=errors only, 2=warning+errors, 3=info+warnings+errors 4=debug (-v)" />
+        <param argument="--outgroup" type="text" value="" label="Reroot tree with outgroup (space separated list of leaf names)"
+            help="Root the tree using the provided outgroup. If several
+                        names are provided, the first common ancestor grouping
+                        all of them will be selected as outgroup" />
+        <!-- parameter does not work in the current version
+        <param argument="- -ultrametric" type="float" value="0" min="0" label="Convert tree into ultrametric"
+            help="Convert tree into ultrametric (all leaves have the
+                same distance to root). If an argument (!=0) is provided, it
+                will be used as the expected tree length" />-->
+        <param argument="--prune" type="text" value="" label="Prune nodes from the tree (comma-separated list of leaf names)"
+            help="Remove all nodes in the tree except the ones provided (empty does not prune)" />
+        <param argument="--prune_preserve_lengths" type="boolean" truevalue="--prune_preserve_lengths" falsevalue="" label="Prune: preserve length"
+            help="Branch lengths of the removed nodes are added to the kept branches, thus preserving original tree length" />
+        <param argument="--unroot" type="boolean" truevalue="--unroot" falsevalue="" label="Unroots the tree" />
+        <param argument="--sort_branches" type="boolean" truevalue="--sort_branches" falsevalue="" label="Sort branches"
+            help="Sort branches according to node names" />
+        <param argument="--ladderize" type="boolean" truevalue="--ladderize" falsevalue="" label="Ladderize"
+            help="Sort branches by partition size" />
+        <param argument="--resolve_polytomies" type="boolean" truevalue="--resolve_polytomies" falsevalue="" label="Resolve polytomies"
+            help="Converts polytomies into bifurcations" />
+        <param argument="--standardize" type="boolean" truevalue="--standardize" falsevalue="" label="Standardize tree"
+            help="Standardize tree topology by expanding polytomies and single child nodes" />
+    </inputs>
+    <outputs>
+        <data name="output_tree" format="nhx" label="${tool.name} on ${on_string}"/>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input_trees" ftype="nhx" value="tree1.nhx" />
+            <param name="outgroup" value="A" />
+            <output name="output_tree" file="tree1_ogA.nhx" />
+        </test>
+        <test>
+            <param name="input_trees" ftype="nhx" value="tree1.nhx" />
+            <param name="prune" value="A,C" />
+            <output name="output_tree" file="tree1_pruneAC.nhx" />
+        </test>
+        <test>
+            <param name="input_trees" ftype="nhx" value="tree1.nhx" />
+            <param name="prune" value="A,C" />
+            <param name="prune_preserve_lengths" value="--prune_preserve_lengths" />
+            <output name="output_tree" file="tree1_pruneACpreserve.nhx" />
+        </test>
+        <test>
+            <param name="input_trees" ftype="nhx" value="tree1.nhx" />
+            <param name="unroot" value="--unroot" />
+            <output name="output_tree" file="tree1_unroot.nhx" />
+        </test>
+        <test>
+            <param name="input_trees" ftype="nhx" value="tree2.nhx" />
+            <param name="sort_branches" value="--sort_branches" />
+            <output name="output_tree" file="tree2_sort.nhx" />
+        </test>
+        <test>
+            <param name="input_trees" ftype="nhx" value="tree1.nhx" />
+            <param name="ladderize" value="--ladderize" />
+            <output name="output_tree" file="tree1_ladder.nhx" />
+        </test>
+        <test>
+            <param name="input_trees" ftype="nhx" value="tree1_unroot.nhx" />
+            <param name="resolve_polytomies" value="--resolve_polytomies" />
+            <output name="output_tree" file="tree1_unroot_resolve.nhx" />
+        </test>
+        <test>
+            <param name="input_trees" ftype="nhx" value="tree3.nhx" />
+            <param name="standardize" value="--standardize" />
+            <output name="output_tree" file="tree3_stand.nhx" />
+        </test>
+    </tests>
+    <help><![CDATA[
+Modify a given input tree using the etetoolkit: http://etetoolkit.org/
+    ]]></help>
+    <expand macro="citations" />
+</tool>
--- a/ete_species_tree_generator.py	Fri Mar 17 16:23:39 2017 -0400
+++ b/ete_species_tree_generator.py	Tue Nov 07 11:45:13 2017 -0500
@@ -1,33 +1,24 @@
 import optparse
+import sys
 
 from ete3 import NCBITaxa
 
-ncbi = NCBITaxa()
 
 parser = optparse.OptionParser()
 parser.add_option('-s', '--species', dest="input_species_filename",
                   help='Species list in text format one species in each line')
-
+parser.add_option('-d', '--database', dest="database", default=None,
+                  help='ETE sqlite data base to use (default: ~/.etetoolkit/taxa.sqlite)')
+parser.add_option('-o', '--output', dest="output", help='output file name (default: stdout)')
 parser.add_option('-f', '--format', type='choice', choices=['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '100'], dest="format",
                   default='8', help='outpur format for tree')
-
 parser.add_option('-t', '--treebest', type='choice', choices=['yes', 'no'], dest="treebest",
                   default='no', help='To be used in TreeBest')
-
-parser.add_option('-d', '--database', type='choice', choices=['yes', 'no'], dest="database",
-                  default='no', help='Update database')
-
 options, args = parser.parse_args()
+if options.input_species_filename is None:
+    parser.error("-s option must be specified, Species list in text format one species in each line")
 
-if options.database == "yes":
-    try:
-        ncbi.update_taxonomy_database()
-    except:
-        pass
-
-if options.input_species_filename is None:
-    raise Exception('-s option must be specified, Species list in text format one species in each line')
-
+ncbi = NCBITaxa(dbfile=options.database)
 with open(options.input_species_filename) as f:
     species_name = [_.strip().replace('_', ' ') for _ in f.readlines()]
 
@@ -51,6 +42,10 @@
 if options.treebest == "yes":
     newickTree = newickTree.rstrip(';')
     newickTree = newickTree + "root;"
-
-with open('newickTree.nhx', 'w') as newickFile:
-    newickFile.write(newickTree)
+# setup output
+if not options.output:   # if filename is not given
+    of = sys.stdout
+else:
+    of = open(options.output, "w")
+of.write(newickTree)
+of.close()
--- a/ete_species_tree_generator.xml	Fri Mar 17 16:23:39 2017 -0400
+++ b/ete_species_tree_generator.xml	Tue Nov 07 11:45:13 2017 -0500
@@ -1,27 +1,30 @@
-<tool id="ete_species_tree_generator" name="ETE species tree generator" version="3.0.0b35">
+<tool id="ete_species_tree_generator" name="ETE species tree generator" version="@VERSION@.1">
     <description>from a list of species using the ETE Toolkit</description>
-     <requirements>
-        <requirement type="package" version="3.0.0b35">ete3</requirement>
-    </requirements>
+    <macros>
+        <import>ete_macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
     <stdio>
         <!-- Anything other than zero is an error -->
         <exit_code range="1:" />
     </stdio>
     <command>
     <![CDATA[
-python $__tool_directory__/ete_species_tree_generator.py
+python '$__tool_directory__/ete_species_tree_generator.py'
 -s '$speciesFile'
+-d $database
+-o '$outputFile'
 #if $output_format.treebest == 'yes'
     -f 8
 #else
     -f ${output_format.format_selector}
 #end if
 -t $output_format.treebest
--d $database
     ]]>
     </command>
     <inputs>
-        <param name="speciesFile" type="data" format="txt" label="Species file" help="List with one species per line" />        
+        <param name="speciesFile" type="data" format="txt" label="Species file" help="List with one species per line" />
+        <param name="database" type="data" format="sqlite" label="(ETE3) Taxonomy Database" help="The sqlite formatted Taxonomy used by ETE3 (which is derived from NCBI taxonomy)" />
         <conditional name="output_format">
             <param name="treebest" type="select" label="Use in TreeBest" help="Select yes if specie tree to be used in TreeBest">
                 <option value="yes">Yes</option>
@@ -44,19 +47,21 @@
                 </param>
             </when>
         </conditional>
-        <param name="database" type="select" label="Update database" help="Update database from NCBI (slower)">
-            <option value="no" selected="true">No</option>
-            <option value="yes">Yes</option>
-        </param>
     </inputs>
     <outputs>
-        <data format="nhx" name="outputFile" label="${tool.name} on ${on_string}" from_work_dir="newickTree.nhx"/>
+        <data format="nhx" name="outputFile" label="${tool.name} on ${on_string}"/>
     </outputs>
     <tests>
         <test>
             <param name="speciesFile" ftype="txt" value="species.txt" />
+            <param name="database" ftype="sqlite" value="taxdump.sqlite" />
             <param name="treebest" value="yes" />
-            <output name="outputFile" file="out.nhx" />
+            <output name="outputFile">
+                <assert_contents>
+                    <has_text text="(Homosapiens*,Pantroglodytes*,Gorillagorillagorilla*)" />
+                    <has_text text=")root;" />
+                </assert_contents>
+            </output>
         </test>
     </tests>
     <help>
@@ -84,7 +89,5 @@
 ======= ============================================= ========================================================================================
     ]]>
     </help>
-    <citations>
-        <citation type="doi">10.1093/molbev/msw046</citation>
-    </citations>
+    <expand macro="citations" />
 </tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/lineage-compress-lower.txt	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,62 @@
+Latimeria chalumnae	Eukaryota	Chordata	NA	Coelacanthiformes	Coelacanthidae	Latimeria	Latimeria chalumnae
+Xenopus tropicalis	Eukaryota	Chordata	Amphibia	Batrachia	Pipoidea	Xenopus	Xenopus tropicalis
+Ornithorhynchus anatinus	Eukaryota	Chordata	Mammalia	Monotremata	Ornithorhynchidae	Ornithorhynchus	Ornithorhynchus anatinus
+Macropus eugenii	Eukaryota	Chordata	Mammalia	Diprotodontia	Macropodidae	Notamacropus	Notamacropus eugenii
+Sarcophilus harrisii	Eukaryota	Chordata	Mammalia	Dasyuromorphia	Dasyuridae	Sarcophilus	Sarcophilus harrisii
+Monodelphis domestica	Eukaryota	Chordata	Mammalia	Didelphimorphia	Didelphidae	Monodelphis	Monodelphis domestica
+Echinops telfairi	Eukaryota	Chordata	Mammalia	Afrotheria	Tenrecidae	Echinops	Echinops telfairi
+Procavia capensis	Eukaryota	Chordata	Mammalia	Afrotheria	Procaviidae	Procavia	Procavia capensis
+Loxodonta africana	Eukaryota	Chordata	Mammalia	Afrotheria	Elephantidae	Loxodonta	Loxodonta africana
+Dasypus novemcinctus	Eukaryota	Chordata	Mammalia	Xenarthra	Dasypodidae	Dasypus	Dasypus novemcinctus
+Choloepus hoffmanni	Eukaryota	Chordata	Mammalia	Xenarthra	Megalonychidae	Choloepus	Choloepus hoffmanni
+Ochotona princeps	Eukaryota	Chordata	Mammalia	Euarchontoglires	Ochotonidae	Ochotona	Ochotona princeps
+Oryctolagus cuniculus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Leporidae	Oryctolagus	Oryctolagus cuniculus
+Cavia porcellus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Caviidae	Cavia	Cavia porcellus
+Ictidomys tridecemlineatus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Sciuridae	Ictidomys	Ictidomys tridecemlineatus
+Dipodomys ordii	Eukaryota	Chordata	Mammalia	Euarchontoglires	Heteromyidae	Dipodomys	Dipodomys ordii
+Rattus norvegicus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Muridae	Rattus	Rattus norvegicus
+Mus musculus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Muridae	Mus	Mus musculus
+Tupaia belangeri	Eukaryota	Chordata	Mammalia	Euarchontoglires	Tupaiidae	Tupaia	Tupaia belangeri
+Otolemur garnettii	Eukaryota	Chordata	Mammalia	Euarchontoglires	Galagidae	Otolemur	Otolemur garnettii
+Microcebus murinus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cheirogaleidae	Microcebus	Microcebus murinus
+Tarsius syrichta	Eukaryota	Chordata	Mammalia	Euarchontoglires	Tarsiidae	Carlito	Carlito syrichta
+Callithrix jacchus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cebidae	Callithrix	Callithrix jacchus
+Chlorocebus sabaeus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cercopithecoidea	Chlorocebus	Chlorocebus sabaeus
+Papio anubis	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cercopithecoidea	Papio	Papio anubis
+Macaca mulatta	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cercopithecoidea	Macaca	Macaca mulatta
+Nomascus leucogenys	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Nomascus	Nomascus leucogenys
+Pongo abelii	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Pongo	Pongo abelii
+Gorilla gorilla gorilla	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Gorilla	Gorilla gorilla
+Pan troglodytes	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Pan	Pan troglodytes
+Homo sapiens	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Homo	Homo sapiens
+Sorex araneus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Soricidae	Sorex	Sorex araneus
+Erinaceus europaeus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Erinaceidae	Erinaceus	Erinaceus europaeus
+Pteropus vampyrus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Pteropodidae	Pteropus	Pteropus vampyrus
+Myotis lucifugus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Vespertilionidae	Myotis	Myotis lucifugus
+Felis catus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Felidae	Felis	Felis catus
+Canis lupus familiaris	Eukaryota	Chordata	Mammalia	Laurasiatheria	Canidae	Canis	Canis lupus
+Mustela putorius furo	Eukaryota	Chordata	Mammalia	Laurasiatheria	Mustelidae	Mustela	Mustela putorius
+Ailuropoda melanoleuca	Eukaryota	Chordata	Mammalia	Laurasiatheria	Ursidae	Ailuropoda	Ailuropoda melanoleuca
+Equus caballus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Equidae	Equus	Equus caballus
+Vicugna pacos	Eukaryota	Chordata	Mammalia	Laurasiatheria	Camelidae	Vicugna	Vicugna pacos
+Sus scrofa	Eukaryota	Chordata	Mammalia	Laurasiatheria	Suidae	Sus	Sus scrofa
+Tursiops truncatus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Delphinidae	Tursiops	Tursiops truncatus
+Ovis aries	Eukaryota	Chordata	Mammalia	Laurasiatheria	Bovidae	Ovis	Ovis aries
+Bos taurus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Bovidae	Bos	Bos taurus
+Anolis carolinensis	Eukaryota	Chordata	NA	Lepidosauria	Dactyloidae	Anolis	Anolis carolinensis
+Pelodiscus sinensis	Eukaryota	Chordata	NA	Testudines	Trionychidae	Pelodiscus	Pelodiscus sinensis
+Taeniopygia guttata	Eukaryota	Chordata	Aves	Neognathae	Passeroidea	Taeniopygia	Taeniopygia guttata
+Ficedula albicollis	Eukaryota	Chordata	Aves	Neognathae	Muscicapidae	Ficedula	Ficedula albicollis
+Anas platyrhynchos	Eukaryota	Chordata	Aves	Neognathae	Anatidae	Anas	Anas platyrhynchos
+Meleagris gallopavo	Eukaryota	Chordata	Aves	Neognathae	Phasianidae	Meleagris	Meleagris gallopavo
+Gallus gallus	Eukaryota	Chordata	Aves	Neognathae	Phasianidae	Gallus	Gallus gallus
+Lepisosteus oculatus	Eukaryota	Chordata	Actinopterygii	Semionotiformes	Lepisosteidae	Lepisosteus	Lepisosteus oculatus
+Danio rerio	Eukaryota	Chordata	Actinopterygii	Cypriniphysae	Cyprinoidea	Danio	Danio rerio
+Astyanax mexicanus	Eukaryota	Chordata	Actinopterygii	Characiphysae	Characidae	Astyanax	Astyanax mexicanus
+Gadus morhua	Eukaryota	Chordata	Actinopterygii	Gadiformes	Gadidae	Gadus	Gadus morhua
+Oreochromis niloticus	Eukaryota	Chordata	Actinopterygii	Cichlomorphae	Cichlidae	Oreochromis	Oreochromis niloticus
+Poecilia formosa	Eukaryota	Chordata	Actinopterygii	Atherinomorphae	Poeciliidae	Poecilia	Poecilia formosa
+Xiphophorus maculatus	Eukaryota	Chordata	Actinopterygii	Atherinomorphae	Poeciliidae	Xiphophorus	Xiphophorus maculatus
+Gasterosteus aculeatus	Eukaryota	Chordata	Actinopterygii	Perciformes	Gasterosteidae	Gasterosteus	Gasterosteus aculeatus
+Tetraodon nigroviridis	Eukaryota	Chordata	Actinopterygii	Tetraodontiformes	Tetradontoidea	Tetraodon	Tetraodon nigroviridis
+Takifugu rubripes	Eukaryota	Chordata	Actinopterygii	Tetraodontiformes	Tetradontoidea	Takifugu	Takifugu rubripes
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/lineage-compress.txt	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,62 @@
+Latimeria chalumnae	Eukaryota	Chordata	NA	Coelacanthiformes	Coelacanthidae	Latimeria	Latimeria chalumnae
+Xenopus tropicalis	Eukaryota	Chordata	Amphibia	Batrachia	Pipoidea	Xenopus	Xenopus tropicalis
+Ornithorhynchus anatinus	Eukaryota	Chordata	Mammalia	Monotremata	Ornithorhynchidae	Ornithorhynchus	Ornithorhynchus anatinus
+Macropus eugenii	Eukaryota	Chordata	Mammalia	Diprotodontia	Macropodidae	Notamacropus	Notamacropus eugenii
+Sarcophilus harrisii	Eukaryota	Chordata	Mammalia	Dasyuromorphia	Dasyuridae	Sarcophilus	Sarcophilus harrisii
+Monodelphis domestica	Eukaryota	Chordata	Mammalia	Didelphimorphia	Didelphidae	Monodelphis	Monodelphis domestica
+Echinops telfairi	Eukaryota	Chordata	Mammalia	Afrotheria	Tenrecidae	Echinops	Echinops telfairi
+Procavia capensis	Eukaryota	Chordata	Mammalia	Afrotheria	Procaviidae	Procavia	Procavia capensis
+Loxodonta africana	Eukaryota	Chordata	Mammalia	Afrotheria	Elephantidae	Loxodonta	Loxodonta africana
+Dasypus novemcinctus	Eukaryota	Chordata	Mammalia	Xenarthra	Dasypodidae	Dasypus	Dasypus novemcinctus
+Choloepus hoffmanni	Eukaryota	Chordata	Mammalia	Xenarthra	Megalonychidae	Choloepus	Choloepus hoffmanni
+Ochotona princeps	Eukaryota	Chordata	Mammalia	Euarchontoglires	Ochotonidae	Ochotona	Ochotona princeps
+Oryctolagus cuniculus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Leporidae	Oryctolagus	Oryctolagus cuniculus
+Cavia porcellus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Caviidae	Cavia	Cavia porcellus
+Ictidomys tridecemlineatus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Sciuridae	Ictidomys	Ictidomys tridecemlineatus
+Dipodomys ordii	Eukaryota	Chordata	Mammalia	Euarchontoglires	Heteromyidae	Dipodomys	Dipodomys ordii
+Rattus norvegicus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Muridae	Rattus	Rattus norvegicus
+Mus musculus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Muridae	Mus	Mus musculus
+Tupaia belangeri	Eukaryota	Chordata	Mammalia	Euarchontoglires	Tupaiidae	Tupaia	Tupaia belangeri
+Otolemur garnettii	Eukaryota	Chordata	Mammalia	Euarchontoglires	Galagidae	Otolemur	Otolemur garnettii
+Microcebus murinus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cheirogaleidae	Microcebus	Microcebus murinus
+Tarsius syrichta	Eukaryota	Chordata	Mammalia	Euarchontoglires	Tarsiidae	Carlito	Carlito syrichta
+Callithrix jacchus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cebidae	Callithrix	Callithrix jacchus
+Chlorocebus sabaeus	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cercopithecoidea	Chlorocebus	Chlorocebus sabaeus
+Papio anubis	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cercopithecoidea	Papio	Papio anubis
+Macaca mulatta	Eukaryota	Chordata	Mammalia	Euarchontoglires	Cercopithecoidea	Macaca	Macaca mulatta
+Nomascus leucogenys	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Nomascus	Nomascus leucogenys
+Pongo abelii	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Pongo	Pongo abelii
+Gorilla gorilla gorilla	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Gorilla	Gorilla gorilla
+Pan troglodytes	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Pan	Pan troglodytes
+Homo sapiens	Eukaryota	Chordata	Mammalia	Euarchontoglires	Hominoidea	Homo	Homo sapiens
+Sorex araneus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Soricidae	Sorex	Sorex araneus
+Erinaceus europaeus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Erinaceidae	Erinaceus	Erinaceus europaeus
+Pteropus vampyrus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Pteropodidae	Pteropus	Pteropus vampyrus
+Myotis lucifugus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Vespertilionidae	Myotis	Myotis lucifugus
+Felis catus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Felidae	Felis	Felis catus
+Canis lupus familiaris	Eukaryota	Chordata	Mammalia	Laurasiatheria	Canidae	Canis	Canis lupus
+Mustela putorius furo	Eukaryota	Chordata	Mammalia	Laurasiatheria	Mustelidae	Mustela	Mustela putorius
+Ailuropoda melanoleuca	Eukaryota	Chordata	Mammalia	Laurasiatheria	Ursidae	Ailuropoda	Ailuropoda melanoleuca
+Equus caballus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Equidae	Equus	Equus caballus
+Vicugna pacos	Eukaryota	Chordata	Mammalia	Laurasiatheria	Camelidae	Vicugna	Vicugna pacos
+Sus scrofa	Eukaryota	Chordata	Mammalia	Laurasiatheria	Suidae	Sus	Sus scrofa
+Tursiops truncatus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Delphinidae	Tursiops	Tursiops truncatus
+Ovis aries	Eukaryota	Chordata	Mammalia	Laurasiatheria	Bovidae	Ovis	Ovis aries
+Bos taurus	Eukaryota	Chordata	Mammalia	Laurasiatheria	Bovidae	Bos	Bos taurus
+Anolis carolinensis	Eukaryota	Chordata	NA	Lepidosauria	Dactyloidae	Anolis	Anolis carolinensis
+Pelodiscus sinensis	Eukaryota	Chordata	NA	Testudines	Trionychidae	Pelodiscus	Pelodiscus sinensis
+Taeniopygia guttata	Eukaryota	Chordata	Aves	Neognathae	Passeroidea	Taeniopygia	Taeniopygia guttata
+Ficedula albicollis	Eukaryota	Chordata	Aves	Neognathae	Muscicapidae	Ficedula	Ficedula albicollis
+Anas platyrhynchos	Eukaryota	Chordata	Aves	Neognathae	Anatidae	Anas	Anas platyrhynchos
+Meleagris gallopavo	Eukaryota	Chordata	Aves	Neognathae	Phasianidae	Meleagris	Meleagris gallopavo
+Gallus gallus	Eukaryota	Chordata	Aves	Neognathae	Phasianidae	Gallus	Gallus gallus
+Lepisosteus oculatus	Eukaryota	Chordata	Actinopterygii	Semionotiformes	Lepisosteidae	Lepisosteus	Lepisosteus oculatus
+Danio rerio	Eukaryota	Chordata	Actinopterygii	Cypriniphysae	Cyprinoidea	Danio	Danio rerio
+Astyanax mexicanus	Eukaryota	Chordata	Actinopterygii	Characiphysae	Characidae	Astyanax	Astyanax mexicanus
+Gadus morhua	Eukaryota	Chordata	Actinopterygii	Gadiformes	Gadidae	Gadus	Gadus morhua
+Oreochromis niloticus	Eukaryota	Chordata	Actinopterygii	Cichlomorphae	Cichlidae	Oreochromis	Oreochromis niloticus
+Poecilia formosa	Eukaryota	Chordata	Actinopterygii	Atherinomorphae	Poeciliidae	Poecilia	Poecilia formosa
+Xiphophorus maculatus	Eukaryota	Chordata	Actinopterygii	Atherinomorphae	Poeciliidae	Xiphophorus	Xiphophorus maculatus
+Gasterosteus aculeatus	Eukaryota	Chordata	Actinopterygii	Perciformes	Gasterosteidae	Gasterosteus	Gasterosteus aculeatus
+Tetraodon nigroviridis	Eukaryota	Chordata	Actinopterygii	Tetraodontiformes	Tetradontoidea	Tetraodon	Tetraodon nigroviridis
+Takifugu rubripes	Eukaryota	Chordata	Actinopterygii	Tetraodontiformes	Tetradontoidea	Takifugu	Takifugu rubripes
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/lineage-full.txt	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,62 @@
+Latimeria chalumnae	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	NA	NA	NA	NA	NA	Coelacanthiformes	NA	NA	NA	NA	Coelacanthidae	NA	NA	NA	Latimeria	NA	NA	NA	Latimeria chalumnae	NA	NA	NA
+Xenopus tropicalis	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Amphibia	NA	NA	NA	Batrachia	Anura	NA	NA	NA	Pipoidea	Pipidae	Xenopodinae	NA	NA	Xenopus	Silurana	NA	NA	Xenopus tropicalis	NA	NA	NA
+Ornithorhynchus anatinus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	NA	Monotremata	NA	NA	NA	NA	Ornithorhynchidae	NA	NA	NA	Ornithorhynchus	NA	NA	NA	Ornithorhynchus anatinus	NA	NA	NA
+Macropus eugenii	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	NA	Diprotodontia	NA	NA	NA	NA	Macropodidae	NA	NA	NA	Notamacropus	NA	NA	NA	Notamacropus eugenii	NA	NA	NA
+Sarcophilus harrisii	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	NA	Dasyuromorphia	NA	NA	NA	NA	Dasyuridae	NA	NA	NA	Sarcophilus	NA	NA	NA	Sarcophilus harrisii	NA	NA	NA
+Monodelphis domestica	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	NA	Didelphimorphia	NA	NA	NA	NA	Didelphidae	Didelphinae	NA	NA	Monodelphis	NA	NA	NA	Monodelphis domestica	NA	NA	NA
+Echinops telfairi	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Afrotheria	NA	NA	NA	NA	NA	Tenrecidae	Tenrecinae	NA	NA	Echinops	NA	NA	NA	Echinops telfairi	NA	NA	NA
+Procavia capensis	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Afrotheria	Hyracoidea	NA	NA	NA	NA	Procaviidae	NA	NA	NA	Procavia	NA	NA	NA	Procavia capensis	NA	NA	NA
+Loxodonta africana	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Afrotheria	Proboscidea	NA	NA	NA	NA	Elephantidae	NA	NA	NA	Loxodonta	NA	NA	NA	Loxodonta africana	NA	NA	NA
+Dasypus novemcinctus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Xenarthra	Cingulata	NA	NA	NA	NA	Dasypodidae	NA	NA	NA	Dasypus	NA	NA	NA	Dasypus novemcinctus	NA	NA	NA
+Choloepus hoffmanni	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Xenarthra	Pilosa	Folivora	NA	NA	NA	Megalonychidae	NA	NA	NA	Choloepus	NA	NA	NA	Choloepus hoffmanni	NA	NA	NA
+Ochotona princeps	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Lagomorpha	NA	NA	NA	NA	Ochotonidae	NA	NA	NA	Ochotona	NA	NA	NA	Ochotona princeps	NA	NA	NA
+Oryctolagus cuniculus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Lagomorpha	NA	NA	NA	NA	Leporidae	NA	NA	NA	Oryctolagus	NA	NA	NA	Oryctolagus cuniculus	NA	NA	NA
+Cavia porcellus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Rodentia	Hystricomorpha	NA	NA	NA	Caviidae	NA	NA	NA	Cavia	NA	NA	NA	Cavia porcellus	NA	NA	NA
+Ictidomys tridecemlineatus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Rodentia	Sciuromorpha	NA	NA	NA	Sciuridae	Xerinae	Marmotini	NA	Ictidomys	NA	NA	NA	Ictidomys tridecemlineatus	NA	NA	NA
+Dipodomys ordii	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Rodentia	Castorimorpha	NA	NA	NA	Heteromyidae	Dipodomyinae	NA	NA	Dipodomys	NA	NA	NA	Dipodomys ordii	NA	NA	NA
+Rattus norvegicus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Rodentia	Myomorpha	NA	NA	NA	Muridae	Murinae	NA	NA	Rattus	NA	NA	NA	Rattus norvegicus	NA	NA	NA
+Mus musculus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Rodentia	Myomorpha	NA	NA	NA	Muridae	Murinae	NA	NA	Mus	Mus	NA	NA	Mus musculus	NA	NA	NA
+Tupaia belangeri	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Scandentia	NA	NA	NA	NA	Tupaiidae	NA	NA	NA	Tupaia	NA	NA	NA	Tupaia belangeri	NA	NA	NA
+Otolemur garnettii	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Strepsirrhini	Lorisiformes	NA	NA	Galagidae	NA	NA	NA	Otolemur	NA	NA	NA	Otolemur garnettii	NA	NA	NA
+Microcebus murinus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Strepsirrhini	Lemuriformes	NA	NA	Cheirogaleidae	NA	NA	NA	Microcebus	NA	NA	NA	Microcebus murinus	NA	NA	NA
+Tarsius syrichta	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Tarsiiformes	NA	NA	Tarsiidae	NA	NA	NA	Carlito	NA	NA	NA	Carlito syrichta	NA	NA	NA
+Callithrix jacchus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Simiiformes	Platyrrhini	NA	Cebidae	Callitrichinae	NA	NA	Callithrix	Callithrix	NA	NA	Callithrix jacchus	NA	NA	NA
+Chlorocebus sabaeus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Simiiformes	Catarrhini	Cercopithecoidea	Cercopithecidae	Cercopithecinae	NA	NA	Chlorocebus	NA	NA	NA	Chlorocebus sabaeus	NA	NA	NA
+Papio anubis	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Simiiformes	Catarrhini	Cercopithecoidea	Cercopithecidae	Cercopithecinae	NA	NA	Papio	NA	NA	NA	Papio anubis	NA	NA	NA
+Macaca mulatta	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Simiiformes	Catarrhini	Cercopithecoidea	Cercopithecidae	Cercopithecinae	NA	NA	Macaca	NA	NA	NA	Macaca mulatta	NA	NA	NA
+Nomascus leucogenys	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Simiiformes	Catarrhini	Hominoidea	Hylobatidae	NA	NA	NA	Nomascus	NA	NA	NA	Nomascus leucogenys	NA	NA	NA
+Pongo abelii	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Simiiformes	Catarrhini	Hominoidea	Hominidae	Ponginae	NA	NA	Pongo	NA	NA	NA	Pongo abelii	NA	NA	NA
+Gorilla gorilla gorilla	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Simiiformes	Catarrhini	Hominoidea	Hominidae	Homininae	NA	NA	Gorilla	NA	NA	NA	Gorilla gorilla	Gorilla gorilla gorilla	NA	NA
+Pan troglodytes	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Simiiformes	Catarrhini	Hominoidea	Hominidae	Homininae	NA	NA	Pan	NA	NA	NA	Pan troglodytes	NA	NA	NA
+Homo sapiens	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Euarchontoglires	Primates	Haplorrhini	Simiiformes	Catarrhini	Hominoidea	Hominidae	Homininae	NA	NA	Homo	NA	NA	NA	Homo sapiens	NA	NA	NA
+Sorex araneus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Insectivora	NA	NA	NA	NA	Soricidae	Soricinae	NA	NA	Sorex	NA	NA	NA	Sorex araneus	NA	NA	NA
+Erinaceus europaeus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Insectivora	NA	NA	NA	NA	Erinaceidae	Erinaceinae	NA	NA	Erinaceus	NA	NA	NA	Erinaceus europaeus	NA	NA	NA
+Pteropus vampyrus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Chiroptera	Megachiroptera	NA	NA	NA	Pteropodidae	Pteropodinae	NA	NA	Pteropus	NA	NA	NA	Pteropus vampyrus	NA	NA	NA
+Myotis lucifugus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Chiroptera	Microchiroptera	NA	NA	NA	Vespertilionidae	NA	NA	NA	Myotis	NA	NA	NA	Myotis lucifugus	NA	NA	NA
+Felis catus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Carnivora	Feliformia	NA	NA	NA	Felidae	Felinae	NA	NA	Felis	NA	NA	NA	Felis catus	NA	NA	NA
+Canis lupus familiaris	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Carnivora	Caniformia	NA	NA	NA	Canidae	NA	NA	NA	Canis	NA	NA	NA	Canis lupus	Canis lupus familiaris	NA	NA
+Mustela putorius furo	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Carnivora	Caniformia	NA	NA	NA	Mustelidae	Mustelinae	NA	NA	Mustela	NA	NA	NA	Mustela putorius	Mustela putorius furo	NA	NA
+Ailuropoda melanoleuca	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Carnivora	Caniformia	NA	NA	NA	Ursidae	NA	NA	NA	Ailuropoda	NA	NA	NA	Ailuropoda melanoleuca	NA	NA	NA
+Equus caballus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Perissodactyla	NA	NA	NA	NA	Equidae	NA	NA	NA	Equus	Equus	NA	NA	Equus caballus	NA	NA	NA
+Vicugna pacos	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	NA	Tylopoda	NA	NA	NA	Camelidae	NA	NA	NA	Vicugna	NA	NA	NA	Vicugna pacos	NA	NA	NA
+Sus scrofa	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	NA	NA	Suina	NA	NA	Suidae	NA	NA	NA	Sus	NA	NA	NA	Sus scrofa	NA	NA	NA
+Tursiops truncatus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	Cetacea	Odontoceti	NA	NA	NA	Delphinidae	NA	NA	NA	Tursiops	NA	NA	NA	Tursiops truncatus	NA	NA	NA
+Ovis aries	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	NA	Ruminantia	Pecora	NA	NA	Bovidae	Caprinae	NA	NA	Ovis	NA	NA	NA	Ovis aries	NA	NA	NA
+Bos taurus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Mammalia	NA	NA	NA	Laurasiatheria	NA	Ruminantia	Pecora	NA	NA	Bovidae	Bovinae	NA	NA	Bos	NA	NA	NA	Bos taurus	NA	NA	NA
+Anolis carolinensis	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	NA	NA	NA	NA	Lepidosauria	Squamata	Iguania	NA	NA	NA	Dactyloidae	NA	NA	NA	Anolis	NA	NA	NA	Anolis carolinensis	NA	NA	NA
+Pelodiscus sinensis	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	NA	NA	NA	NA	NA	Testudines	Cryptodira	NA	NA	NA	Trionychidae	NA	NA	NA	Pelodiscus	NA	NA	NA	Pelodiscus sinensis	NA	NA	NA
+Taeniopygia guttata	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Aves	NA	NA	NA	Neognathae	Passeriformes	NA	NA	NA	Passeroidea	Estrildidae	Estrildinae	NA	NA	Taeniopygia	NA	NA	NA	Taeniopygia guttata	NA	NA	NA
+Ficedula albicollis	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Aves	NA	NA	NA	Neognathae	Passeriformes	NA	NA	NA	NA	Muscicapidae	NA	NA	NA	Ficedula	NA	NA	NA	Ficedula albicollis	NA	NA	NA
+Anas platyrhynchos	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Aves	NA	NA	NA	Neognathae	Anseriformes	NA	NA	NA	NA	Anatidae	NA	NA	NA	Anas	NA	NA	NA	Anas platyrhynchos	NA	NA	NA
+Meleagris gallopavo	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Aves	NA	NA	NA	Neognathae	Galliformes	NA	NA	NA	NA	Phasianidae	Meleagridinae	NA	NA	Meleagris	NA	NA	NA	Meleagris gallopavo	NA	NA	NA
+Gallus gallus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	NA	Aves	NA	NA	NA	Neognathae	Galliformes	NA	NA	NA	NA	Phasianidae	Phasianinae	NA	NA	Gallus	NA	NA	NA	Gallus gallus	NA	NA	NA
+Lepisosteus oculatus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Holostei	NA	NA	Semionotiformes	NA	NA	NA	NA	Lepisosteidae	NA	NA	NA	Lepisosteus	NA	NA	NA	Lepisosteus oculatus	NA	NA	NA
+Danio rerio	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Teleostei	NA	Cypriniphysae	Cypriniformes	NA	NA	NA	Cyprinoidea	Cyprinidae	NA	NA	NA	Danio	NA	NA	NA	Danio rerio	NA	NA	NA
+Astyanax mexicanus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Teleostei	NA	Characiphysae	Characiformes	Characoidei	NA	NA	NA	Characidae	NA	NA	NA	Astyanax	NA	NA	NA	Astyanax mexicanus	NA	NA	NA
+Gadus morhua	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Teleostei	NA	NA	Gadiformes	Gadoidei	NA	NA	NA	Gadidae	NA	NA	NA	Gadus	NA	NA	NA	Gadus morhua	NA	NA	NA
+Oreochromis niloticus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Teleostei	NA	Cichlomorphae	Cichliformes	NA	NA	NA	NA	Cichlidae	Pseudocrenilabrinae	Oreochromini	NA	Oreochromis	NA	NA	NA	Oreochromis niloticus	NA	NA	NA
+Poecilia formosa	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Teleostei	NA	Atherinomorphae	Cyprinodontiformes	Cyprinodontoidei	NA	NA	NA	Poeciliidae	Poeciliinae	NA	NA	Poecilia	NA	NA	NA	Poecilia formosa	NA	NA	NA
+Xiphophorus maculatus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Teleostei	NA	Atherinomorphae	Cyprinodontiformes	Cyprinodontoidei	NA	NA	NA	Poeciliidae	Poeciliinae	NA	NA	Xiphophorus	NA	NA	NA	Xiphophorus maculatus	NA	NA	NA
+Gasterosteus aculeatus	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Teleostei	NA	NA	Perciformes	Cottioidei	Gasterosteales	NA	NA	Gasterosteidae	NA	NA	NA	Gasterosteus	NA	NA	NA	Gasterosteus aculeatus	NA	NA	NA
+Tetraodon nigroviridis	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Teleostei	NA	NA	Tetraodontiformes	Tetraodontoidei	NA	NA	Tetradontoidea	Tetraodontidae	NA	NA	NA	Tetraodon	NA	NA	NA	Tetraodon nigroviridis	NA	NA	NA
+Takifugu rubripes	Eukaryota	Metazoa	NA	NA	Chordata	Craniata	Actinopterygii	Actinopteri	Neopterygii	Teleostei	NA	NA	Tetraodontiformes	Tetraodontoidei	NA	NA	Tetradontoidea	Tetraodontidae	NA	NA	NA	Takifugu	NA	NA	NA	Takifugu rubripes	NA	NA	NA
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/lineage.txt	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,62 @@
+Latimeria chalumnae	Metazoa	Chordata	NA	Coelacanthiformes	Coelacanthidae	Latimeria	Latimeria chalumnae
+Xenopus tropicalis	Metazoa	Chordata	Amphibia	Anura	Pipidae	Xenopus	Xenopus tropicalis
+Ornithorhynchus anatinus	Metazoa	Chordata	Mammalia	Monotremata	Ornithorhynchidae	Ornithorhynchus	Ornithorhynchus anatinus
+Macropus eugenii	Metazoa	Chordata	Mammalia	Diprotodontia	Macropodidae	Notamacropus	Notamacropus eugenii
+Sarcophilus harrisii	Metazoa	Chordata	Mammalia	Dasyuromorphia	Dasyuridae	Sarcophilus	Sarcophilus harrisii
+Monodelphis domestica	Metazoa	Chordata	Mammalia	Didelphimorphia	Didelphidae	Monodelphis	Monodelphis domestica
+Echinops telfairi	Metazoa	Chordata	Mammalia	NA	Tenrecidae	Echinops	Echinops telfairi
+Procavia capensis	Metazoa	Chordata	Mammalia	Hyracoidea	Procaviidae	Procavia	Procavia capensis
+Loxodonta africana	Metazoa	Chordata	Mammalia	Proboscidea	Elephantidae	Loxodonta	Loxodonta africana
+Dasypus novemcinctus	Metazoa	Chordata	Mammalia	Cingulata	Dasypodidae	Dasypus	Dasypus novemcinctus
+Choloepus hoffmanni	Metazoa	Chordata	Mammalia	Pilosa	Megalonychidae	Choloepus	Choloepus hoffmanni
+Ochotona princeps	Metazoa	Chordata	Mammalia	Lagomorpha	Ochotonidae	Ochotona	Ochotona princeps
+Oryctolagus cuniculus	Metazoa	Chordata	Mammalia	Lagomorpha	Leporidae	Oryctolagus	Oryctolagus cuniculus
+Cavia porcellus	Metazoa	Chordata	Mammalia	Rodentia	Caviidae	Cavia	Cavia porcellus
+Ictidomys tridecemlineatus	Metazoa	Chordata	Mammalia	Rodentia	Sciuridae	Ictidomys	Ictidomys tridecemlineatus
+Dipodomys ordii	Metazoa	Chordata	Mammalia	Rodentia	Heteromyidae	Dipodomys	Dipodomys ordii
+Rattus norvegicus	Metazoa	Chordata	Mammalia	Rodentia	Muridae	Rattus	Rattus norvegicus
+Mus musculus	Metazoa	Chordata	Mammalia	Rodentia	Muridae	Mus	Mus musculus
+Tupaia belangeri	Metazoa	Chordata	Mammalia	Scandentia	Tupaiidae	Tupaia	Tupaia belangeri
+Otolemur garnettii	Metazoa	Chordata	Mammalia	Primates	Galagidae	Otolemur	Otolemur garnettii
+Microcebus murinus	Metazoa	Chordata	Mammalia	Primates	Cheirogaleidae	Microcebus	Microcebus murinus
+Tarsius syrichta	Metazoa	Chordata	Mammalia	Primates	Tarsiidae	Carlito	Carlito syrichta
+Callithrix jacchus	Metazoa	Chordata	Mammalia	Primates	Cebidae	Callithrix	Callithrix jacchus
+Chlorocebus sabaeus	Metazoa	Chordata	Mammalia	Primates	Cercopithecidae	Chlorocebus	Chlorocebus sabaeus
+Papio anubis	Metazoa	Chordata	Mammalia	Primates	Cercopithecidae	Papio	Papio anubis
+Macaca mulatta	Metazoa	Chordata	Mammalia	Primates	Cercopithecidae	Macaca	Macaca mulatta
+Nomascus leucogenys	Metazoa	Chordata	Mammalia	Primates	Hylobatidae	Nomascus	Nomascus leucogenys
+Pongo abelii	Metazoa	Chordata	Mammalia	Primates	Hominidae	Pongo	Pongo abelii
+Gorilla gorilla gorilla	Metazoa	Chordata	Mammalia	Primates	Hominidae	Gorilla	Gorilla gorilla
+Pan troglodytes	Metazoa	Chordata	Mammalia	Primates	Hominidae	Pan	Pan troglodytes
+Homo sapiens	Metazoa	Chordata	Mammalia	Primates	Hominidae	Homo	Homo sapiens
+Sorex araneus	Metazoa	Chordata	Mammalia	Insectivora	Soricidae	Sorex	Sorex araneus
+Erinaceus europaeus	Metazoa	Chordata	Mammalia	Insectivora	Erinaceidae	Erinaceus	Erinaceus europaeus
+Pteropus vampyrus	Metazoa	Chordata	Mammalia	Chiroptera	Pteropodidae	Pteropus	Pteropus vampyrus
+Myotis lucifugus	Metazoa	Chordata	Mammalia	Chiroptera	Vespertilionidae	Myotis	Myotis lucifugus
+Felis catus	Metazoa	Chordata	Mammalia	Carnivora	Felidae	Felis	Felis catus
+Canis lupus familiaris	Metazoa	Chordata	Mammalia	Carnivora	Canidae	Canis	Canis lupus
+Mustela putorius furo	Metazoa	Chordata	Mammalia	Carnivora	Mustelidae	Mustela	Mustela putorius
+Ailuropoda melanoleuca	Metazoa	Chordata	Mammalia	Carnivora	Ursidae	Ailuropoda	Ailuropoda melanoleuca
+Equus caballus	Metazoa	Chordata	Mammalia	Perissodactyla	Equidae	Equus	Equus caballus
+Vicugna pacos	Metazoa	Chordata	Mammalia	NA	Camelidae	Vicugna	Vicugna pacos
+Sus scrofa	Metazoa	Chordata	Mammalia	NA	Suidae	Sus	Sus scrofa
+Tursiops truncatus	Metazoa	Chordata	Mammalia	Cetacea	Delphinidae	Tursiops	Tursiops truncatus
+Ovis aries	Metazoa	Chordata	Mammalia	NA	Bovidae	Ovis	Ovis aries
+Bos taurus	Metazoa	Chordata	Mammalia	NA	Bovidae	Bos	Bos taurus
+Anolis carolinensis	Metazoa	Chordata	NA	Squamata	Dactyloidae	Anolis	Anolis carolinensis
+Pelodiscus sinensis	Metazoa	Chordata	NA	Testudines	Trionychidae	Pelodiscus	Pelodiscus sinensis
+Taeniopygia guttata	Metazoa	Chordata	Aves	Passeriformes	Estrildidae	Taeniopygia	Taeniopygia guttata
+Ficedula albicollis	Metazoa	Chordata	Aves	Passeriformes	Muscicapidae	Ficedula	Ficedula albicollis
+Anas platyrhynchos	Metazoa	Chordata	Aves	Anseriformes	Anatidae	Anas	Anas platyrhynchos
+Meleagris gallopavo	Metazoa	Chordata	Aves	Galliformes	Phasianidae	Meleagris	Meleagris gallopavo
+Gallus gallus	Metazoa	Chordata	Aves	Galliformes	Phasianidae	Gallus	Gallus gallus
+Lepisosteus oculatus	Metazoa	Chordata	Actinopteri	Semionotiformes	Lepisosteidae	Lepisosteus	Lepisosteus oculatus
+Danio rerio	Metazoa	Chordata	Actinopteri	Cypriniformes	Cyprinidae	Danio	Danio rerio
+Astyanax mexicanus	Metazoa	Chordata	Actinopteri	Characiformes	Characidae	Astyanax	Astyanax mexicanus
+Gadus morhua	Metazoa	Chordata	Actinopteri	Gadiformes	Gadidae	Gadus	Gadus morhua
+Oreochromis niloticus	Metazoa	Chordata	Actinopteri	Cichliformes	Cichlidae	Oreochromis	Oreochromis niloticus
+Poecilia formosa	Metazoa	Chordata	Actinopteri	Cyprinodontiformes	Poeciliidae	Poecilia	Poecilia formosa
+Xiphophorus maculatus	Metazoa	Chordata	Actinopteri	Cyprinodontiformes	Poeciliidae	Xiphophorus	Xiphophorus maculatus
+Gasterosteus aculeatus	Metazoa	Chordata	Actinopteri	Perciformes	Gasterosteidae	Gasterosteus	Gasterosteus aculeatus
+Tetraodon nigroviridis	Metazoa	Chordata	Actinopteri	Tetraodontiformes	Tetraodontidae	Tetraodon	Tetraodon nigroviridis
+Takifugu rubripes	Metazoa	Chordata	Actinopteri	Tetraodontiformes	Tetraodontidae	Takifugu	Takifugu rubripes
--- a/test-data/out.nhx	Fri Mar 17 16:23:39 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-((((((((((((((((Homosapiens*,Pantroglodytes*,Gorillagorillagorilla*)207598,Pongoabelii*)9604,Nomascusleucogenys*)314295,(Chlorocebussabaeus*,Macacamulatta*,Papioanubis*)9528)9526,Callithrixjacchus*)314293,Tarsiussyrichta*)376913,(Microcebusmurinus*,Otolemurgarnettii*)376911)9443,((Oryctolaguscuniculus*,Ochotonaprinceps*)9975,(((Rattusnorvegicus*,Musmusculus*)39107,Dipodomysordii*,Ictidomystridecemlineatus*)33553,Caviaporcellus*)9989)314147,Tupaiabelangeri*)314146,(((Ailuropodamelanoleuca*,Canislupusfamiliaris*,Mustelaputoriusfuro*)379584,Feliscatus*)33554,(Erinaceuseuropaeus*,Sorexaraneus*)9362,(Myotislucifugus*,Pteropusvampyrus*)9397,((Ovisaries*,Bostaurus*)9895,Vicugnapacos*,Susscrofa*,Tursiopstruncatus*)91561,Equuscaballus*)314145)1437010,(Dasypusnovemcinctus*,Choloepushoffmanni*)9348,(Echinopstelfairi*,Loxodontaafricana*,Procaviacapensis*)311790)9347,(Sarcophilusharrisii*,Macropuseugenii*,Monodelphisdomestica*)9263)32525,Ornithorhynchusanatinus*)40674,((Pelodiscussinensis*,(((Meleagrisgallopavo*,Gallusgallus*)9005,Anasplatyrhynchos*)1549675,(Ficedulaalbicollis*,Taeniopygiaguttata*)9126)8825)1329799,Anoliscarolinensis*)32561)32524,Xenopustropicalis*)32523,Latimeriachalumnae*)8287,(((Daniorerio*,Astyanaxmexicanus*)186626,((((Tetraodonnigroviridis*,Takifugurubripes*)31031,Gasterosteusaculeatus*)1489922,((Poeciliaformosa*,Xiphophorusmaculatus*)586240,Oreochromisniloticus*)1489908)1489872,Gadusmorhua*)123368)186625,Lepisosteusoculatus*)41665)root;
\ No newline at end of file
Binary file test-data/taxdump.sqlite has changed
Binary file test-data/taxdump.tar.gz has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree1.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,2 @@
+((A,B),C);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree1_ladder.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,1 @@
+(C:2,(A:1,B:1)1:1);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree1_ogA.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,1 @@
+(A:2.5,(B:1.25,C:1.25)1:1.25);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree1_pruneAC.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,1 @@
+(C:1,A:1);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree1_pruneACpreserve.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,1 @@
+(C:2,A:2);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree1_unroot.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,1 @@
+(C:1,A:1,B:1);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree1_unroot_resolve.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,1 @@
+((A:0.5,B:0.5)0:0.5,C:1);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree2.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,2 @@
+((C,A),B);
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree2_sort.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,1 @@
+((A:1,C:1)1:1,B:2);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree3.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,1 @@
+(C:1,(A:1):1,B:1);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/tree3_stand.nhx	Tue Nov 07 11:45:13 2017 -0500
@@ -0,0 +1,1 @@
+((B:1,A:1)0:1,C:2);