Skip to content

Commit fc194b5

Browse files
committed
Update setup.py -> pyinstaller files
- Included missing 'llm/prosst_structure/static/*' static model binaries - Added Dockerfile
1 parent 1ced2eb commit fc194b5

File tree

7 files changed

+71
-9
lines changed

7 files changed

+71
-9
lines changed

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,26 @@
231231
]
232232
},
233233

234+
{ // Test on test set: Hybrid DCA-LLM ProSST
235+
"name": "Python: PyPEF hybrid/only-TS-zero-shot GREMLIN-DCA-ProSST avGFP",
236+
"type": "debugpy",
237+
"request": "launch",
238+
"env": {"PYTHONPATH": "${workspaceFolder}"},
239+
"program": "${workspaceFolder}/pypef/main.py",
240+
"console": "integratedTerminal",
241+
"justMyCode": true,
242+
"cwd": "${workspaceFolder}/datasets/AVGFP/",
243+
"args": [
244+
"hybrid",
245+
//"-m", "GREMLIN", // optional, not required
246+
"--ts", "TS.fasl",
247+
"--params", "GREMLIN",
248+
"--llm", "prosst",
249+
"--wt", "P42212_F64L.fasta",
250+
"--pdb", "GFP_AEQVI.pdb"
251+
]
252+
},
253+
234254
{
235255
"name": "Python: PyPEF hybrid/only-PS-zero-shot GREMLIN-DCA avGFP",
236256
"type": "debugpy",

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM python:3.12-slim
2+
3+
WORKDIR /app
4+
RUN mkdir -p pypef
5+
6+
COPY requirements.txt run.py /app/
7+
COPY pypef/ /app/pypef/
8+
9+
RUN pip install --upgrade pip
10+
RUN pip install --no-cache-dir -r requirements.txt
11+
RUN ["python", "-c", "import torch;print(torch.__version__)"]
12+
13+
EXPOSE 5000
14+
15+
# Not defining entrypoint herein for eased chaining of multiple commands
16+
# with /bin/bash -c "command1 && command2..."
17+
#ENTRYPOINT ["python", "/app/run.py"]

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ pypef --help
6767
The detailed routine for setting up a new virtual environment with Anaconda, installing the necessary Python packages for that environment, and running the Jupyter notebook tutorial can be found below in the Tutorial section.
6868
A quick file setup and run test can be performed running files in [scripts/Setup](scripts/Setup) containing a Batch script for Windows and a Bash script for Linux (the latter requires conda, i.e. Miniconda3 or Anaconda3, already being installed).
6969

70+
### Setup and Run Docker Image
71+
72+
Build the image using the stored [Dockerfile](./Dockerfile)
73+
```bash
74+
docker build -t pypef . # --progress=plain --no-cache
75+
```
76+
77+
A chained container command using the built Docker image can be run with e.g.:
78+
```
79+
docker run --gpus=all -v ./datasets/:/datasets --workdir /datasets/AVGFP pypef /bin/bash -c \
80+
"python /app/run.py mklsts --wt P42212_F64L.fasta --input avGFP.csv --ls_proportion 0.01 && \
81+
python /app/run.py hybrid --ls LS.fasl --ts TS.fasl --params GREMLIN --llm prosst --wt P42212_F64L.fasta --pdb GFP_AEQVI.pdb"
82+
83+
```
84+
85+
7086
<a name="gui-installation"></a>
7187
### GUI Installation
7288

build_with_pyinstaller.bat

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
REM Up to now pastes DLLs from local Python environment bin's to _internal...
2-
REM alternative?: set PATH=%PATH%;%USERPROFILE%\miniconda3\envs\py312\Library\bin\;
2+
REM alternative?: set PATH=%PATH%;%USERPROFILE%\miniconda3\envs\pypef\Library\bin\;
33
pip install -r requirements.txt
44
pip install -U pyinstaller pyside6
55
pip install -e .
6+
set PATH=%PATH%;%USERPROFILE%\miniconda3\Scripts
67
pyinstaller^
78
--console^
89
--noconfirm^
10+
--collect-data pypef^
11+
--collect-all pypef^
912
--collect-data torch^
1013
--collect-data biotite^
1114
--collect-all biotite^
1215
--collect-data torch_geometric^
1316
--collect-all torch_geometric^
1417
--hidden-import torch_geometric^
15-
--add-binary=%USERPROFILE%\miniconda3\envs\py312\Library\bin\onedal_thread.3.dll:.^
16-
--add-binary=%USERPROFILE%\miniconda3\envs\py312\Library\bin\tbbbind.dll:.^
17-
--add-binary=%USERPROFILE%\miniconda3\envs\py312\Library\bin\tbbbind_2_0.dll:.^
18-
--add-binary=%USERPROFILE%\miniconda3\envs\py312\Library\bin\tbbbind_2_5.dll:.^
19-
--add-binary=%USERPROFILE%\miniconda3\envs\py312\Library\bin\tbbmalloc.dll:.^
20-
--add-binary=%USERPROFILE%\miniconda3\envs\py312\Library\bin\tbbmalloc_proxy.dll:.^
18+
--add-binary=%USERPROFILE%\miniconda3\envs\pypef\Library\bin\onedal_thread.3.dll:.^
19+
--add-binary=%USERPROFILE%\miniconda3\envs\pypef\Library\bin\tbbbind.dll:.^
20+
--add-binary=%USERPROFILE%\miniconda3\envs\pypef\Library\bin\tbbbind_2_0.dll:.^
21+
--add-binary=%USERPROFILE%\miniconda3\envs\pypef\Library\bin\tbbbind_2_5.dll:.^
22+
--add-binary=%USERPROFILE%\miniconda3\envs\pypef\Library\bin\tbbmalloc.dll:.^
23+
--add-binary=%USERPROFILE%\miniconda3\envs\pypef\Library\bin\tbbmalloc_proxy.dll:.^
2124
gui\PyPEFGUIQtWindow.py

build_with_pyinstaller.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ pip install -e .
55
pyinstaller \
66
--console \
77
--noconfirm \
8+
--collect-data pypef \
9+
--collect-all pypef \
810
--collect-data torch \
911
--collect-data biotite \
1012
--collect-all biotite \

pypef/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# Journal of Chemical Information and Modeling, 2021, 61, 3463-3476
1313
# https://doi.org/10.1021/acs.jcim.1c00099
1414

15-
__version__ = '0.4.1'
15+
__version__ = '0.4.2'

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
url='https://github.com/niklases/PyPEF',
4040
py_modules=['pypef'],
4141
packages=find_packages(include=['pypef', 'pypef.*']),
42-
package_data={'pypef': ['ml/AAindex/*', 'ml/AAindex/Refined_cluster_indices_r0.93_r0.97/*']},
42+
package_data={'pypef': [
43+
'ml/AAindex/*',
44+
'ml/AAindex/Refined_cluster_indices_r0.93_r0.97/*',
45+
'llm/prosst_structure/static/*'
46+
]},
4347
include_package_data=True,
4448
install_requires=[cleaned_requirements],
4549
python_requires='>= 3.10, < 3.13',

0 commit comments

Comments
 (0)