Skip to content

Commit 272a5a3

Browse files
author
Jon Hill
committed
* Trees now have names to make it easier to identify
* Clearer error messages when parsing trees * A number of minor bug fixes * Fixes to import and export trees * Fixes to the mac port to allow command line interaction
2 parents 3130665 + c6e29a8 commit 272a5a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+502
-245
lines changed

debian/changelog

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
supertree-toolkit (12) precise; urgency=low
1+
supertree-toolkit (2.13) precise; urgency=low
2+
3+
* Trees now have names to make it easier to identify
4+
* Clearer error messages when parsing trees
5+
* A number of minor bug fixes
6+
* Fixes to import and export trees
7+
* Fixes to the mac port to allow command line interaction
8+
9+
-- Jon Hill <[email protected]> Wed, 03 Dec 2014 08:14:13 +0000
10+
11+
supertree-toolkit (2.12) precise; urgency=low
212

313
* Bug fixes to substitutions
414
* New option on subs to match taxa at genera level

doc/gui.rst

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ JabRef, but your mileage with other reference managers may vary.
9393
Once you have a Bibtex file you can import it using the File->Import from
9494
bibliography and import your file. This should import all the papers in that
9595
bibtex file and create a source for each one (Fig. :num:`#img-stk-source`). These
96-
are then named in a sensible way and sorted alphabetically. You can then start
97-
editing your data.
96+
are then named in a sensible way and sorted alphabetically. The standard source
97+
name is the author followed by year. Once the sources are created,
98+
you can then start editing your data.
9899

99100
.. _img-stk-source:
100101

@@ -122,7 +123,9 @@ button will then appear in the status bar, in the lower left of the GUI (Fig.
122123

123124
The import tree button. Click to import a tree into a source.
124125

125-
Once done, your tree string will appear in the data panel.
126+
Once done, your tree string will appear in the data panel. This will also name the tree in the STK. The names
127+
follow a standard pattern of "Source_name_d" where d is a number starting from 1. You can manually
128+
edit the tree name if you wish.
126129

127130
.. warning:: Avoid non-standard characters in taxa names. Your names *must* not contain commas,
128131
parentheses, colons, asterisks, hyphens, slashes or percentage signs (percentage signs are allowed for non-monophyletic taxa - see later).
@@ -192,8 +195,8 @@ number of trees in the dataset, the taxa list, character list, and years (Fig.
192195
required. This can be used to **carefully** check the taxa list for
193196
user errors, for example
194197

195-
.. note:: Incomplete data (with blue elements) may not produce a data summary.
196-
198+
.. note:: Incomplete data (with blue elements) may not produce a sensible data summary.
199+
197200
.. note:: See the tutorial for more information on how nomenclature and taxonomy should be standardised.
198201

199202
.. _img-stk-data-summary:
@@ -208,8 +211,12 @@ user errors, for example
208211

209212
Two other functions can also be useful to check the data (and prevent errors
210213
when using other functions). *Clean Data* removes non-informative trees.
214+
215+
.. warning:: Do not use Clean Data on partial datasets. It will delete empty sources
216+
for example, which may not be what you wish to happen.
217+
211218
*Standardise source names* ensures all source names are unique and will re-sort
212-
the sources alphabetically.
219+
the sources alphabetically. It will also standardise all tree names.
213220

214221
Processing data
215222
---------------
@@ -258,7 +265,10 @@ the level of overlap (default is 2), which is the number of taxa trees should
258265
have in common to be considered connected. The two graphic check boxes will show
259266
a window with the result as a graphic. There are two options; the normal graphic
260267
(Fig :num:`#img-stk-data-overlap-simple`) and detailed graphic (Fig
261-
:num:`#img-stk-data-overlap-detailed`).
268+
:num:`#img-stk-data-overlap-detailed`). All graphics show each tree or group
269+
of trees as a circle, labelled by a number. The window also contains a list which
270+
maps the number to a tree name, allowing you to delete any trees that don't
271+
sufficiently overlap.
262272

263273
.. _img-stk-data-overlap-gui:
264274

@@ -364,7 +374,7 @@ used. This creates a number of trees per source tree, each with a different
364374
combination of the non-monophyletic taxa. Note that this
365375
produces a tree file containing the unique trees only or a matrix for each
366376
source tree in the dataset. The output are stored in the given format, with each
367-
tree permuted stored in a seperate directory, given by the tree name (e.g.
377+
tree permuted stored in a separate directory, given by the tree name (e.g.
368378
Hill_etal_2001_1). The filename given is used, making it easy to script the
369379
creation of the mini-supertrees.
370380

macosx/stk.bundle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@
5050

5151
<!-- Add STK data to bundle -->
5252

53-
<data dest="${bundle}/Contents/share/schemata/stk/phylo_storage.rng">
53+
<data dest="${bundle}/Contents/schema/phylo_storage.rng">
5454
${project}/../schema/phylo_storage.rng
5555
</data>
56-
<data dest="${bundle}/Contents/share/schemata/stk/analyses.rng">
56+
<data dest="${bundle}/Contents/schema/analyses.rng">
5757
${project}/../schema/analyses.rng
5858
</data>
59-
<data dest="${bundle}/Contents/share/schemata/stk/characters.rng">
59+
<data dest="${bundle}/Contents/schema/characters.rng">
6060
${project}/../schema/characters.rng
6161
</data>
62-
<data dest="${bundle}/Contents/Resources">
62+
<data dest="${bundle}/Contents/">
6363
${project}/../stk_gui/gui/gui.glade
6464
</data>
6565
<data dest="${bundle}/Contents/Resources/lib/python2.7/site-packages/plugins">

macosx/stk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ fi
6262

6363
#Note that we're calling $PYTHON here to override the version in
6464
#pygtk-demo's shebang.
65-
$EXEC $PYTHON "$bundle_contents/MacOS/stk-bin"
65+
$EXEC $PYTHON "$bundle_contents/MacOS/stk-bin" $@

macosx/stk_cli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ fi
6363

6464
#Note that we're calling $PYTHON here to override the version in
6565
#pygtk-demo's shebang.
66-
$EXEC $PYTHON "$bundle_res/bin/stk_cli"
66+
$EXEC $PYTHON "$bundle_res/bin/stk_cli" $@

schema/phylo_storage.rnc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ source=
6767
},
6868
## This is a source tree and associated meta-data
6969
element source_tree {
70-
attribute name { string }+,
70+
attribute name { string },
7171
element tree {
7272
## The tree string. This is a Newick/Nexus formatted tree string. You can import
7373
## a file using the "Import tree" button below or copy
@@ -391,7 +391,7 @@ software=
391391
attribute name {string},
392392
attribute version {string},
393393
comment
394-
},
394+
}
395395
)
396396

397397
# Any value in the xml file can be accompanied by a comment

schema/phylo_storage.rng

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ data to the file.</a:documentation>
6161
<ref name="person"/>
6262
<optional>
6363
<element name="institution">
64-
<data type="string" datatypeLibrary=""/>
64+
<ref name="anystring"/>
6565
</element>
6666
</optional>
6767
</element>
@@ -77,11 +77,9 @@ to read in a bibtex file and populate all your bibliographic data</a:documentati
7777
<oneOrMore>
7878
<element name="source_tree">
7979
<a:documentation>This is a source tree and associated meta-data</a:documentation>
80-
<oneOrMore>
81-
<attribute name="name">
82-
<data type="string" datatypeLibrary=""/>
83-
</attribute>
84-
</oneOrMore>
80+
<attribute name="name">
81+
<data type="string" datatypeLibrary=""/>
82+
</attribute>
8583
<element name="tree">
8684
<element name="tree_string">
8785
<a:documentation>The tree string. This is a Newick/Nexus formatted tree string. You can import
@@ -107,7 +105,6 @@ paste a string. Tested using Meqsuite, Treeview, Dendroscope to generate trees.<
107105
the this tree?</a:documentation>
108106
</ref>
109107
</oneOrMore>
110-
<ref name="comment"/>
111108
<optional>
112109
<ref name="software">
113110
<a:documentation>Which software was used?</a:documentation>
@@ -215,7 +212,6 @@ If fossil and extant, which taxa are fossil taxa.</a:documentation>
215212
</element>
216213
</choice>
217214
</element>
218-
<ref name="comment"/>
219215
<element name="character_data">
220216
<a:documentation>This stores the character data used to construct the
221217
source tree(s).</a:documentation>
@@ -228,6 +224,7 @@ source tree(s).</a:documentation>
228224
</ref>
229225
</element>
230226
</oneOrMore>
227+
<ref name="comment"/>
231228
</group>
232229
</define>
233230
<define name="publication">
@@ -522,8 +519,8 @@ source tree(s).</a:documentation>
522519
<attribute name="version">
523520
<data type="string" datatypeLibrary=""/>
524521
</attribute>
522+
<ref name="comment"/>
525523
</element>
526-
<ref name="comment"/>
527524
</define>
528525
<!--
529526
Any value in the xml file can be accompanied by a comment

stk/bzr_version.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"""
66

77
version_info = {'branch_nick': u'release',
8-
'build_date': '2014-06-18 10:07:08 +0100',
8+
'build_date': '2014-12-03 08:18:17 +0000',
99
'clean': None,
10-
'date': '2014-02-27 09:36:09 +0000',
11-
'revision_id': '[email protected]20140227093609-23qpyn96mjvojvk9',
12-
'revno': '12'}
10+
'date': '2014-06-18 10:07:32 +0100',
11+
'revision_id': '[email protected]20140618090732-12x2gza0ljjgumxg',
12+
'revno': '13'}
1313

1414
revisions = {}
1515

stk/scripts/create_colours_itol.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def main():
3939
)
4040
parser.add_argument(
4141
'--level',
42-
choices=['Family','Superfamily','Infraorder','Suborder','Order'],
42+
choices=['Genus','Family','Superfamily','Infraorder','Suborder','Order'],
4343
default='Family',
4444
help="Which taxonomic level to colour at. Note that not all will return data. Family and Order will always work."
4545
)
@@ -97,6 +97,8 @@ def main():
9797
index = 5
9898
elif (level == "Order"):
9999
index = 6
100+
elif (level == "Genus"):
101+
index = 1
100102

101103
if (tree):
102104
tree_data = stk.import_tree(input_file)
@@ -110,7 +112,8 @@ def main():
110112
else:
111113
# grab taxa in dataset - ignore if tree
112114
fileName, fileExtension = os.path.splitext(input_file)
113-
if (fileExtension == 'phyml'):
115+
if (fileExtension == '.phyml'):
116+
print "Parsing PHYML"
114117
XML = stk.load_phyml(input_file)
115118
taxa = stk.get_all_taxa(XML)
116119
else:
@@ -151,7 +154,7 @@ def main():
151154
else:
152155
f.write(t+",#"+output_colours[taxonomy[tt]]+","+taxonomy[tt]+"\n")
153156
except KeyError:
154-
print "Couldn't find "+tt
157+
#print "Couldn't find "+tt
155158
f.write(t+",#000000\n")
156159

157160
f.close()

stk/stk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,8 +1462,12 @@ def convert_file(args):
14621462
new_trees['tree_'+str(i)] = t
14631463
i += 1
14641464
output = supertree_toolkit._amalgamate_trees(new_trees,format=output_format)
1465+
except TreeParseError as detail:
1466+
print detail.msg
1467+
sys.exit(-1)
14651468
except:
1466-
print "Error saving tree"
1469+
print "Error converting tree"
1470+
traceback.print_exc()
14671471
sys.exit(-1)
14681472

14691473

0 commit comments

Comments
 (0)