precimed / mixer

Causal Mixture Model for GWAS summary statistics
GNU General Public License v3.0
65 stars 18 forks source link

Installing mixer on linux #11

Closed gnarw closed 5 years ago

gnarw commented 5 years ago

I downloaded the Linux_x64.tar.gz Extracted the file to a new folder. When I run bin/bgmg-cli I get "Exception : ERROR: --bim must be specified"

My linux system is Red Hat Enterprise Linux Server Version 7.6

I have plink v1.90b3.32 installed and Python 2.7.10

Any suggestions what could be wrong ?

ofrei commented 5 years ago

@gnarw sorry, I missed you question. I think this is expected, bin/bgmg-cli require some options. To test that it works you could run bin/bgmg-cli --help.

gnarw commented 5 years ago

I have a another problem when trying to install and test mixer.

  1. my ~/.bash_profile contains LD_LIBRARY_PATH=/nfs/users/gunnar/software/mixer/mixer_v1.0_linux_x64/lib export LD_LIBRARY_PATH
  2. When I do matlab -nodisplay -nosplash -nodesktop -r "test_mixer_plugin; exit;" I get the an error message and matlab is killed I have attached the error message. I this something you could help me solve ? error.txt
ofrei commented 5 years ago

@gnarw I see from the log that your matlab version is 2016a. Do you by chance have other version of matlab installed? Preferred version is 2017a. Later versions might work too. I understand it could be a challenge - I were simply lucky to have multiple matlabs installed on my cluster so I just switched with "module load matlab/2017b".

I'm currently working on another distribution of MiXeR - either as python package or standalone compiled binary. In the meantime I'm very sorry that you are having this bad experience with installing MiXeR. The reason why MiXeR is so picky about matlab's version is because core functionality is implemented as a native C++ plugin (not MEX file, but an actual C++ code compiled outside of matlab with gccc). Unfortunately, MATLAB turned out to be very fragile when it comes to loading external .dll / .so / .dynlib objects into its memory space. I never had any problems of this kind with, for instance, python. I were also thinking to make a docker / singularity container, but I'm not sure how to do that with matlab as it's a commerial product .

gnarw commented 5 years ago

Unfortunately I don´t have another more recent version matlab. Looking forward to another distribution of MiXeR :)

ofrei commented 5 years ago

@gnarw Hi. Now there is a working port of MiXeR to python. It can be used as described here: https://github.com/precimed/mixer/tree/master/precimed This is still work in progress, and documentation isn't complete, but if you encounter issues or need more info please ask, I'll try reply as quick as I can. Input formats did not change (both for summary statistics, and for the reference), so there is no need to re-generate any of the files you've previously created for MATLAB's version of MiXeR.

gnarw commented 5 years ago

Hi. I am trying to install mixer for python. But having some problems.

I downloaded and compiled the boost libraries, without any errors. I´m installing mixer on a computer without internet connection so I downloaded the zip file from github.com/precimed/mixer and copied it to the machine I´m installing on and un-zipped the downloaded file. I then did mkdir mixer/src/build && cd mixer/src/build When I try to compile using cmake .. -DBOOST_ROOT=$HOME/boost_1_69_0 I get "CMake Error at CMakeLists.txt" I am including the CMakeOutput.log file Do you have any ideas what could be wrong/missing ?

ofrei commented 5 years ago

@gnarw thanks, how can I see CMakeOutput.log ? Doesn't seem to be attached here. Also, what version of cmake do you have ( cmake --version ?) So far I've built mixer with CMake 3.7.1 and 3.10.2, both worked well.

ofrei commented 5 years ago

@gnarw I have a guess what's wrong. Could you please try to git clone on a public machine with internet using the following command:

git clone --recurse-submodules -j8 https://github.com/precimed/mixer.git

And then compress and transfer the entire folder to your computer without an internet connection. The trick is --recurse-submodules. MiXeR repository on github depends on other repositories (googletest and zlib), and those aren't included if you download a zip file from github.

gnarw commented 5 years ago

@ofrei Sorry, I forgot to attach the output log. I have version 2.8.12.2 of cmake. Anyway. I used git clone --recursive to get all the repositories. I´m still having problems. I might be doing something wrong when building the boost libraries. the (./b2 --j12 -a) command is returning messages that directories should be included in include and linker paths. I am attaching the commands and their output in a text file. log.txt

ofrei commented 5 years ago

@gnarw Sorry to hear you are still getting issues. Are you familiar with Docker? As there is no dependency on commercial Matlab, I can now pre-install MiXeR into a docker container, if this alternative works for you.

Could you run make bgmg instead of make and let me know if it fails? From the log.txt it is clear that you are getting a linker error, however it's not 100% clear which binary causing this error (lib/libbgmg.so or bin/bgmg-cli). In fact you don't need bin/bgmg-cli, nor bgmg-tests, so I suggest to try building lib/bgmg.so only and see if that works.

If you still get errors building make bgmg please let me know what's your operating system, and what is your version of gcc (g++ -v).

ofrei commented 5 years ago

(sorry, overlooked OS version, I see you have Red Hat Enterprise Linux Server Version 7.6; that leaves g++ -v questions)

gnarw commented 5 years ago

@ofrei I deleted the previous mixer/src/build directory and made a new one. did the following: cmake .. -DBOOST_ROOT=$HOME/boost_1_69_0 && make bgmg -j16

I´m attaching the output from this command. It looks to me everything is ok. Could you please take a look, before I continue ? I have gcc version 4.8.5 log2.txt

ofrei commented 5 years ago

Great - everything looks fine, please continue, and let me know if anything else fails.

gnarw commented 5 years ago

@ofrei I´m at the Data preparation stage. I cloned the python_convert packages Calling the following commands: python sumstats.py zscore --sumstats PGC_SCZ_2014_EUR.csv | \ python sumstats.py qc --exclude-ranges 6:26000000-34000000 --max-or 1e37 | \ python sumstats.py neff --drop --factor 4 --out PGC_SCZ_2014_EUR_qc_noMHC.csv --force

I´m getting error messages (attached) and the PGC_SCZ_2014_EUR_qc_noMHC.csv is not being created, I´m using Python 3.7.4 numpy==1.17.2 pandas==0.25.1 scipy==1.3.1

Any ideas ?

python_error.txt

PS. I later discovered that these sumstats.py commands run without problems if I don´t pipe them but instead run each with --out and --sumstats, i.e. make intermediate output files

ofrei commented 5 years ago

@gnarw I couldn't figure out what happened from the python_error.txt file - could you paste the overall sequence of commands? I need to see the one ran before "sumstats.py neff".

Btw, I've put all my files derived from 1kG phase3 reference panel here: https://1drv.ms/u/s!Ai1YZmdFa9ati40Inztrv_4erqcdWw?e=ixWDUe (within mixer/LDSR folders). NB, download size is 24 GB. If you download this folder there is no need to run steps under Data Preparation / Reference panel (unless you want to re-generate reference using another genotype pannel, not the one originating from LD Score Regression 1kG Phase3)

gnarw commented 5 years ago

@ofrei The command: _python sumstats.py csv --sumstats daner_PGC_SCZ49.sh2_mds10_1000G-frq_2.gz --out PGC_SCZ_2014EUR.csv --force --auto --head 5 --ncase-val 33640 --ncontrol-val 43456 runs withour problems. I then run the following commands: _python sumstats.py zscore --sumstats PGC_SCZ_2014_EUR.csv | \ python sumstats.py qc --exclude-ranges 6:26000000-34000000 --max-or 1e37 | \ python sumstats.py neff --drop --factor 4 --out PGC_SCZ_2014_EUR_qcnoMHC.csv --force and that is when I get error messages. I have pasted this commands (three sumstats.py in pipe) to a file and the corresponding messages. sumstats error.txt

NB! I´m running python through a virtual environment. Don´t know if that is causing the problem. But as noted before this runs fine if I don´t use the pipe ( | ) command.

ofrei commented 5 years ago

@gnarw Thanks for reporting this error, I'll try to reproduce and fix. Made a separate ticket for it https://github.com/precimed/python_convert/issues/33 I'm closing this ticket - it seems that installing and running python port of MiXeR was a lot easier than the original MATLAB version.