SysBioChalmers / GECKO

Toolbox for including enzyme constraints on a genome-scale model.
http://sysbiochalmers.github.io/GECKO/
MIT License
66 stars 51 forks source link

error: DLKcat Docker invalid reference format error #351

Closed edkerk closed 12 months ago

edkerk commented 1 year ago

Discussed in https://github.com/SysBioChalmers/GECKO/discussions/350

Originally posted by **wshao1** August 23, 2023 I am trying to create a full ecModel based on Human-GEM 1.16.0, using a modified form of `tutorials/full_ecModel/protocol.m`. Step 7 (DLKcat prediction through machine learning) breaks at the `runDLKcat()` command, giving the following traceback: ![image](https://github.com/SysBioChalmers/GECKO/assets/50877702/20283c47-de72-491d-9ac9-67e45eb8c372) I've inspected `runDLKcat()`, specifically the `docker run` command at line 38, but it's not clear to me why the reference format is incorrect. Perhaps the filepath is specific to whoever created the tutorial, and we need to change it for our own machine?
edkerk commented 1 year ago

@wshao1, could you please provide:

The problem is probably not a filepath that is user-specific. If you've reached Step 7 of the tutorial, then params.path in the model adapter is correct, and that's where the filepath is built from.

Can you also please:

  1. Run dbstop in runDLKcat at 38 in the MATLAB command window.
  2. Run the runDLKcat() command as you've done previously.
  3. Once MATLAB pauses, run ['docker run --rm -v ' fullfile(params.path,'/data') ':/data ghcr.io/sysbiochalmers/dlkcat-gecko:0.1 /bin/bash -c "python DLKcat.py /data/DLKcat.tsv /data/DLKcatOutput.tsv"'] to see what is the command that should be run at that point.

To again remove the dbstop you can run dbclear all in runDLKcat.

mihai-sysbio commented 1 year ago

Thanks for reporting this @wshao1!

I've inspected runDLKcat(), specifically the docker run command at line 38, but it's not clear to me why the reference format is incorrect.

In addition to what @edkerk mentioned above, could I ask you to copy-paste the output of the docker run command here please?

edkerk commented 1 year ago

@mihai-sysbio, when running a terminal command in MATLAB via system, the standard output is shown in the MATLAB command window. So the output from docker run is docker: invalid reference format..

wshao1 commented 1 year ago

@edkerk I've tried your 3 steps, but I still see the same error. I assume in step 3 you meant to run system(['docker run --rm -v ' fullfile(params.path,'/data') ':/data ghcr.io/sysbiochalmers/dlkcat-gecko:0.1 /bin/bash -c "python DLKcat.py /data/DLKcat.tsv /data/DLKcatOutput.tsv"']). Without system(), the string is just echoed back.

My system info:

edkerk commented 1 year ago

No, I did not mean to include system(), I wanted to see the exact string that would be parsed to system(), where for instance fullfile(params.path,'/data') is replaced.

wshao1 commented 1 year ago

Ah ok, here is the exact string: 'docker run --rm -v C:\Users\wshao2\OneDrive - University of Virginia\papin_lab\projects\sasco_project_2\deliverables\metabolic_models\analysis\ecHCT116\data:/data ghcr.io/sysbiochalmers/dlkcat-gecko:0.1 /bin/bash -c "python DLKcat.py /data/DLKcat.tsv /data/DLKcatOutput.tsv"'.

edkerk commented 1 year ago

Perhaps the space in the path (OneDrive - University of Virginia) is problematic. Can you move the folder to a different location (and change it in the model adapter's param.path)?

mihai-sysbio commented 1 year ago

@mihai-sysbio, when running a terminal command in MATLAB via system, the standard output is shown in the MATLAB command window. So the output from docker run is docker: invalid reference format..

@wshao1 what I had in mind was to run the Docker command as you copied above directly in the (system) terminal (not from Matlab), in which case Docker would give more info about the error.

Now though, having seen the file path, I am quite sure those spaces are problematic. To verify, could you modify line 38 to include quotation marks " around fullfile():

system(['docker run --rm -v "' fullfile(params.path,'/data') '":/data ghcr.io/sysbiochalmers/dlkcat-gecko:0.1 /bin/bash -c "python DLKcat.py /data/DLKcat.tsv /data/DLKcatOutput.tsv"'])
edkerk commented 1 year ago

I was able to replicate this on Windows, now solved in #352.

wshao1 commented 1 year ago

The quotation marks solved it, thank you so much!