SumTrees Run Problem

418 views
Skip to first unread message

William Gearty

unread,
Dec 14, 2013, 5:05:58 PM12/14/13
to dendrop...@googlegroups.com
I am trying to use SumTrees to make a majority consensus tree with a large number of bootstrap trees that I have produced with another program.
I have installed the DendroPy library and can successfully call sumtrees.py.
However, whenever I call sumtrees.py I always get the same message:

C:\Users\Will>sumtrees.py
======================================================================
SumTrees - Phylogenetic Tree Split Support Summarization
Version 3.3.1 (May 05 2011)
By Jeet Sukumaran and Mark T. Holder
(using the DendroPy Phylogenetic Computing Library Version 3.12.0)
======================================================================
SumTrees: No sources of input trees specified. Please provide the path to at
          least one (valid and existing) file containing tree samples to
          summarize. See '--help' for other options.
C:\Users\Will>

If I enter "sumtree.py --help", I still get the same message:

C:\Users\Will>sumtrees.py --help
======================================================================
SumTrees - Phylogenetic Tree Split Support Summarization
Version 3.3.1 (May 05 2011)
By Jeet Sukumaran and Mark T. Holder
(using the DendroPy Phylogenetic Computing Library Version 3.12.0)
======================================================================
SumTrees: No sources of input trees specified. Please provide the path to at
          least one (valid and existing) file containing tree samples to
          summarize. See '--help' for other options.
C:\Users\Will>

Even if I call sumtrees and include a tree file in nexus format, I still get this same message.
Do you have any idea what may be the problem?
I am using Anaconda to run Python 2.7.5:

C:\Users\Will>python
Python 2.7.5 |Anaconda 1.8.0 (64-bit)| (default, Jul  1 2013, 12:37:52) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

Jeet Sukumaran

unread,
Dec 16, 2013, 5:08:50 PM12/16/13
to dendrop...@googlegroups.com
As the error message indicates, you need to actually pass in the path of a file to process.

William Gearty

unread,
Dec 16, 2013, 6:48:55 PM12/16/13
to dendrop...@googlegroups.com
I have tried that:

C:\Users\Will\Documents\My Box Files\Dropbox\YALE\E&EB 426-7\Lab Project\GARLI Bootstrap>sumtrees.py all.tre
======================================================================
SumTrees - Phylogenetic Tree Split Support Summarization
Version 3.3.1 (May 05 2011)
By Jeet Sukumaran and Mark T. Holder
(using the DendroPy Phylogenetic Computing Library Version 3.12.0)
======================================================================

SumTrees: No sources of input trees specified. Please provide the path to at
          least one (valid and existing) file containing tree samples to
          summarize. See '--help' for other options.

Jeet Sukumaran

unread,
Dec 16, 2013, 8:17:09 PM12/16/13
to dendrop...@googlegroups.com
Assuming that "all.tre" is actually in the current working directory, then from what I can make out this is a problem with the way the Python installation is interacting with the shell, rather than DendroPy. This error message is emitted when no positional arguments are detected by the Python standard library 'optparse' module. For some reason the argument is not being properly processed by the Python interprete or the Python `optparse` module. I do not know if this is an issue, but you do happen to be very brave with respect to the characters you allow on your directory path (e.g., the spaces and the ampersand), and maybe trying this in a saner directory (e.g, "C:\Users\Will\Documents\project1") might help? Alternatively if Windows supports piping, you could stream the trees and pipe to `sumtrees.py` using the "--from-newick-stream" or "--from-nexus-stream" arguments?
Message has been deleted

William Gearty

unread,
Dec 16, 2013, 8:43:43 PM12/16/13
to dendrop...@googlegroups.com
First of all, thanks for responding to this problem.
So here goes...
I have tried running the same agrument from my desktop (after moving the file to my desktop of course):

C:\Users\Will\Desktop>sumtrees.py all.tre
======================================================================
SumTrees - Phylogenetic Tree Split Support Summarization
Version 3.3.1 (May 05 2011)
By Jeet Sukumaran and Mark T. Holder
(using the DendroPy Phylogenetic Computing Library Version 3.12.0)
======================================================================

SumTrees: No sources of input trees specified. Please provide the path to at
          least one (valid and existing) file containing tree samples to
          summarize. See '--help' for other options.

As I said before, I am using anaconda to run python. Could that cause this problem?
I'm not familiar with pipelining in Windows; however, I don't have the widest background in computer science.

Jeet Sukumaran

unread,
Dec 16, 2013, 8:49:37 PM12/16/13
to dendrop...@googlegroups.com
I am not familiar with Anaconda, and I am not sure if there is anything special you need to do to pass scripts arguments under it.

Try the following under Anaconda:

    #! /usr/bin/env python

    from optparse import OptionParser

    parser = OptionParser()
    (opts, args) = parser.parse_args()
    print "%d arguments: " % len(args)
    for a in args:
        print "'%s'" % a

Save it as a script, make it executable, etc. etc. --- basically set it up so that it is invoked/executed/run the same was as sumtrees.

Then run it with a sample of arguments and see the response (e.g., "> test.py one two three").

William Gearty

unread,
Dec 16, 2013, 9:02:21 PM12/16/13
to dendrop...@googlegroups.com
I have saved the script as test.py and invoked it in the following manner:

C:\Users\Will\Desktop>python test.py all.tre
1 arguments:
'all.tre'

C:\Users\Will\Desktop>python test.py all.tre -help
Usage: test.py [options]

Options:
  -h, --help  show this help message and exit

William Gearty

unread,
Dec 16, 2013, 9:08:38 PM12/16/13
to dendrop...@googlegroups.com
I think I may have found the problem!
I tried calling sumtrees.py from within the scripts folder, and the --help command worked.
If I call summtrees.py in the following manner it works:

C:\Users\Will\Desktop>python C:\Users\Will\Anaconda\Scripts\sumtrees.py all.tre
======================================================================
SumTrees - Phylogenetic Tree Split Support Summarization
Version 3.3.1 (May 05 2011)
By Jeet Sukumaran and Mark T. Holder
(using the DendroPy Phylogenetic Computing Library Version 3.12.0)
======================================================================

SumTrees: Running in serial mode.
SumTrees: 1 source(s) to be processed.
SumTrees: Processing 1 of 1: 'all.tre'
SumTrees: (processing) 'all.tre': tree at offset 500
SumTrees: (processing) 'all.tre': tree at offset 1000
SumTrees: (processing) 'all.tre': tree at offset 1500

However, sumtrees.py should be in my PATH. Is there any way to call it without including the whole file destination?
If not, I think I can handle having to type in the whole destination.

Jeet Sukumaran

unread,
Dec 16, 2013, 9:15:12 PM12/16/13
to dendrop...@googlegroups.com
I am not sure about how to do this in Windows. On POSIX-like systems, this is trivial to do by either copying the script to the system path or adding the script directory to the system path. Can you not do this in Windows? Otherwise, have a look here: http://docs.python.org/2/faq/windows

Jeet Sukumaran

unread,
Dec 16, 2013, 9:23:43 PM12/16/13
to dendrop...@googlegroups.com

William Gearty

unread,
Dec 16, 2013, 9:33:35 PM12/16/13
to dendrop...@googlegroups.com
Well both python and the summtrees.py file are in my PATH.
But I guess you can't call a file from outside of the CD (even if it is in your PATH) if you have already typed a command?
See here:
>python sumtrees.py --help
Shows sumtrees.py is not a valid file (when I am in another directory).
>python C:\Users\Will\Anaconda\Scripts\sumtrees.py all.tre
This runs the analysis because I explicitly call the actual location of the file.

Eh, I think I can handle that.
Thanks again for all of your help.
Reply all
Reply to author
Forward
0 new messages