psathyrella / partis

B- and T-cell receptor sequence annotation, simulation, clonal family and germline inference, and affinity prediction
GNU General Public License v3.0
54 stars 36 forks source link

Singularity #328

Closed ashotmarg closed 3 months ago

ashotmarg commented 3 months ago

Hi @psathyrella ,

Thanks for the new Docker image/dockerfile for partis.

While things work fine with docker, I get a numpy error when I run singularity with the same docker image. That numpy issue is actually a more general python and conda related. After a bit of digging, it seems that when running with singularity the $PATH in the singularity container is different compared to the $PATH inside a docker container and doesn't include for some reason the "/opt/conda/" part. I don't know why this is happening in case of singularity but if someone wants to run partis with singulraity a solution is: singularity exec --env PATH=/opt/conda/bin:/opt/conda/condabin:$PATH partis.sif ...

To test things a bit more, I've added the following line in your dockerfile and rebuild the image, which seems to have solved the issue, when I run with singularity. But I haven't thoroughly tested things.

I've essentially added this line ("ENV PATH /opt/conda/bin:/opt/conda/condabin:$PATH") at the end of the dockerfile, right before the "CMD" statement, so the last two lines of the dockerfile looked like:

...
ENV PATH /opt/conda/bin:/opt/conda/condabin:$PATH
CMD ./test/test.py --quick

Please check this, and if it's fine, maybe it's worth updating the dockerfile/image so that the singularity can also run without the need of the extra "--env" parameter.

psathyrella commented 3 months ago

OK just added this into main. Thank you for the suggested fix!