From 1c6d9582d0d8e1963afc9123baeac0898e35362d Mon Sep 17 00:00:00 2001 From: Olamide Israel Date: Fri, 14 Mar 2025 10:46:31 -0700 Subject: [PATCH] Add Nextflow pipeline for PROPKA with Docker configuration --- Dockerfile | 23 +++++++++++++++++ main.nf | 30 +++++++++++++++++++++ nextflow.config | 37 ++++++++++++++++++++++++++ params.json | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 159 insertions(+) create mode 100644 Dockerfile create mode 100644 main.nf create mode 100644 nextflow.config create mode 100644 params.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2c09442 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM python:3.10-slim-bullseye + +# Update and install basic utilities and dependencies +RUN apt-get update -y \ + && apt-get -y upgrade --fix-missing \ + && apt-get -y install git procps coreutils \ + build-essential \ + gcc \ + python3-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /workspace + +# Install PROPKA with dependencies +RUN pip install --no-cache-dir numpy pytest \ + && pip install --no-cache-dir propka + +# Make propka3 available in PATH (should already be in path from pip install) +ENV PATH="/usr/local/bin:${PATH}" + +# Test that the installation worked +RUN propka3 --help diff --git a/main.nf b/main.nf new file mode 100644 index 0000000..c11293d --- /dev/null +++ b/main.nf @@ -0,0 +1,30 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl=2 + +params.pdb = "/mnt/OmicNAS/private/old/olamide/propka/input/1HPX.pdb" +params.outdir = "/mnt/OmicNAS/private/old/olamide/propka/output" +params.ph = 7.0 +params.options = "" + +process PROPKA { + container 'propka:latest' + publishDir params.outdir, mode: 'copy' + + input: + path pdb + + output: + path "${pdb.baseName}.pka", emit: pka_file + path "run.log" + + script: + """ + propka3 ${params.options} --pH ${params.ph} ${pdb} 2>&1 | tee run.log + """ +} + +workflow { + pdb_files = Channel.fromPath(params.pdb) + PROPKA(pdb_files) +} diff --git a/nextflow.config b/nextflow.config new file mode 100644 index 0000000..bdf4600 --- /dev/null +++ b/nextflow.config @@ -0,0 +1,37 @@ +// Manifest for Nextflow metadata +manifest { + name = 'PROPKA-Nextflow' + author = 'Generated from PROPKA repository' + homePage = 'https://github.com/jensengroup/propka' + description = 'Nextflow pipeline for PROPKA - Empirical pKa prediction for proteins and protein-ligand complexes' + mainScript = 'main.nf' + version = '1.0.0' +} + +// Global default parameters +params { + pdb = "/mnt/OmicNAS/private/old/olamide/propka/input/1HPX.pdb" + outdir = "/mnt/OmicNAS/private/old/olamide/propka/output" + ph = 7.0 + options = "" +} + +// Container configurations +docker { + enabled = true + runOptions = '' +} + +// Process configurations +process { + cpus = 1 + memory = '4 GB' +} + +// Execution configurations +executor { + $local { + cpus = 2 + memory = '4 GB' + } +} diff --git a/params.json b/params.json new file mode 100644 index 0000000..aed0259 --- /dev/null +++ b/params.json @@ -0,0 +1,69 @@ +{ + "params": { + "pdb": { + "type": "file", + "description": "Path pattern to PDB files for pKa prediction", + "default": "/mnt/OmicNAS/private/old/olamide/propka/input/1HPX.pdb", + "required": true, + "pipeline_io": "input", + "var_name": "params.pdb", + "examples": [ + "/mnt/OmicNAS/private/old/olamide/propka/input/protein.pdb", + "/mnt/OmicNAS/private/old/olamide/propka/input/*.pdb" + ], + "pattern": ".*\\.pdb$", + "enum": [], + "validation": {}, + "notes": "Can be a single PDB file or a pattern to match multiple PDB files." + }, + "outdir": { + "type": "folder", + "description": "Directory for PROPKA prediction results", + "default": "/mnt/OmicNAS/private/old/olamide/propka/output", + "required": true, + "pipeline_io": "output", + "var_name": "params.outdir", + "examples": [ + "/mnt/OmicNAS/private/old/olamide/propka/output", + "/path/to/custom/output" + ], + "pattern": ".*", + "enum": [], + "validation": {}, + "notes": "Directory where pKa prediction results will be stored. Will be created if it doesn't exist." + }, + "ph": { + "type": "number", + "description": "pH value for titration calculations", + "default": 7.0, + "required": false, + "pipeline_io": "parameter", + "var_name": "params.ph", + "examples": [ + 7.0, + 5.5 + ], + "validation": { + "min": 0.0, + "max": 14.0 + }, + "notes": "The pH value used for calculating residue protonation states." + }, + "options": { + "type": "string", + "description": "Additional command-line options for PROPKA", + "default": "", + "required": false, + "pipeline_io": "parameter", + "var_name": "params.options", + "examples": [ + "--titrate_only Asp,Glu", + "--window 1.0" + ], + "pattern": ".*", + "enum": [], + "validation": {}, + "notes": "Additional command-line options to pass to propka3. See propka3 --help for available options." + } + } +}