-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: start working on docker * fix: paths git clone certs etc. * fix: docker base img * ci: add docker workflow * fix: path * refactor: put pipeline in separate script * ci: run script * ci: dont run pipeline in build * ci: use quay * ci: entry point script * ci: entrypoint * fix: forgot shebang * ci: cleanup * ci: use secrets
- Loading branch information
Showing
3 changed files
with
96 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Base image containing the installed gt4sd environment | ||
#FROM drugilsberg/gt4sd-base:v1.4.2-cpu | ||
FROM quay.io/gt4sd/gt4sd-base:v1.4.2-cpu | ||
|
||
|
||
# Certs for git clone | ||
RUN apt-get update && \ | ||
apt-get install -y git ca-certificates && \ | ||
apt-get clean | ||
|
||
RUN git clone --branch add-docker https://github.com/GT4SD/molecular-design.git | ||
WORKDIR /workspace/molecular-design | ||
|
||
# hack: We need to use the pypi toxsmi package, not the default one | ||
RUN pip uninstall --yes toxsmi && pip install toxsmi && mkdir data | ||
|
||
# hack: should be done in base gt4sd | ||
RUN pip uninstall --yes torch-scatter torch-sparse torch-cluster torch-geometric && \ | ||
pip install --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.12.0+cpu.html && \ | ||
pip install --no-index torch-sparse -f https://pytorch-geometric.com/whl/torch-1.12.0+cpu.html && \ | ||
pip install --no-index torch-cluster -f https://pytorch-geometric.com/whl/torch-1.12.0+cpu.html && \ | ||
pip install torch-geometric -f https://pytorch-geometric.com/whl/torch-1.12.0+cpu.html | ||
|
||
RUN chmod +x example_pipeline.sh | ||
|
||
ENTRYPOINT ["./example_pipeline.sh"] | ||
|
||
#CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
python scripts/load_data.py \ | ||
--uniprot P05067 \ | ||
--affinity_type IC50 \ | ||
--affinity_cutoff 10000 \ | ||
--output_dir data/ \ | ||
--train_size 0.8 \ | ||
--binary_labels | ||
|
||
# Train toxsmi model | ||
python scripts/train_toxsmi.py \ | ||
--train data/train.csv \ | ||
--test data/valid.csv \ | ||
--smi data/mols.smi \ | ||
--language tokenizer \ | ||
--params config/toxsmi_conf.json \ | ||
--model models \ | ||
--name toxsmi_model | ||
|
||
# Generate molecules with MoLeR | ||
head -n 5 data/mols.smi > data/good_docks.smi | ||
python scripts/moler_generate_toxsmi.py \ | ||
--smi_path data/good_docks.smi \ | ||
--param_path config/moler_conf.json \ | ||
--output_path data/moler_filtered \ | ||
--predictor_path models/toxsmi_model/weights/best_F1.pt | ||
|
||
# Generate more diverse molecules with Regression Transformer | ||
python scripts/prepare_rt_data.py \ | ||
--smi_path data/moler_filtered/generated.csv \ | ||
--output_path data/moler_filtered/generated_qed.csv && \ | ||
head -n 10 data/moler_filtered/generated_qed.csv > data/moler_filtered/generated_qed_selected.csv | ||
python scripts/rt_generate.py \ | ||
--smi_path data/moler_filtered/generated_qed_selected.csv \ | ||
--param_path config/rt_conf.json \ | ||
--output_path data/rt | ||
|
||
python scripts/inference_dataset.py -i data/rt/qed_rt_conf_generated_qed_selected/generated.csv | ||
|
||
python scripts/test_toxsmi.py \ | ||
--model_path models/toxsmi_model \ | ||
--smi_filepath generated.smi \ | ||
--label_filepath dummy_data.csv \ | ||
--checkpoint_name F1 | ||
|
||
# Calculate properties | ||
python scripts/mol_properties.py \ | ||
--smi_path models/toxsmi_model/results/dummy_data_F1_results_flat.csv \ | ||
--output_path mol_props.csv | ||
|
||
# Run RXN | ||
pip install rxn4chemistry | ||
head -n 2 data/rt/qed_rt_conf_generated_qed_selected/generated.csv > selected_for_retro.csv | ||
python scripts/retrosynthesis.py selected_for_retro.csv \ | ||
--api_key $API_KEY \ | ||
--project_id $PROJ_ID \ | ||
--steps 4 \ | ||
--timeout 100 \ | ||
--name my_retrosynthesis |