-
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
Brandon Duane Walker
authored and
Brandon Duane Walker
committed
Jun 11, 2024
1 parent
6d5007e
commit 5bbab55
Showing
14 changed files
with
296 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
utils/molecular-dynamics/amber/bash-top-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/bash_top/__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,5 @@ | ||
# docker build -f Dockerfile -t polusai/bash-top-tool . | ||
FROM bash | ||
|
||
ADD gmx_add_topology_includes.sh . | ||
ADD Dockerfile . |
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 @@ | ||
# bash_top (0.1.0) | ||
|
||
Concatentate import statements in AMBER topology file | ||
|
||
## Options | ||
|
||
This plugin takes 3 input arguments and 1 output argument: | ||
|
||
| Name | Description | I/O | Type | Default | | ||
|---------------|-------------------------|--------|--------|---------| | ||
| script | Bash script name | Input | string | string | | ||
| input_top_path | Gromacs topology file | Input | File | File | | ||
| output_top_path | Output topology file name | Input | string | string | | ||
| output_top_path | Output topology 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 |
50 changes: 50 additions & 0 deletions
50
utils/molecular-dynamics/amber/bash-top-tool/bash_top_0.1.0.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,50 @@ | ||
#!/usr/bin/env cwl-runner | ||
cwlVersion: v1.0 | ||
|
||
class: CommandLineTool | ||
|
||
label: Concatentate import statements in AMBER topology file | ||
|
||
doc: | | ||
Concatentate import statements in AMBER topology file | ||
|
||
baseCommand: bash | ||
|
||
hints: | ||
DockerRequirement: | ||
dockerPull: polusai/bash-top-tool@sha256:881d3634bd000a931b3339e8328ee9701190e6ac7b1227082bd095e317d2e551 | ||
|
||
inputs: | ||
script: | ||
type: string | ||
inputBinding: | ||
position: 1 | ||
|
||
input_top_path: | ||
type: File | ||
format: edam:format_3880 | ||
inputBinding: | ||
position: 2 | ||
|
||
output_top_path: | ||
type: string? | ||
format: edam:format_2330 # 'Textual format' | ||
# inputBinding: | ||
# position: 3 | ||
default: system.top | ||
|
||
outputs: | ||
output_top_path: | ||
type: File | ||
format: edam:format_3880 | ||
streamable: true | ||
outputBinding: | ||
glob: $(inputs.output_top_path) | ||
|
||
stdout: $(inputs.output_top_path) | ||
|
||
$namespaces: | ||
edam: https://edamontology.org/ | ||
|
||
$schemas: | ||
- https://raw.githubusercontent.com/edamontology/edamontology/master/EDAM_dev.owl |
20 changes: 20 additions & 0 deletions
20
utils/molecular-dynamics/amber/bash-top-tool/gmx_add_topology_includes.sh
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,20 @@ | ||
#!/bin/bash -e | ||
# NOTE: These include statements MUST be in this order. In particular, we | ||
# cannot simply use cat $1 because we need to interleave the amber99sb-ildn.ff | ||
# includes around ligand_GMX.itp, and because we need to remove the [ defaults ] | ||
# directive (which is included in forcefield.itp) | ||
echo '#include "amber99sb-ildn.ff/forcefield.itp"' | ||
|
||
echo '#include "ligand_GMX.itp"' | ||
|
||
echo '#include "amber99sb-ildn.ff/spce.itp"' | ||
echo '#include "amber99sb-ildn.ff/ions.itp"' | ||
|
||
echo "[ system ]" | ||
echo " ligand " | ||
echo "" | ||
echo "[ molecules ]" | ||
echo "; Compound nmols" | ||
echo " ligand 1 " | ||
|
||
#cat $1 |
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: bash_top | ||
version: 0.1.0 | ||
container: bash-top-tool | ||
entrypoint: | ||
title: bash_top | ||
description: Concatentate import statements in AMBER topology file | ||
author: Data Scientist | ||
contact: [email protected] | ||
repository: | ||
documentation: | ||
citation: | ||
|
||
inputs: | ||
- name: script | ||
required: true | ||
description: | ||
type: string | ||
- name: input_top_path | ||
required: true | ||
description: | ||
type: File | ||
format: | ||
uri: edam:format_3880 | ||
- name: output_top_path | ||
required: true | ||
description: | ||
type: string | ||
defaultValue: system.top | ||
format: | ||
uri: edam:format_2330 | ||
outputs: | ||
- name: output_top_path | ||
required: true | ||
description: | ||
type: File | ||
format: | ||
uri: edam:format_3880 | ||
ui: | ||
- key: inputs.script | ||
title: "script: " | ||
description: "" | ||
type: string | ||
- key: inputs.input_top_path | ||
title: "input_top_path: " | ||
description: "" | ||
type: File | ||
- key: inputs.output_top_path | ||
title: "output_top_path: " | ||
description: "" | ||
type: string |
28 changes: 28 additions & 0 deletions
28
utils/molecular-dynamics/amber/bash-top-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,28 @@ | ||
[tool.poetry] | ||
name = "polus-mm-utils-bash-top" | ||
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.0" | ||
|
||
[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 = [ | ||
"." | ||
] |
54 changes: 54 additions & 0 deletions
54
utils/molecular-dynamics/amber/bash-top-tool/tests/ALL.Ala115Pro_step8_gio_gio.top
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,54 @@ | ||
; | ||
; File 'ALL.Ala115Pro_step4_p2g_p2g.top' was generated | ||
; By user: unknown (3373) | ||
; On host: s04r1b41 | ||
; At date: Tue Apr 10 08:32:54 2018 | ||
|
||
; | ||
; This is a standalone topology file | ||
; | ||
; Created by: | ||
; :-) GROMACS - gmx pdb2gmx, VERSION 5.1.2 (-: | ||
; | ||
; Executable: /gpfs/home/bsc23/bsc23210/gromacs/bin/gmx | ||
; Data prefix: /gpfs/home/bsc23/bsc23210/gromacs | ||
; Command line: | ||
; gmx pdb2gmx -f /gpfs/scratch/bsc23/bsc23210/tmp.pjwGKiFyti/dd33c756-035a-41ec-9e5c-ad722dd9f4e7/s04r1b41-ib0/sandBox/job_203/mutated.pdb -o /gpfs/scratch/bsc23/bsc23210/tmp.pjwGKiFyti/dd33c756-035a-41ec-9e5c-ad722dd9f4e7/s04r1b41-ib0/sandBox/job_203/p2g.gro -p ALL.Ala115Pro_step4_p2g_p2g.top -water tip3p -ff amber99sb -i ALL.Ala115Pro_step4_p2g_p2g.itp -ignh | ||
; Force field was read from the standard GROMACS share directory. | ||
; | ||
|
||
; Include forcefield parameters | ||
#include "amber99sb.ff/forcefield.itp" | ||
|
||
; Include chain topologies | ||
#include "ALL.Ala115Pro_step4_p2g_p2g_Protein_chain_A.itp" | ||
#include "ALL.Ala115Pro_step4_p2g_p2g_Protein_chain_B.itp" | ||
#include "ALL.Ala115Pro_step4_p2g_p2g_Protein_chain_C.itp" | ||
#include "ALL.Ala115Pro_step4_p2g_p2g_Protein_chain_D.itp" | ||
|
||
; Include water topology | ||
#include "amber99sb.ff/tip3p.itp" | ||
|
||
#ifdef POSRES_WATER | ||
; Position restraint for each water oxygen | ||
[ position_restraints ] | ||
; i funct fcx fcy fcz | ||
1 1 1000 1000 1000 | ||
#endif | ||
|
||
; Include topology for ions | ||
#include "amber99sb.ff/ions.itp" | ||
|
||
[ system ] | ||
; Name | ||
Protein in water | ||
|
||
[ molecules ] | ||
; Compound #mols | ||
Protein_chain_A 1 | ||
Protein_chain_B 1 | ||
Protein_chain_C 1 | ||
Protein_chain_D 1 | ||
SOL 121173 | ||
NA 128 | ||
CL 120 |
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 bash_top.""" |
33 changes: 33 additions & 0 deletions
33
utils/molecular-dynamics/amber/bash-top-tool/tests/test_bash_top.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,33 @@ | ||
"""Tests for bash_top.""" | ||
from pathlib import Path | ||
|
||
from sophios.api.pythonapi import Step | ||
from sophios.api.pythonapi import Workflow | ||
|
||
|
||
def test_bash_top() -> None: | ||
"""Test bash topology CWL.""" | ||
input_top_path = Path(__file__).resolve().parent / Path( | ||
"ALL.Ala115Pro_step8_gio_gio.top", | ||
) | ||
cwl_file_str = "bash_top.cwl" | ||
cwl_file = Path(__file__).resolve().parent.parent / Path(cwl_file_str) | ||
|
||
bash_top = Step(clt_path=cwl_file) | ||
bash_top.script = "/gmx_add_topology_includes.sh" | ||
bash_top.input_top_path = input_top_path | ||
|
||
steps = [bash_top] | ||
filename = "bash_top" | ||
viz = Workflow(steps, filename) | ||
# need a way to call cwl-docker-extract via run_local | ||
# Get the following error | ||
# TypeError: run() got an unexpected keyword argument 'run_local' | ||
viz.run(run_local=True) | ||
|
||
outdir = Path("outdir") | ||
files = list(outdir.rglob("system.top")) | ||
|
||
assert ( | ||
files | ||
), f"The file 'system.top' does not exist in any subdirectory of '{outdir}'." |