Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert_xyz plugin #43

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions utils/convert-xyz-plugin/.bumpversion.cfg
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/convert_xyz/__init__.py]
4 changes: 4 additions & 0 deletions utils/convert-xyz-plugin/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.venv
out
tests
__pycache__
1 change: 1 addition & 0 deletions utils/convert-xyz-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poetry.lock
5 changes: 5 additions & 0 deletions utils/convert-xyz-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG

## 0.1.0

Initial release.
13 changes: 13 additions & 0 deletions utils/convert-xyz-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# convert_xyz (0.1.0)

This class is a wrapper of the Open Babel tool.

## Options

This plugin takes 2 input arguments and 1 output argument:

| Name | Description | I/O | Type | Default |
|---------------|-------------------------|--------|--------|---------|
| input_path | Path to the input file, Type: string, File type: input, Accepted formats: gro, mol, mol2, pdb, pdbqt, sdf, Example file: https://github.com/bioexcel/biobb_chemistry/raw/master/biobb_chemistry/test/data/babel/babel.smi | Input | File | File |
| output_xyz_path | Path to the output file, Type: string, File type: output, Accepted formats: xyz | Input | string | string |
| output_xyz_path | Path to the output file | Output | File | File |
1 change: 1 addition & 0 deletions utils/convert-xyz-plugin/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
62 changes: 62 additions & 0 deletions utils/convert-xyz-plugin/convert_xyz.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.2

class: CommandLineTool

label: This class is a wrapper of the Open Babel tool.

doc: |-
Converts small molecules in 2D or 3D formats to the XYZ format.

baseCommand: obabel
#Usage:
#obabel[-i<input-type>] <infilename> [-o<output-type>] -O<outfilename> [Options]
#...
#Options, other than -i -o -O -m, must come after the input files.
arguments: [$(inputs.input_path), "-o", "xyz", "-O", $(inputs.output_xyz_path)]

hints:
DockerRequirement:
dockerPull: quay.io/biocontainers/biobb_chemistry:4.0.0--pyhdfd78af_1

requirements:
InlineJavascriptRequirement: {}

inputs:
input_path:
label: Path to the input file
doc: |-
Path to the input file
Type: string
File type: input
Accepted formats: gro, mol, mol2, pdb, pdbqt, sdf
Example file: https://github.com/bioexcel/biobb_chemistry/raw/master/biobb_chemistry/test/data/babel/babel.smi
type: File
format: edam:format_2033, edam:format_3815, edam:format_3816, edam:format_1476, edam:format_1476, edam:format_3814

output_xyz_path:
label: Path to the output file
doc: |-
Path to the output file
Type: string
File type: output
Accepted formats: xyz
type: string
format: edam:format_3877 # xyz
default: system.xyz

outputs:
output_xyz_path:
label: Path to the output file
doc: |-
Path to the output file
type: File
outputBinding:
glob: $(inputs.output_xyz_path)
format: edam:format_3877 # xyz

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

$schemas:
- https://raw.githubusercontent.com/edamontology/edamontology/master/EDAM_dev.owl
43 changes: 43 additions & 0 deletions utils/convert-xyz-plugin/ict.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
specVersion: "0.1.0"
name: convert_xyz
version: 0.1.0
container: convert-xyz-plugin
entrypoint:
title: convert_xyz
description: This class is a wrapper of the Open Babel tool.
author: Data Scientist
contact: [email protected]
repository:
documentation:
citation:

inputs:
- name: input_path
required: true
description: Path to the input file, Type string, File type input, Accepted formats gro, mol, mol2, pdb, pdbqt, sdf, Example file https//github.com/bioexcel/biobb_chemistry/raw/master/biobb_chemistry/test/data/babel/babel.smi
type: File
format:
uri: edam:format_2033, edam:format_3815, edam:format_3816, edam:format_1476, edam:format_1476, edam:format_3814
- name: output_xyz_path
required: true
description: Path to the output file, Type string, File type output, Accepted formats xyz
type: string
defaultValue: system.xyz
format:
uri: edam:format_3877
outputs:
- name: output_xyz_path
required: true
description: Path to the output file
type: File
format:
uri: edam:format_3877
ui:
- key: inputs.input_path
title: "input_path: "
description: "Path to the input file, Type string, File type input, Accepted formats gro, mol, mol2, pdb, pdbqt, sdf, Example file https//github.com/bioexcel/biobb_chemistry/raw/master/biobb_chemistry/test/data/babel/babel.smi"
type: File
- key: inputs.output_xyz_path
title: "output_xyz_path: "
description: "Path to the output file, Type string, File type output, Accepted formats xyz"
type: string
30 changes: 30 additions & 0 deletions utils/convert-xyz-plugin/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[tool.poetry]
name = "polus-mm-utils-convert-xyz"
version = "0.1.0"
description = "This class is a wrapper of the Open Babel tool."
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 = [
"."
]
1 change: 1 addition & 0 deletions utils/convert-xyz-plugin/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for convert_xyz."""
Loading
Loading