gitter-lab / SINGE

Gene regulatory network reconstruction from pseudotemporal single-cell gene expression data
MIT License
11 stars 6 forks source link

Glmnet Mex dependency on old version of libgfortran - Ubuntu #73

Closed taraeicher closed 6 months ago

taraeicher commented 7 months ago

I am trying to run Singe_Example.m on an Ubuntu machine. However, I am getting the following error from glmnetMex.mexa64. I unfortunately cannot install libgfortran3 on my machine as it is deprecated. Is there any workaround for this?

In SINGE (line 20) In SINGE_Example (line 16) In run (line 112)

randomizer =

  737892

Invalid MEX-file '/home/ubuntu/SINGE/SINGE/glmnet-matlab/glmnetMex.mexa64': libgfortran.so.3: cannot open shared object file: No such file or directory

Error in glmnetControl (line 79) ivals.pmin, ivals.exmx, ivals.prec, ivals.mxit] = glmnetMex();

Error in glmnet (line 329) inparms = glmnetControl();

Error in iLasso_for_SINGE (line 111) fit = glmnet(Am, bm, params.family, opt);

Error in run_iLasso_row (line 27) [metric] = iLasso_for_SINGE(m, outs, lambda,p1,dT,std_dev,params);

Error in SINGE_GLG_Test (line 79) [for_metric] = run_iLasso_row(m,outs,params,irow);

Error in SINGE (line 20) SINGE_GLG_Test(Data,'--outdir',outdir,args{:})

Error in SINGE_Example (line 16) SINGE(data,gene_list,outdir,hyperparameter_file);

Error in run (line 112) evalin('caller', strcat(scriptStem, ';'));

agitter commented 7 months ago

Based on the MATLAB glmnet download and revision history pages, it does not seem to be maintained. That limits what we can do to fix this within the SINGE source.

Is Docker an option for you? I expect our Docker image will run in a newer Ubuntu system.

taraeicher commented 6 months ago

Thank you for your response @agitter . I will try the Docker image and will follow up.

taraeicher commented 6 months ago

@agitter I have installed Docker and pulled the image, but there seems to be a problem with the command in the README. When I run docker run -v $(pwd):/SINGE -w /SINGE agitter/singe:0.4.0 standalone data1/X_SCODE_data.mat data1/gene_list.mat Output default_hyperparameters.txt, I get the error Unable to read file 'data1/gene_list.mat'. No such file or directory. This happens even when I use the full path to gene_list.mat.

Shall I write this up as a separate issue?

agitter commented 6 months ago

We can discuss the Docker issue here. I don't see a way to resolve the root cause of the dependency issue without help from the MATLAB glmnet team, and they do not seem active.

When I first tried running the Docker image I ran into the same error you did. This indicates that the Docker volume mount failed. I'm currently on Windows running in the Git for Windows, so I needed to use workarounds (https://github.com/docker-archive/toolbox/issues/673#issuecomment-479374041) to fix the file paths. Those should not be necessay with Ubuntu. The final command that worked for me is

winpty docker run -v /$(pwd)://SINGE -w //SINGE agitter/singe:0.5.1 standalone data1/X_SCODE_data.mat data1/gene_list.mat Output default_hyperparameters.txt

The next thing to try would be running the container interactively with -it to see if the volume mounting worked. For me I ran

winpty docker run -it -v /$(pwd)://SINGE -w //SINGE --entrypoint "//bin/bash" agitter/singe:0.5.1

but on Ubuntu you should not need the winpty or the // to escape absolute paths. If that doesn't work, we can see what might be going wrong on your system.

Note that I'm also using the latest version of the Docker image, 0.5.1.

taraeicher commented 6 months ago

The first command did not work for me even after upgrading to 0.5.1, but the second command (running the container iteratively) appears to have worked: (base) root@a44f5f7ea678:/SINGE#

agitter commented 6 months ago

If the second interactive command works, that suggests the image works correctly but path mounting is the problem. After you launch the container interactively can you see any mounted files? I see

(base) root@ef1d6d7c09fc:/SINGE# ls
LICENSE          TempMat_35.mat        data1                        glmnet_matlab.zip               run_SINGE_GLG_Test.sh
NEWS.md          TempMat_55.mat        data2                        readme_SINGE_Aggregate.txt      run_SINGE_GLG_Test_mac.sh
Output           TempMat_64.mat        data3                        readme_SINGE_Aggregate_mac.txt  scripts
README.md        USAGE.md              data_bifurcated              readme_SINGE_GLG_Test.txt       tests
SINGE.sh         code                  default_hyperparameters.txt  readme_SINGE_GLG_Test_mac.txt   winpty.exe.stackdump
SINGE_Example.m  compile_SINGE.sh      docker                       run_SINGE_Aggregate.sh
TempMat_15.mat   compile_SINGE_mac.sh  glmnet_matlab                run_SINGE_Aggregate_mac.sh

(base) root@ef1d6d7c09fc:/SINGE# ls data1/
README.md  X_BranchTest.mat  X_SCODE_data.mat  X_regix_test.mat  gene_list.mat

Are you running the command from the root of this GitHub repository, the SINGE directory? The command expects that data1/ is a subdirectory of the working directory where you run the command from.

taraeicher commented 6 months ago

Thank you for your help! It looks like it was just an issue with the working directory. After changing the working directory, I was able to see the mounted files and to run the command without any errors.

agitter commented 6 months ago

Excellent, I'm glad that is working. Let us know if you have problems running the Docker container with your own data.