davidemms / OrthoFinder

Phylogenetic orthology inference for comparative genomics
https://davidemms.github.io/
GNU General Public License v3.0
648 stars 185 forks source link

scipy.optimize import curve_fit # install #115

Closed dipsaha closed 6 years ago

dipsaha commented 6 years ago

Hi,

I am new to Orthofinder!

I was trying to install Orthofinder on Ubuntu 14.04 LTS using the source code: "OrthoFinder-1.1.8_source.tar.gz". As per the Installation guide I have installed all dependencies and scipy (Ubuntu & Debian) from the provided URL http://www.scipy.org/install.html . While running Orthofinder using the command: OrthoFinder-1.1.8_source/orthofinder$ python2.7 orthofinder.py -f ExampleData, the following error appears:

Traceback (most recent call last): File "orthofinder.py", line 35, in from scipy.optimize import curve_fit # install ImportError: No module named scipy.optimize

Even after repeating several times, the same problem encountered. I had even tried to install or upgrade 'scipy' , but the results remained same.

Please advice. I am not very skilful in Bioinformatic command and need simple advice to solve this issue.

Thanks

davidemms commented 6 years ago

Hi

It would probably be best to use the binary version as this doesn't require you to install scipy.

Otherwise, you need to ensure that scipy is installed correctly for the version of python you are using. You can test this by opening an interactive python session on the terminal (by just typing python2.7 in your case) and then trying to run import scipy.optimize in this interactive session. If there are no errors then scipy is installed correctly, otherwise you'll get an ImportError.

All the best David

dipsaha commented 6 years ago

Hi David,

I have installed both the binary version and source code. both of them are creating problems. In case of binary version, when I use the command "orthofinder -f ExampleData" it results into "orthofinder: command not found" What could be the reason for that error?

In case of source code installation, though the scipy install says it has been installed the import scipy.optimize results in Import error. I am clueless how to use orthofinder. Please help me in little detail.

Regards

davidemms commented 6 years ago

Hi

Try typing "./orthofinder" (it's called the dot slash, and is required if you want to run a script that is in your directory without having to type the full path). Alternatively just type the full path to the orthofinder binary.

All the best David

dipsaha commented 6 years ago

Hi David,

Thanks for the suggestion. Following your advice "./orthofinder -f ExampleData" I could run the program, but it produced a different kind of error as shown below:

OrthoFinder version 1.1.8 Copyright (C) 2014 David Emms

This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
For details please see the License.md that came with this software.

16 thread(s) for highly parallel tasks (BLAST searches etc.) 1 thread(s) for OrthoFinder algorithm

Checking required programs are installed

Test can run "makeblastdb -help" - ok Test can run "blastp -help" - ok Test can run "mcl -h" - ok Test can run "fastme -i /home/icar/Programs/OrthoFinder-1.1.8/ExampleData/SimpleTest.phy -o /home/icar/Programs/OrthoFinder-1.1.8/ExampleData/SimpleTest.tre" - ok Test can run "dlcpar_search --version" - failed ERROR: Cannot run dlcpar_search Please check DLCpar is installed and that the executables are in the system path.

Dependencies have been met for inference of orthogroups but not for the subsequent orthologue inference. Either install the required dependencies or use the option '-og' to stop the analysis after the inference of orthogroups.

ERROR: An error occurred, please review previous error messages for more information.

Though I had installed DLCpar1.0 and the required module "dlcpar_search" is available at /dlcpar-1.0/bin directory, the above error message was generated. using the option '-og' though generates other results. Please advice to rectify the problem. I have followed the same installation instructions written in the GitHub readme.md. How to check if the DLCpar and its executables are in the system path or not? If not, how to make them in the System path.

Regards

davidemms commented 6 years ago

Hi

If the full path to dlcpar_search is "/dlcpar-1.0/bin/dlcpar_search" then you need to run the command: export PATH=$PATH:/dlcpar-1.0/bin/ in the terminal before running orthofinder.

If you want to make this change to your PATH variable permanent then you can do that in your bashrc file, if you use a bash shell (e.g. see https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path), or whatever is the appropriate file is if you're using something other than bash.

All the best David

dipsaha commented 6 years ago

Hi David,

As per your suggestion I tried to use your command: export PATH=$PATH:/dlcpar-1.0/bin/ then pressed ENTER than run: ./orthofinder -f fastafile_dir -t 8

But it repeated with the same error. The other option is bit complicated for me with little commanding skills. Don't know what to do? Regards

davidemms commented 6 years ago

Have you checked that '/dlcpar-1.0/bin/' is the full path to the directory containing dlcpar_search? The message above contains a link explaining paths.

Once you have correctly run the "export PATH=..." command with the correct path to the directory containing dlcpar_search then you will be able to run the command "dlcpar_search" from any directory on your machine. You'll need to get this working before you can run orthofinder.

All the best David

dipsaha commented 6 years ago

Hi David,

I found there are two Full paths of dlcpar_search is (i) at "/home/icar/Programs/dlcpar-1.0/bin/dlcpar_search" (ii) at "/usr/local/bin/dlcpar_search"

I tried with both the options to export PATH along with the 'export PYTHONPATH=/usr/local/bin/python'

but of no glory for me : icar@icar-crijaf:~/Programs/OrthoFinder-1.1.8$ export PATH=$PATH:/usr/local/bin/icar@icar-crijaf:~/Programs/OrthoFinder-1.1.8$ export PYTHONPATH=/usr/local/bin/icar@icar-crijaf:~/Programs/OrthoFinder-1.1.8$ ./orthofinder -f flaxhsf -t 8 OrthoFinder version 1.1.8 Copyright (C) 2014 David Emms

This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
For details please see the License.md that came with this software.

8 thread(s) for highly parallel tasks (BLAST searches etc.) 1 thread(s) for OrthoFinder algorithm

Checking required programs are installed

Test can run "makeblastdb -help" - ok Test can run "blastp -help" - ok Test can run "mcl -h" - ok Test can run "fastme -i /home/icar/Programs/OrthoFinder-1.1.8/flaxhsf/SimpleTest.phy -o /home/icar/Programs/OrthoFinder-1.1.8/flaxhsf/SimpleTest.tre" - ok Test can run "dlcpar_search --version" - failed ERROR: Cannot run dlcpar_search Please check DLCpar is installed and that the executables are in the system path.

Dependencies have been met for inference of orthogroups but not for the subsequent orthologue inference. Either install the required dependencies or use the option '-og' to stop the analysis after the inference of orthogroups.

ERROR: An error occurred, please review previous error messages for more information. icar@icar-crijaf:~/Programs/OrthoFinder-1.1.8$

It seems I need to give it up! But for one last suggestion fro you if it can help?

Regards

davidemms commented 6 years ago

Step by step, I would do this:

export PATH=/home/icar/Programs/dlcpar-1.0/bin/:$PATH
dlcpar_search

Did this produce output from dlcpar_search? It should look like this:

Usage: dlcpar_search [options] <gene tree> ...

dlcpar_search is a phylogenetic program for (heuristically) finding the most
parsimonious gene tree-species tree reconciliation by inferring speciation,
duplication, loss, and deep coalescence events. See
http://compbio.mit.edu/dlcpar for details.

Options:
  Input/Output:
    -s <species tree>, --stree=<species tree>
                        species tree file in newick format
    -S <species map>, --smap=<species map>
                        gene to species map

...
etc.
...

  Information:
    --version           show program's version number and exit
    -h, --help          show this help message and exit
    -l, --log           set to output debugging log

If that worked then you can run OrthoFinder: ./orthofinder -f flaxhsf -t 8

In case of problems:

Hope this helps David

dipsaha commented 6 years ago

Hi David,

Thanks for your really kind efforts to help me out in finding a solution to my problem of running OrthoFinder!

When I did follw your suggestion, I found this with dlcpar_search: icar@icar-crijaf:~/Programs/OrthoFinder-1.1.8$ export PATH=/home/icar/Programs/dlcpar-1.0/bin/:$PATH icar@icar-crijaf:~/Programs/OrthoFinder-1.1.8$ dlcpar_search Traceback (most recent call last): File "/home/icar/Programs/dlcpar-1.0/bin/dlcpar_search", line 15, in import dlcpar.simplerecon File "/usr/local/lib/python2.7/site-packages/dlcpar/simplerecon.py", line 12, in from rasmus import util, stats, treelib File "/usr/local/lib/python2.7/site-packages/dlcpar/deps/rasmus/stats.py", line 20, in from rasmus import tablelib File "/usr/local/lib/python2.7/site-packages/dlcpar/deps/rasmus/tablelib.py", line 45, in from sqlite3 import dbapi2 as sqlite File "/usr/local/lib/python2.7/sqlite3/init.py", line 24, in from dbapi2 import File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 28, in from _sqlite3 import ImportError: No module named _sqlite3

Now it requires a new module?? Please advice.

dipsaha commented 6 years ago

Sorry, for the strike through command, I don't know how it is getting strike-through in this input form!

davidemms commented 6 years ago

Hi

I can see quite a few questions about this issue on google (searching for "ImportError: No module named _sqlite3") so it seems to be something others have seen. It looks like there's a problem with the configuration of python on your system.

Based on the advice on pages like this one https://stackoverflow.com/questions/1210664/no-module-named-sqlite3 I think the best thing to try would be:

sudo apt-get install libsqlite3-dev
sudo pip install pysqlite

And then try running dlcpar_search again.

If you still get the same "ImportError: No module named _sqlite3" error, then try find /usr/local -name _sqlite3.so and see if it manages to find "_sqlite3.so" on your system. If you do, then you can add the relevant directory to your PYTHONPATH in the same way you previously added things to your PATH variable: export PYTHONPATH=/the/path/you/found/:$PYTHONPATH

David

dipsaha commented 6 years ago

Hi David,

I did almost everything I know to find the "-name _sqlite3.so" in all the directories of Python (python; python2.7; python3; python3.4) in my workstation. According to my google search, it should be in the "lib-dynload" subdirectory of Python 2.7. Mysteriously, it is missing not only from the subdirectory but probably from all of my computer. I also did try to install "sqlite-autoconf-3200100.tar.gz" and run "./configure"; "make" and "make install". but the problem persists even after that.

Heard that recompilation of Python2.7 may get the "_sqlite3.so" file after the 'sqlite-autoconf-3200100.tar.gz' is installed. But not sure (i) how to recompile Python2.7 (ii) Whether it will create problem to other programs using Python2.7 as the dependent?

Would have been glad to have an alternative simpler path to solve the problem of running OrthoFinder. especially, after the orthogroup inference using the '-og' flag as mentioned in my previous string of issues with OrthoFinder.

Regards

davidemms commented 6 years ago

Hi

From what I can see it looks like these issues you’re facing aren’t problems with OrthoFinder but are due to the installation of python on your machine. Although I've tried to give some pointers for things that could help I think it would be best resolved by someone with physical access to your computer so they can investigate the installation problems more interactively. Hopefully you'll be able to get to the bottom of it and get it all resolved!

All the best David