-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d5007e
commit e48b9b4
Showing
15 changed files
with
232 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.pdb filter=lfs diff=lfs merge=lfs -text | ||
*.pdbqt filter=lfs diff=lfs merge=lfs -text | ||
*.mol2 filter=lfs diff=lfs merge=lfs -text |
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,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/obmin/__init__.py] |
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,4 @@ | ||
.venv | ||
out | ||
tests | ||
__pycache__ |
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 @@ | ||
poetry.lock |
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,5 @@ | ||
# CHANGELOG | ||
|
||
## 0.1.0 | ||
|
||
Initial release. |
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,4 @@ | ||
# docker build -f Dockerfile -t polusai/openbabel-tool . | ||
FROM condaforge/mambaforge | ||
# NOT mambaforge-pypy3 (openbabel is incompatible with pypy) | ||
RUN mamba install -c conda-forge openbabel |
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,14 @@ | ||
# obmin (0.1.0) | ||
|
||
Minimize a molecule using Open Babel | ||
|
||
## Options | ||
|
||
This plugin takes 3 input arguments and 1 output argument: | ||
|
||
| Name | Description | I/O | Type | Default | | ||
|---------------|-------------------------|--------|--------|---------| | ||
| script | Minimize script | Input | string | string | | ||
| input_mol2_path | Input mol2 file | Input | File | File | | ||
| output_mol2_path | Output mol2 filename | Input | string | string | | ||
| output_mol2_path | Output mol2 file | Output | File | File | |
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 @@ | ||
0.1.0 |
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,51 @@ | ||
specVersion: "0.1.0" | ||
name: obmin | ||
version: 0.1.0 | ||
container: obmin-tool | ||
entrypoint: | ||
title: obmin | ||
description: Minimize a molecule using OpenBabel | ||
author: Brandon Walker, OpenBabel | ||
contact: [email protected] | ||
repository: | ||
documentation: | ||
citation: | ||
|
||
inputs: | ||
- name: script | ||
required: true | ||
description: | ||
type: string | ||
- name: input_mol2_path | ||
required: true | ||
description: | ||
type: File | ||
format: | ||
uri: edam:format_3816 | ||
- name: output_mol2_path | ||
required: true | ||
description: | ||
type: string | ||
defaultValue: system.mol2 | ||
format: | ||
uri: edam:format_3816 | ||
outputs: | ||
- name: output_mol2_path | ||
required: true | ||
description: | ||
type: File | ||
format: | ||
uri: edam:format_3816 | ||
ui: | ||
- key: inputs.script | ||
title: "script: " | ||
description: "" | ||
type: string | ||
- key: inputs.input_mol2_path | ||
title: "input_mol2_path: " | ||
description: "" | ||
type: File | ||
- key: inputs.output_mol2_path | ||
title: "output_mol2_path: " | ||
description: "" | ||
type: string |
50 changes: 50 additions & 0 deletions
50
utils/pre-process/minimize/obmin-tool/obmin_0@[email protected]
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,50 @@ | ||
#!/usr/bin/env cwl-runner | ||
cwlVersion: v1.0 | ||
|
||
class: CommandLineTool | ||
|
||
label: Run a Bash script | ||
|
||
doc: | | ||
Run a Bash script | ||
|
||
baseCommand: bash | ||
|
||
hints: | ||
DockerRequirement: | ||
dockerPull: polusai/openbabel-tool@sha256:e685b764da702f37da5688766f976fc4b989054e090830e9c95c2510fe3112c6 | ||
|
||
inputs: | ||
script: | ||
type: string | ||
inputBinding: | ||
position: 1 | ||
|
||
input_mol2_path: | ||
type: File | ||
format: edam:format_3816 | ||
inputBinding: | ||
position: 2 | ||
|
||
output_mol2_path: | ||
type: string | ||
format: edam:format_3816 | ||
# inputBinding: | ||
# position: 3 | ||
default: system.mol2 | ||
|
||
outputs: | ||
output_mol2_path: | ||
type: File | ||
format: edam:format_3816 # 'Textual format' | ||
streamable: true | ||
outputBinding: | ||
glob: $(inputs.output_mol2_path) | ||
|
||
stdout: $(inputs.output_mol2_path) | ||
|
||
$namespaces: | ||
edam: https://edamontology.org/ | ||
|
||
$schemas: | ||
- https://raw.githubusercontent.com/edamontology/edamontology/master/EDAM_dev.owl |
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,6 @@ | ||
#!/bin/bash -e | ||
# -cg is the default minimization algorithm, but it falsely claims to reach | ||
# convergence on the second timestep. (same with -newton) | ||
# Use steepest descent because it's the only one that works! | ||
obminimize -sd -o mol2 "$1" > temp.mol2 # -xu is ignored here | ||
obabel temp.mol2 -o mol2 -O "$2" -xu |
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 @@ | ||
[tool.poetry] | ||
name = "polus-mm-utils-obmin" | ||
version = "0.1.0" | ||
description = "Run a Bash script" | ||
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 = [ | ||
"." | ||
] |
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 @@ | ||
"""Tests for obmin.""" |
Git LFS file not shown
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,32 @@ | ||
"""Tests for obmin.""" | ||
from pathlib import Path | ||
|
||
from sophios.api.pythonapi import Step | ||
from sophios.api.pythonapi import Workflow | ||
|
||
|
||
def test_obmin() -> None: | ||
"""Test obmin.""" | ||
cwl_file = Path("obmin_0@[email protected]") | ||
|
||
# Create the step for the CWL file | ||
obmin_step = Step(clt_path=cwl_file) | ||
|
||
# Set up the inputs for the step | ||
obmin_step.script = "/obminimize.sh" | ||
obmin_step.input_mol2_path = str(Path(__file__).resolve().parent / "benzene.mol2") | ||
obmin_step.output_mol2_path = "system.mol2" | ||
|
||
# Define the workflow with the step | ||
steps = [obmin_step] | ||
filename = "obmin_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.mol2" for file in outdir.rglob("*") | ||
), "The file system.mol2 was not found." |