You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Having issues specifying a usertree in phyml commandline. #2219
I want to know what options of phyml does biopython allows to use. I'm not able to input a usertree. The error says option name u not available.
cmdline = PhymlCommandline(input=combo_phy, datatype='nt', bootstrap=3, u="C:/Users/Shivani/Documents/Research Internship/Files by Dates/August/19 Aug/usertree.nwk")
File "C:\Program Files\Python\lib\site-packages\Bio\Phylo\Applications\_Phyml.py", line 256, in __init__
AbstractCommandline.__init__(self, cmd, **kwargs)
File "C:\Program Files\Python\lib\site-packages\Bio\Application\__init__.py", line 259, in __init__
self.set_parameter(key, value)
File "C:\Program Files\Python\lib\site-packages\Bio\Application\__init__.py", line 373, in set_parameter
raise ValueError("Option name %s was not found." % name)
ValueError: Option name u was not found.
I'm writing a script that'd use phyml commandline by using a usertree to start with.
fromBio.PhyloimportPhyloXMLfromBio.Phylo.ApplicationsimportPhymlCommandlinecmdline=PhymlCommandline(input=combo_phy, datatype='nt', bootstrap=3, u="C:/Users/Shivani/Documents/Research Internship/Files by Dates/August/19 Aug/usertree.nwk")
out_log, err_log=cmdline()
I am reporting a problem with Biopython1.74, Python 3.7.4, and windows 10 home operating
system .
>>> from Bio.Phylo.Applications import PhymlCommandline
>>> help(PhymlCommandline())
Curiously help(PhymlCommandline) or the online API documentation does not work as well, it has to be an instance of the object... there is likely something we can do better there.
Command line tools return an integer value (their "return code"), which by convention is zero for success, and non-zero for failure. In this case, return code 1 means a failure of some kind.
The exact meaning of return codes will depend on the tool, in this case phyml.
At this point I would work directly at the command line to see if I can produce the error, and if there are any clues in the output on screen (e.g. to stderr). What happens at the windows command prompt if you run this?
phyml -i gene2.phy -d nt -u "C:/Users/Shivani/Documents/Research Internship/Files by Dates/August/19 Aug/usertree.nwk"
You will need to make sure you are in the same directory as your input file gene2.phy - are you familiar with the concept of relative paths?
As an aside, having spaces in filenames can make life much harder at the command line - if you can it is usually easier to avoid spaces in your directory and filenames.
Activity
peterjc commentedon Aug 20, 2019
You need to use
input_tree =...rather thanu=...Curiously
help(PhymlCommandline)or the online API documentation does not work as well, it has to be an instance of the object... there is likely something we can do better there.shivanishrm commentedon Aug 20, 2019
Sir, I tried that as well.
I got the following error:
(Peter: Edited to add triple back-ticks before and after the code blocks, to display better here on GitHub)
peterjc commentedon Aug 20, 2019
Command line tools return an integer value (their "return code"), which by convention is zero for success, and non-zero for failure. In this case, return code 1 means a failure of some kind.
The exact meaning of return codes will depend on the tool, in this case
phyml.At this point I would work directly at the command line to see if I can produce the error, and if there are any clues in the output on screen (e.g. to
stderr). What happens at the windows command prompt if you run this?You will need to make sure you are in the same directory as your input file
gene2.phy- are you familiar with the concept of relative paths?As an aside, having spaces in filenames can make life much harder at the command line - if you can it is usually easier to avoid spaces in your directory and filenames.
shivanishrm commentedon Aug 21, 2019
Hi. I'm getting the results, when I type this command
nt -u "C:/Users/Shivani/Documents/Research Internship/Files by Dates/August/19 Aug/usertree.nwk"
I am familiar with relative paths so cd to the directory where gene2.phy was.
Output look like this:
(Peter: Added triple back ticks for better display on GitHub)
peterjc commentedon Aug 21, 2019
I'm guessing that you mean you ran this command:
not just:
Given it works at the command line, and assuming your working directory is the same, I would want to see the stdout/stderr from within Python:
Or, perhaps more simply:
It looks like we don't have an example using
ApplicationErrorin the tutorial right now... we should.shivanishrm commentedon Aug 23, 2019
shivanishrm commentedon Aug 23, 2019
peterjc commentedon Aug 23, 2019
Every command line tool defines its own return codes - although often tools will just use 0 for success, and 1 for failure.
In this case you should consult the
phymldocumentation. However, anything it prints to stdout/stderr is likely going to tell you what is wrong.shivanishrm commentedon Aug 25, 2019
peterjc commentedon Aug 25, 2019
Yes - and the meaning could be as simple as can’t find the input file. You said you checked the working directory but using absolute paths might help.
peterjc commentedon Nov 10, 2020
Closing as this appears to have been resolved.