-
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.
Co-authored-by: Brandon Duane Walker <[email protected]>
- Loading branch information
1 parent
d436818
commit 616c218
Showing
13 changed files
with
235 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
utils/pre-process/structure-change/fix-side-chain-tool/.bumpversion.cfg
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/fix_side_chain/__init__.py] |
4 changes: 4 additions & 0 deletions
4
utils/pre-process/structure-change/fix-side-chain-tool/.dockerignore
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__ |
3 changes: 3 additions & 0 deletions
3
utils/pre-process/structure-change/fix-side-chain-tool/.gitattributes
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 |
1 change: 1 addition & 0 deletions
1
utils/pre-process/structure-change/fix-side-chain-tool/.gitignore
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 |
5 changes: 5 additions & 0 deletions
5
utils/pre-process/structure-change/fix-side-chain-tool/CHANGELOG.md
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. |
14 changes: 14 additions & 0 deletions
14
utils/pre-process/structure-change/fix-side-chain-tool/README.md
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 @@ | ||
# fix_side_chain (0.1.0) | ||
|
||
Class to model the missing atoms in amino acid side chains of a PDB. | ||
|
||
## Options | ||
|
||
This plugin takes 3 input arguments and 1 output argument: | ||
|
||
| Name | Description | I/O | Type | Default | | ||
|---------------|-------------------------|--------|--------|---------| | ||
| input_pdb_path | Input PDB file path, Type: string, File type: input, Accepted formats: pdb, Example file: https://github.com/bioexcel/biobb_model/raw/master/biobb_model/test/data/model/2ki5.pdb | Input | File | File | | ||
| output_pdb_path | Output PDB file path, Type: string, File type: output, Accepted formats: pdb, Example file: https://github.com/bioexcel/biobb_model/raw/master/biobb_model/test/reference/model/output_pdb_path.pdb | Input | string | string | | ||
| config | Advanced configuration options for biobb_model FixSideChain. This should be passed as a string containing a dict. The possible options to include here are listed under 'properties' in the biobb_model FixSideChain documentation: https://biobb-model.readthedocs.io/en/latest/model.html#module-model.fix_side_chain | Input | string | string | | ||
| output_pdb_path | Output PDB file path | 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 |
69 changes: 69 additions & 0 deletions
69
utils/pre-process/structure-change/fix-side-chain-tool/fix_side_chain.cwl
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,69 @@ | ||
#!/usr/bin/env cwl-runner | ||
cwlVersion: v1.0 | ||
|
||
class: CommandLineTool | ||
|
||
label: Class to model the missing atoms in amino acid side chains of a PDB. | ||
|
||
doc: |- | ||
Model the missing atoms in amino acid side chains of a PDB using biobb_structure_checking if the use_modeller property is added the Modeller suite will also be used to rebuild the missing atoms. | ||
|
||
baseCommand: fix_side_chain | ||
|
||
hints: | ||
DockerRequirement: | ||
dockerPull: quay.io/biocontainers/biobb_model:4.0.1--pyhdfd78af_0 | ||
|
||
inputs: | ||
input_pdb_path: | ||
label: Input PDB file path | ||
doc: |- | ||
Input PDB file path | ||
Type: string | ||
File type: input | ||
Accepted formats: pdb | ||
Example file: https://github.com/bioexcel/biobb_model/raw/master/biobb_model/test/data/model/2ki5.pdb | ||
type: File | ||
format: edam:format_1476 | ||
inputBinding: | ||
position: 1 | ||
prefix: --input_pdb_path | ||
|
||
output_pdb_path: | ||
label: Output PDB file path | ||
doc: |- | ||
Output PDB file path | ||
Type: string | ||
File type: output | ||
Accepted formats: pdb | ||
Example file: https://github.com/bioexcel/biobb_model/raw/master/biobb_model/test/reference/model/output_pdb_path.pdb | ||
type: string | ||
format: edam:format_1476 | ||
inputBinding: | ||
position: 2 | ||
prefix: --output_pdb_path | ||
default: system.pdb | ||
|
||
config: | ||
label: Advanced configuration options for biobb_model FixSideChain | ||
doc: |- | ||
Advanced configuration options for biobb_model FixSideChain. This should be passed as a string containing a dict. The possible options to include here are listed under 'properties' in the biobb_model FixSideChain documentation: https://biobb-model.readthedocs.io/en/latest/model.html#module-model.fix_side_chain | ||
type: string? | ||
inputBinding: | ||
prefix: --config | ||
|
||
outputs: | ||
output_pdb_path: | ||
label: Output PDB file path | ||
doc: |- | ||
Output PDB file path | ||
type: File | ||
outputBinding: | ||
glob: $(inputs.output_pdb_path) | ||
format: edam:format_1476 | ||
|
||
$namespaces: | ||
edam: https://edamontology.org/ | ||
|
||
$schemas: | ||
- https://raw.githubusercontent.com/edamontology/edamontology/master/EDAM_dev.owl |
51 changes: 51 additions & 0 deletions
51
utils/pre-process/structure-change/fix-side-chain-tool/ict.yml
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: fix_side_chain | ||
version: 0.1.0 | ||
container: fix-side-chain-tool | ||
entrypoint: | ||
title: fix_side_chain | ||
description: Class to model the missing atoms in amino acid side chains of a PDB. | ||
author: Data Scientist | ||
contact: [email protected] | ||
repository: | ||
documentation: | ||
citation: | ||
|
||
inputs: | ||
- name: input_pdb_path | ||
required: true | ||
description: Input PDB file path, Type string, File type input, Accepted formats pdb, Example file https//github.com/bioexcel/biobb_model/raw/master/biobb_model/test/data/model/2ki5.pdb | ||
type: File | ||
format: | ||
uri: edam:format_1476 | ||
- name: output_pdb_path | ||
required: true | ||
description: Output PDB file path, Type string, File type output, Accepted formats pdb, Example file https//github.com/bioexcel/biobb_model/raw/master/biobb_model/test/reference/model/output_pdb_path.pdb | ||
type: string | ||
defaultValue: system.pdb | ||
format: | ||
uri: edam:format_1476 | ||
- name: config | ||
required: true | ||
description: Advanced configuration options for biobb_model FixSideChain. This should be passed as a string containing a dict. The possible options to include here are listed under 'properties' in the biobb_model FixSideChain documentation https//biobb-model.readthedocs.io/en/latest/model.html#module-model.fix_side_chain | ||
type: string | ||
outputs: | ||
- name: output_pdb_path | ||
required: true | ||
description: Output PDB file path | ||
type: File | ||
format: | ||
uri: edam:format_1476 | ||
ui: | ||
- key: inputs.input_pdb_path | ||
title: "input_pdb_path: " | ||
description: "Input PDB file path, Type string, File type input, Accepted formats pdb, Example file https//github.com/bioexcel/biobb_model/raw/master/biobb_model/test/data/model/2ki5.pdb" | ||
type: File | ||
- key: inputs.output_pdb_path | ||
title: "output_pdb_path: " | ||
description: "Output PDB file path, Type string, File type output, Accepted formats pdb, Example file https//github.com/bioexcel/biobb_model/raw/master/biobb_model/test/reference/model/output_pdb_path.pdb" | ||
type: string | ||
- key: inputs.config | ||
title: "config: " | ||
description: "Advanced configuration options for biobb_model FixSideChain. This should be passed as a string containing a dict. The possible options to include here are listed under 'properties' in the biobb_model FixSideChain documentation https//biobb-model.readthedocs.io/en/latest/model.html#module-model.fix_side_chain" | ||
type: string |
30 changes: 30 additions & 0 deletions
30
utils/pre-process/structure-change/fix-side-chain-tool/pyproject.toml
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-fix-side-chain" | ||
version = "0.1.0" | ||
description = "Class to model the missing atoms in amino acid side chains of a PDB." | ||
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 = [ | ||
"." | ||
] |
3 changes: 3 additions & 0 deletions
3
utils/pre-process/structure-change/fix-side-chain-tool/tests/2ki5.pdb
Git LFS file not shown
1 change: 1 addition & 0 deletions
1
utils/pre-process/structure-change/fix-side-chain-tool/tests/__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 @@ | ||
"""Tests for fix_side_chain.""" |
24 changes: 24 additions & 0 deletions
24
utils/pre-process/structure-change/fix-side-chain-tool/tests/test_fix_side_chain.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,24 @@ | ||
"""Tests for fix_side_chain.""" | ||
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_fix_side_chain() -> None: | ||
"""Test fix_side_chain.""" | ||
cwl_file = Path("fix_side_chain.cwl") | ||
input_to_props = parse_cwl_arguments(cwl_file) | ||
file_path_str = "2ki5.pdb" | ||
file_path = str(Path(__file__).resolve().parent / Path(file_path_str)) | ||
input_to_props["input_pdb_path"]["path"] = file_path | ||
input_yaml_path = Path("fix_side_chain.yml") | ||
create_input_yaml(input_to_props, input_yaml_path) | ||
stdout, stderr = call_cwltool(cwl_file, input_yaml_path) | ||
assert Path("system.pdb").exists() |