Skip to content

Commit

Permalink
autodock-vina-run
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Duane Walker authored and misterbrandonwalker committed Aug 5, 2024
1 parent 23fb84d commit 5786766
Show file tree
Hide file tree
Showing 18 changed files with 354 additions and 6,554 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pdb filter=lfs diff=lfs merge=lfs -text
*.pdbqt filter=lfs diff=lfs merge=lfs -text
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[bumpversion]
current_version = 0.1.0
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<dev>\d+))?
serialize =
{major}.{minor}.{patch}-{release}{dev}
{major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = _
first_value = dev
values =
dev
_

[bumpversion:part:dev]

[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:VERSION]

[bumpversion:file:README.md]

[bumpversion:file:plugin.json]

[bumpversion:file:src/polus/mm/utils/autodock_vina_run/__init__.py]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.venv
out
tests
__pycache__
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poetry.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG

## 0.1.0

Initial release.
18 changes: 18 additions & 0 deletions utils/docking/autodock-vina/autodock-vina-run-tool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# autodock_vina_run (0.1.0)

Wrapper of the AutoDock Vina software.

## Options

This plugin takes 6 input arguments and 2 output argument:

| Name | Description | I/O | Type | Default |
|---------------|-------------------------|--------|--------|---------|
| input_ligand_pdbqt_path | Path to the input PDBQT ligand, Type: string, File type: input, Accepted formats: pdbqt, Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_ligand.pdbqt | Input | File | File |
| input_receptor_pdbqt_path | Path to the input PDBQT receptor, Type: string, File type: input, Accepted formats: pdbqt, Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_receptor.pdbqt | Input | File | File |
| input_box_path | Path to the PDB containig the residues belonging to the binding site, Type: string, File type: input, Accepted formats: pdb, Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_box.pdb | Input | File | File |
| output_pdbqt_path | Path to the output PDBQT file, Type: string, File type: output, Accepted formats: pdbqt, Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/reference/vina/ref_output_vina.pdbqt | Input | string | string |
| output_log_path | Path to the log file, Type: string, File type: output, Accepted formats: log, Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/reference/vina/ref_output_vina.log | Input | string | string |
| config | Advanced configuration options for biobb_vs AutoDockVinaRun. This should be passed as a string containing a dict. The possible options to include here are listed under 'properties' in the biobb_vs AutoDockVinaRun documentation: https://biobb-vs.readthedocs.io/en/latest/vina.html#module-vina.autodock_vina_run | Input | string | string |
| output_pdbqt_path | Path to the output PDBQT file | Output | File | File |
| output_log_path | Path to the log file | Output | File | File |
1 change: 1 addition & 0 deletions utils/docking/autodock-vina/autodock-vina-run-tool/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.0

class: CommandLineTool

label: Wrapper of the AutoDock Vina software.

doc: |-
This class performs docking of the ligand to a set of grids describing the target protein via the AutoDock Vina software.

baseCommand: autodock_vina_run

hints:
DockerRequirement:
dockerPull: quay.io/biocontainers/biobb_vs:4.0.0--pyhdfd78af_2

inputs:
input_ligand_pdbqt_path:
label: Path to the input PDBQT ligand
doc: |-
Path to the input PDBQT ligand
Type: string
File type: input
Accepted formats: pdbqt
Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_ligand.pdbqt
type: File
format: edam:format_1476
inputBinding:
position: 1
prefix: --input_ligand_pdbqt_path

input_receptor_pdbqt_path:
label: Path to the input PDBQT receptor
doc: |-
Path to the input PDBQT receptor
Type: string
File type: input
Accepted formats: pdbqt
Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_receptor.pdbqt
type: File
format: edam:format_1476
inputBinding:
position: 2
prefix: --input_receptor_pdbqt_path

input_box_path:
label: Path to the PDB containig the residues belonging to the binding site
doc: |-
Path to the PDB containig the residues belonging to the binding site
Type: string
File type: input
Accepted formats: pdb
Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_box.pdb
type: File
format: edam:format_1476
inputBinding:
position: 3
prefix: --input_box_path

output_pdbqt_path:
label: Path to the output PDBQT file
doc: |-
Path to the output PDBQT file
Type: string
File type: output
Accepted formats: pdbqt
Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/reference/vina/ref_output_vina.pdbqt
type: string
format: edam:format_1476
inputBinding:
position: 4
prefix: --output_pdbqt_path
default: system.pdbqt

output_log_path:
label: Path to the log file
doc: |-
Path to the log file
Type: string
File type: output
Accepted formats: log
Example file: https://github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/reference/vina/ref_output_vina.log
type: string
format: edam:format_2330
inputBinding:
prefix: --output_log_path
default: system.log

config:
label: Advanced configuration options for biobb_vs AutoDockVinaRun
doc: |-
Advanced configuration options for biobb_vs AutoDockVinaRun. This should be passed as a string containing a dict. The possible options to include here are listed under 'properties' in the biobb_vs AutoDockVinaRun documentation: https://biobb-vs.readthedocs.io/en/latest/vina.html#module-vina.autodock_vina_run
type: string?
inputBinding:
prefix: --config

outputs:
output_pdbqt_path:
label: Path to the output PDBQT file
doc: |-
Path to the output PDBQT file
type: File
outputBinding:
glob: $(inputs.output_pdbqt_path)
format: edam:format_1476

output_log_path:
label: Path to the log file
doc: |-
Path to the log file
type: File?
outputBinding:
glob: $(inputs.output_log_path)
format: edam:format_2330

$namespaces:
edam: https://edamontology.org/

$schemas:
- https://raw.githubusercontent.com/edamontology/edamontology/master/EDAM_dev.owl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

version=$(<VERSION)
docker build . -t polusai/autodock-vina-run-tool:${version}
88 changes: 88 additions & 0 deletions utils/docking/autodock-vina/autodock-vina-run-tool/ict.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
specVersion: "0.1.0"
name: autodock_vina_run
version: 0.1.0
container: autodock-vina-run-tool
entrypoint:
title: autodock_vina_run
description: Wrapper of the AutoDock Vina software.
author: Brandon Walker, Nazanin Donyapour
contact: [email protected], [email protected]
repository:
documentation:
citation:

inputs:
- name: input_ligand_pdbqt_path
required: true
description: Path to the input PDBQT ligand, Type string, File type input, Accepted formats pdbqt, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_ligand.pdbqt
type: File
format:
uri: edam:format_1476
- name: input_receptor_pdbqt_path
required: true
description: Path to the input PDBQT receptor, Type string, File type input, Accepted formats pdbqt, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_receptor.pdbqt
type: File
format:
uri: edam:format_1476
- name: input_box_path
required: true
description: Path to the PDB containig the residues belonging to the binding site, Type string, File type input, Accepted formats pdb, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_box.pdb
type: File
format:
uri: edam:format_1476
- name: output_pdbqt_path
required: true
description: Path to the output PDBQT file, Type string, File type output, Accepted formats pdbqt, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/reference/vina/ref_output_vina.pdbqt
type: string
defaultValue: system.pdbqt
format:
uri: edam:format_1476
- name: output_log_path
required: true
description: Path to the log file, Type string, File type output, Accepted formats log, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/reference/vina/ref_output_vina.log
type: string
defaultValue: system.log
format:
uri: edam:format_2330
- name: config
required: true
description: Advanced configuration options for biobb_vs AutoDockVinaRun. This should be passed as a string containing a dict. The possible options to include here are listed under 'properties' in the biobb_vs AutoDockVinaRun documentation https//biobb-vs.readthedocs.io/en/latest/vina.html#module-vina.autodock_vina_run
type: string
outputs:
- name: output_pdbqt_path
required: true
description: Path to the output PDBQT file
type: File
format:
uri: edam:format_1476
- name: output_log_path
required: true
description: Path to the log file
type: File
format:
uri: edam:format_2330
ui:
- key: inputs.input_ligand_pdbqt_path
title: "input_ligand_pdbqt_path: "
description: "Path to the input PDBQT ligand, Type string, File type input, Accepted formats pdbqt, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_ligand.pdbqt"
type: File
- key: inputs.input_receptor_pdbqt_path
title: "input_receptor_pdbqt_path: "
description: "Path to the input PDBQT receptor, Type string, File type input, Accepted formats pdbqt, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_receptor.pdbqt"
type: File
- key: inputs.input_box_path
title: "input_box_path: "
description: "Path to the PDB containig the residues belonging to the binding site, Type string, File type input, Accepted formats pdb, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/data/vina/vina_box.pdb"
type: File
- key: inputs.output_pdbqt_path
title: "output_pdbqt_path: "
description: "Path to the output PDBQT file, Type string, File type output, Accepted formats pdbqt, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/reference/vina/ref_output_vina.pdbqt"
type: string
- key: inputs.output_log_path
title: "output_log_path: "
description: "Path to the log file, Type string, File type output, Accepted formats log, Example file https//github.com/bioexcel/biobb_vs/raw/master/biobb_vs/test/reference/vina/ref_output_vina.log"
type: string
- key: inputs.config
title: "config: "
description: "Advanced configuration options for biobb_vs AutoDockVinaRun. This should be passed as a string containing a dict. The possible options to include here are listed under 'properties' in the biobb_vs AutoDockVinaRun documentation https//biobb-vs.readthedocs.io/en/latest/vina.html#module-vina.autodock_vina_run"
type: string
28 changes: 28 additions & 0 deletions utils/docking/autodock-vina/autodock-vina-run-tool/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[tool.poetry]
name = "polus-mm-utils-autodock-vina-run"
version = "0.1.0"
description = "Wrapper of the AutoDock Vina software."
authors = ["Data Scientist <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
sophios = "0.1.1"

[tool.poetry.group.dev.dependencies]
bump2version = "^1.0.1"
pytest = "^7.4"
pytest-sugar = "^0.9.6"
pre-commit = "^3.2.1"
black = "^23.3.0"
mypy = "^1.1.1"
ruff = "^0.0.270"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
pythonpath = [
"."
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for autodock_vina_run."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""Tests for autodock_vina_run."""
from pathlib import Path

from sophios.api.pythonapi import Step
from sophios.api.pythonapi import Workflow


def test_autodock_vina_run() -> None:
"""Test autodock_vina_run."""
cwl_file = Path("autodock_vina_run_0@[email protected]")

# Create the step for the CWL file
autodock_vina_step = Step(clt_path=cwl_file)

# Set up the inputs for the step
ligand_file_path = str(Path(__file__).resolve().parent / "vina_ligand.pdbqt")
receptor_file_path = str(Path(__file__).resolve().parent / "vina_receptor.pdbqt")
box_file_path = str(Path(__file__).resolve().parent / "vina_box.pdb")

autodock_vina_step.input_ligand_pdbqt_path = ligand_file_path
autodock_vina_step.input_receptor_pdbqt_path = receptor_file_path
autodock_vina_step.input_box_path = box_file_path
autodock_vina_step.output_log_path = "system.log"
autodock_vina_step.output_pdbqt_path = "system.pdbqt"

# Define the workflow with the step
steps = [autodock_vina_step]
filename = "autodock_vina_workflow"
workflow = Workflow(steps, filename)

# Run the workflow
workflow.run()

# Check for the existence of the output file
outdir = Path("outdir")
assert any(
file.name == "system.pdbqt" for file in outdir.rglob("*")
), "The file system.pdbqt was not found."
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Loading

0 comments on commit 5786766

Please sign in to comment.