-
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 9cb9568
Showing
11 changed files
with
229 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,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/config_tag_pdb2gmx/__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,15 @@ | ||
# config_tag_pdb2gmx (0.1.0) | ||
|
||
Returns a dictionary of the given arguments as a JSON-encoded string. | ||
|
||
## Options | ||
|
||
This plugin takes 4 input arguments and 1 output argument: | ||
|
||
| Name | Description | I/O | Type | Default | | ||
|---------------|-------------------------|--------|--------|---------| | ||
| water_type | | Input | string | string | | ||
| forcefield | | Input | string | string | | ||
| ignh | | Input | boolean | boolean | | ||
| merge | | Input | boolean | boolean | | ||
| output_config_string | A dictionary of the given arguments as a JSON-encoded string. | Output | string | string | |
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,56 @@ | ||
#!/usr/bin/env cwl-runner | ||
class: CommandLineTool | ||
cwlVersion: v1.0 | ||
|
||
label: Returns a dictionary of the given arguments as a JSON-encoded string. | ||
doc: |- | ||
Returns a dictionary of the given arguments as a JSON-encoded string. | ||
|
||
baseCommand: echo # Anything, unused | ||
|
||
requirements: | ||
InlineJavascriptRequirement: {} | ||
|
||
inputs: | ||
water_type: | ||
type: string | ||
format: | ||
- edam:format_2330 | ||
|
||
forcefield: | ||
type: string | ||
format: edam:format_2330 | ||
|
||
ignh: | ||
type: boolean | ||
format: edam:format_2330 | ||
|
||
merge: | ||
type: boolean | ||
format: edam:format_2330 | ||
|
||
# TODO: his | ||
|
||
outputs: | ||
output_config_string: | ||
label: A dictionary of the given arguments as a JSON-encoded string. | ||
doc: |- | ||
A dictionary of the given arguments as a JSON-encoded string. | ||
type: string | ||
#format: edam:format_2330 # "'str' object does not support item assignment"" | ||
outputBinding: | ||
outputEval: | | ||
${ | ||
var config = {}; | ||
config["water_type"] = inputs.water_type; | ||
config["force_field"] = inputs.forcefield; // Note underscore | ||
config["ignh"] = inputs.ignh; | ||
config["merge"] = inputs.merge; | ||
return JSON.stringify(config); | ||
} | ||
|
||
$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,60 @@ | ||
specVersion: "0.1.0" | ||
name: config_tag_pdb2gmx | ||
version: 0.1.0 | ||
container: config-tag-pdb2gmx-plugin | ||
entrypoint: | ||
title: config_tag_pdb2gmx | ||
description: Returns a dictionary of the given arguments as a JSON-encoded string. | ||
author: Data Scientist | ||
contact: [email protected] | ||
repository: | ||
documentation: | ||
citation: | ||
|
||
inputs: | ||
- name: water_type | ||
required: true | ||
description: | ||
type: string | ||
format: | ||
uri: edam:format_2330 | ||
- name: forcefield | ||
required: true | ||
description: | ||
type: string | ||
format: | ||
uri: edam:format_2330 | ||
- name: ignh | ||
required: true | ||
description: | ||
type: boolean | ||
format: | ||
uri: edam:format_2330 | ||
- name: merge | ||
required: true | ||
description: | ||
type: boolean | ||
format: | ||
uri: edam:format_2330 | ||
outputs: | ||
- name: output_config_string | ||
required: true | ||
description: A dictionary of the given arguments as a JSON-encoded string. | ||
type: string | ||
ui: | ||
- key: inputs.water_type | ||
title: "water_type: " | ||
description: "" | ||
type: string | ||
- key: inputs.forcefield | ||
title: "forcefield: " | ||
description: "" | ||
type: string | ||
- key: inputs.ignh | ||
title: "ignh: " | ||
description: "" | ||
type: checkbox | ||
- key: inputs.merge | ||
title: "merge: " | ||
description: "" | ||
type: checkbox |
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,30 @@ | ||
[tool.poetry] | ||
name = "polus-mm-utils-config-tag-pdb2gmx" | ||
version = "0.1.0" | ||
description = "Returns a dictionary of the given arguments as a JSON-encoded string." | ||
authors = ["Data Scientist <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.9,<3.12" | ||
typer = "^0.7.0" | ||
cwl-utils = "0.33" | ||
cwltool = "3.1.20240404144621" | ||
|
||
[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 config_tag_pdb2gmx.""" |
27 changes: 27 additions & 0 deletions
27
utils/config-tag-pdb2gmx-plugin/tests/test_config_tag_pdb2gmx.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,27 @@ | ||
"""Tests for config_tag_pdb2gmx.""" | ||
import sys | ||
from pathlib import Path | ||
|
||
current_dir = Path(__file__).resolve().parent | ||
target_dir = current_dir.parent.parent.parent / "cwl_utils" | ||
sys.path.append(str(target_dir)) | ||
|
||
from cwl_utilities import call_cwltool # noqa: E402 | ||
from cwl_utilities import create_input_yaml # noqa: E402 | ||
from cwl_utilities import parse_cwl_arguments # noqa: E402 | ||
|
||
|
||
def test_config_tag_pdb2gmx() -> None: | ||
"""Test config_tag_pdb2gmx.""" | ||
cwl_file = Path("config_tag_pdb2gmx.cwl") | ||
input_to_props = parse_cwl_arguments(cwl_file) | ||
|
||
input_to_props["water_type"] = "spec" | ||
input_to_props["forcefield"] = "mber99sb-ildn" | ||
input_to_props["ignh"] = True | ||
input_to_props["merge"] = False | ||
input_yaml_path = Path("config_tag_pdb2gmx.yml") | ||
|
||
create_input_yaml(input_to_props, input_yaml_path) | ||
stdout, stderr = call_cwltool(cwl_file, input_yaml_path) | ||
assert "success" in stderr |