Skip to content

Commit

Permalink
fix-side-chain (#68)
Browse files Browse the repository at this point in the history
Co-authored-by: Brandon Duane Walker <[email protected]>
  • Loading branch information
misterbrandonwalker and Brandon Duane Walker authored May 29, 2024
1 parent d436818 commit 616c218
Show file tree
Hide file tree
Showing 13 changed files with 235 additions and 0 deletions.
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]
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,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
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.
14 changes: 14 additions & 0 deletions utils/pre-process/structure-change/fix-side-chain-tool/README.md
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 |
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,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 utils/pre-process/structure-change/fix-side-chain-tool/ict.yml
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
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 = [
"."
]
Git LFS file not shown
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for fix_side_chain."""
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()

0 comments on commit 616c218

Please sign in to comment.