Can anybody make me clear how to use PHYLIP application's without using emboss tool as a wrapper class. I think it's possible just by commandine interface but doesn't seems to work for me.
Through command shell when i enter neighbor then its accessible but i can't do it through python. And what are the input file supported by the PHYLIP neighbor's application?
ADD COMMENT
• link
updated 6.2 years ago by
Ram
44k
•
written 14.5 years ago by
Thaman
★
3.3k
1
Entering edit mode
OK. Methods you have referenced before, like ClustalwCommandline work because they are in BioPython modules that you have imported. You can't call a method that you haven't declared (either directly or through an import). There is no method named neighborCommandline in BioPython anyway. I repeat, the simplest way to do this would be to use os.popen(), or similar. I'm not sure why you'd need a command line wrapper anyway.
AFAIK, This code snippet won't enable the neighbor to execute. You need a steering file that provides various parameters to neighbor. Explained in detail in the answer.
In what way is this not working? Your code snippet is insufficient for me to replicate what you are trying to achieve. If Phylip is working at the command line, why not just use os.popen() to run the process?
I haven't imported any modules right now, included phylip->neighbor.exe in the system environment. From command prompt when I enter neighbor it opens that means its accessible. So, i just checked above 2 lines in the python without importing any emboss module or subprocess right now.
ADD REPLY
• link
updated 6.2 years ago by
Ram
44k
•
written 14.5 years ago by
Thaman
★
3.3k
0
Entering edit mode
Its prompt error as -> neighborCommandline is not define
ADD REPLY
• link
updated 6.2 years ago by
Ram
44k
•
written 14.5 years ago by
Thaman
★
3.3k
0
Entering edit mode
That's what I am wondering about, I don't have EMBOSS wrapper to use phylip apps. I have output generated by the Clustalw and I want to do phylogeny using phylip->neighbor. Simplest way I figure out was to pass command line argument but doesn't seems to work. Ok I will try to generated phylogeny output like you said.
ADD REPLY
• link
updated 6.2 years ago by
Ram
44k
•
written 14.5 years ago by
Thaman
★
3.3k
Thaman : I have tried to explain this in one of your earlier question here. Have you tried a test run using neighbor program. As suggested by Stefano, phylip take an infile and several parameters and generate an outfile. In order to pass on this parameters, you can create a steering_file (a text file that will provide several parameters to neighbor). If you are developing a web app, you may provide them as options from a drop down menu.
The following settings you can use for testing
N Neighbor-joining or UPGMA tree? Neighbor-joining
O Outgroup root? No, use as outgroup species 1
L Lower-triangular data matrix? No
R Upper-triangular data matrix? No
S Subreplicates? No
J Randomize input order of species? No. Use input order
M Analyze multiple data sets? No
0 Terminal type (IBM PC, ANSI, none)? ANSI
1 Print out the data at start of run No
2 Print indications of progress of run Yes
3 Print out tree Yes
4 Write out trees onto tree file? Yes
In your steering file you will add only the parameters(last column) as required and run using `` or system commands. So whenever you need to execute neighbor using command-line you run it as
I gather from your other questions and that little snippet that you're doing this with Biopython. Well, there isn't a NeighborCommandline class in Biopython (which is why you get the not defined error, even if it was there you'd have to import it before you could use it).
Last time I checked phylip needs *.phy files, not clustal alignments. So you'll need to do this:
Neighbor actually needs a distance matrix, not an alignment. So use (f)dnadist to make one of those before you estimate the trees.
I really suggest you look into installing the EMBOSS versions, as Khader has shown each phylip program needs a "guide file" to work in batch mode. The EMBOSS versions have all their arguments and options passed on through the command line. I find it much easier to work that way (but your results may vary)
The (official) PHYLIP tools are designed to be run "by hand" selecting actions via a text based menu system. The settings cannot be given by command line arguments (which is the normal way things are done). It is nevertheless theoretically possible to control the original PHYLIP tools from a Python script but you need to mess about with filenames, pipe instructions to stdin and so on.
We really do recommend using the EMBOSS versions instead.
It is a while I don't use PHYLIP.
However I used to run it from the command line. Each program works on its own and expect a input file called infile and will produce an outfile called outfile
So you need to rename them if you want one program to work on the output of another program.
OK. Methods you have referenced before, like ClustalwCommandline work because they are in BioPython modules that you have imported. You can't call a method that you haven't declared (either directly or through an import). There is no method named
neighborCommandline
in BioPython anyway. I repeat, the simplest way to do this would be to useos.popen()
, or similar. I'm not sure why you'd need a command line wrapper anyway.AFAIK, This code snippet won't enable the neighbor to execute. You need a steering file that provides various parameters to neighbor. Explained in detail in the answer.
In what way is this not working? Your code snippet is insufficient for me to replicate what you are trying to achieve. If Phylip is working at the command line, why not just use
os.popen()
to run the process?I agree with Simon, listing a longer code snippet would make it easier to troubleshoot.
First i am trying to see the print cline, but got an error neighborCommandline is not define.
I haven't imported any modules right now, included
phylip->neighbor.exe
in the system environment. From command prompt when I enterneighbor
it opens that means its accessible. So, i just checked above 2 lines in the python without importing any emboss module or subprocess right now.Its prompt error as
-> neighborCommandline
is not defineThat's what I am wondering about, I don't have EMBOSS wrapper to use phylip apps. I have output generated by the Clustalw and I want to do phylogeny using
phylip->neighbor
. Simplest way I figure out was to pass command line argument but doesn't seems to work. Ok I will try to generated phylogeny output like you said.