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
neighbor < steering_file.txt
This will generate the outfile.
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.exein the system environment. From command prompt when I enterneighborit 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
-> neighborCommandlineis not defineOK. 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
neighborCommandlinein 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.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.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.