-
Notifications
You must be signed in to change notification settings - Fork 16
MHCnuggets container with command line interface
aellini edited this page Nov 7, 2019
·
1 revision
- Create a new and empty directory on your workstation, and change into that directory. From inside of the empty directory clone the repository to your workstation:
git clone https://github.com/KarchinLab/mhcnuggets
- Create file called
Dockerfile, and contents of the file should be:
FROM python:3
COPY mhcnuggets mhcnuggets
WORKDIR mhcnuggets
RUN python3 setup.py sdist bdist_wheel
RUN pip install dist/mhcnuggets-2.3.2.tar.gz
WORKDIR /mhcnuggets/mhcnuggets
CMD tail -f /dev/null
- Run the following command from within the same directory as the
Dockerfileto build the docker image:
sudo docker build -t mhcnuggets .
- Create a file called
docker-compose.yml, with the following contents:
version: '3'
services:
mhcnuggets:
image: mhcnuggets
container_name: mhcnuggets
volumes:
- ./mount:/mhcnuggets/mount
-
In the same directory that
docker-compose.ymlresides in, create another directory calledmount -
While still in the same directory that
docker-compose.ymlresides in, run the following command to start the docker container:
sudo docker-compose up -d
-
OPTIONALLY: If desired, copy any files that you want mhcnuggets to have access to into the
mountdirectory you created in step 5. For example, if you want to use your peptides file, copy it into themountdirectory, the peptides_path would be /mhcnuggets/mount/ -
Now run the following command to run python (with mhcnuggets installed) from the docker container:
sudo docker exec -it mhcnuggets python
- You can now run your predict and train modules. For example, paste the following into the prompt and hit enter (may need to hit enter a few times for the last line to be executed):
from mhcnuggets.src.predict import predict
predict(class_='I', peptides_path='data/test/test_peptides.peps', mhc='HLA-A02:01')