From a96a282e16e98e7ea58d00631b8adc80dec9db5b Mon Sep 17 00:00:00 2001 From: Brandon Duane Walker Date: Wed, 22 May 2024 16:40:32 -0400 Subject: [PATCH] openfold --- cwl_adapters/openfold.cwl | 89 ++++++++++++++++++++++++++++++++++ examples/generation/Dockerfile | 30 ++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 cwl_adapters/openfold.cwl create mode 100644 examples/generation/Dockerfile diff --git a/cwl_adapters/openfold.cwl b/cwl_adapters/openfold.cwl new file mode 100644 index 0000000..d87e58f --- /dev/null +++ b/cwl_adapters/openfold.cwl @@ -0,0 +1,89 @@ +#!/usr/bin/env cwl-runner +cwlVersion: v1.0 + +class: CommandLineTool + +label: OpenFold Inference + +baseCommand: ["python3", "run_pretrained_openfold.py"] + +hints: + DockerRequirement: + dockerPull: mrbrandonwalker/openfold-tool:0.1.0 + +inputs: + + input_fasta_dir: + type: Directory + inputBinding: + position: 1 + + mmcif_dir: + type: Directory + inputBinding: + position: 2 + + output_dir: + type: Directory + inputBinding: + prefix: --output_dir + position: 3 + + config_preset: + type: string? + default: model_1_ptm + inputBinding: + prefix: --config_preset + + uniref90_database_path: + type: Directory + inputBinding: + prefix: --uniref90_database_path + position: 4 + + mgnify_database_path: + type: File + inputBinding: + prefix: --mgnify_database_path + position: 5 + + pdb70_database_path: + type: Directory + inputBinding: + prefix: --pdb70_database_path + position: 6 + + uniclust30_database_path: + type: Directory + inputBinding: + prefix: --uniclust30_database_path + position: 7 + + bfd_database_path: + type: File + inputBinding: + prefix: --bfd_database_path + position: 8 + + model_device: + type: string? + default: "cuda:0" + inputBinding: + prefix: --model_device + +outputs: + + stdout: + type: File + outputBinding: + glob: stdout + +stdout: stdout + + +$namespaces: + edam: https://edamontology.org/ + +$schemas: +- https://raw.githubusercontent.com/edamontology/edamontology/master/EDAM_dev.owl + diff --git a/examples/generation/Dockerfile b/examples/generation/Dockerfile new file mode 100644 index 0000000..9968cf4 --- /dev/null +++ b/examples/generation/Dockerfile @@ -0,0 +1,30 @@ +# docker build -f Dockerfile -t mrbrandonwalker/openfold-tool:0.1.0 . +FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04 + +RUN apt-key del 7fa2af80 +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub + +RUN apt-get update && apt-get install -y wget libxml2 cuda-minimal-build-11-3 libcusparse-dev-11-3 libcublas-dev-11-3 libcusolver-dev-11-3 git +RUN wget -P /tmp \ + "https://github.com/conda-forge/miniforge/releases/download/23.3.1-1/Miniforge3-Linux-x86_64.sh" \ + && bash /tmp/Miniforge3-Linux-x86_64.sh -b -p /opt/conda \ + && rm /tmp/Miniforge3-Linux-x86_64.sh +ENV PATH /opt/conda/bin:$PATH + +WORKDIR /opt/ + +RUN git clone https://github.com/aqlaboratory/openfold.git + +WORKDIR /opt/openfold + +RUN mamba env update -n base --file /opt/openfold/environment.yml && mamba clean --all +RUN export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH} +RUN wget -q -P /opt/openfold/openfold/resources \ + https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt +RUN python3 setup.py install + +# by default openfold looks for parameters in the resources directory +RUN mkdir resources + +RUN bash scripts/download_alphafold_params.sh resources \ No newline at end of file