-
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
92d2d65
commit 2c2b43e
Showing
22 changed files
with
573 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/pymol_align_protein_ca/__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,3 @@ | ||
*.gro filter=lfs diff=lfs merge=lfs -text | ||
*.xyz filter=lfs diff=lfs merge=lfs -text | ||
*.trr filter=lfs diff=lfs merge=lfs -text |
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,30 @@ | ||
FROM condaforge/mambaforge | ||
|
||
RUN apt-get update && apt-get install libgl1-mesa-glx -y | ||
|
||
ENV EXEC_DIR="/opt/executables" | ||
ENV POLUS_LOG="INFO" | ||
RUN mkdir -p ${EXEC_DIR} | ||
|
||
# Work directory defined in the base container | ||
# WORKDIR ${EXEC_DIR} | ||
|
||
COPY pyproject.toml ${EXEC_DIR} | ||
COPY VERSION ${EXEC_DIR} | ||
COPY README.md ${EXEC_DIR} | ||
COPY CHANGELOG.md ${EXEC_DIR} | ||
|
||
# Install needed packages here | ||
# errors installing pymol-open-source from poetry so using conda | ||
COPY environment.yml ${EXEC_DIR} | ||
RUN mamba env create -f ${EXEC_DIR}/environment.yml | ||
RUN echo "source activate project_env" > ~/.bashrc | ||
ENV PATH /opt/conda/envs/env/bin:$PATH | ||
|
||
COPY src ${EXEC_DIR}/src | ||
|
||
ADD Dockerfile . | ||
|
||
RUN conda run -n project_env pip install ${EXEC_DIR} --no-cache-dir | ||
|
||
CMD ["--help"] |
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,16 @@ | ||
# pymol_align_protein_ca (0.1.0) | ||
|
||
Align Protein and CA atoms for a trajectory using Pymol | ||
|
||
## Options | ||
|
||
This plugin takes 6 input arguments and 1 output argument: | ||
|
||
| Name | Description | I/O | Type | Default | | ||
|---------------|-------------------------|--------|--------|---------| | ||
| input_1_path | Input receptor file path | Input | File | File | | ||
| input_2_path | Input ligand file path | Input | File | File | | ||
| input_3_path | Input structure file path | Input | File | File | | ||
| input_4_path | Input trajectory file path | Input | File | File | | ||
| output_file_path | Path to the output file | Input | string | string | | ||
| output_file_path | Path to the output 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 |
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 @@ | ||
#!/bin/bash | ||
|
||
version=$(<VERSION) | ||
docker build . -t polusai/pymol-align-protein-ca-tool:${version} |
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,6 @@ | ||
name: project_env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python==3.10 | ||
- pymol-open-source==3.0.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,73 @@ | ||
specVersion: "0.1.0" | ||
name: pymol_align_protein_ca | ||
version: 0.1.0 | ||
container: pymol-align-protein-ca-plugin | ||
entrypoint: | ||
title: pymol_align_protein_ca | ||
description: Align Protein and CA atoms for a trajectory using Pymol | ||
author: Data Scientist | ||
contact: [email protected] | ||
repository: | ||
documentation: | ||
citation: | ||
|
||
inputs: | ||
- name: input_1_path | ||
required: true | ||
description: Input receptor file path | ||
type: File | ||
format: | ||
uri: edam:format_1476, edam:format_3877 | ||
- name: input_2_path | ||
required: true | ||
description: Input ligand file path | ||
type: File | ||
format: | ||
uri: edam:format_1476, edam:format_3877 | ||
- name: input_3_path | ||
required: true | ||
description: Input structure file path | ||
type: File | ||
format: | ||
uri: edam:format_2033 | ||
- name: input_4_path | ||
required: true | ||
description: Input trajectory file path | ||
type: File | ||
format: | ||
uri: edam:format_3910 | ||
- name: output_file_path | ||
required: true | ||
description: Path to the output file | ||
type: string | ||
defaultValue: system.pdb | ||
format: | ||
uri: edam:format_1476 | ||
outputs: | ||
- name: output_file_path | ||
required: true | ||
description: Path to the output file | ||
type: File | ||
format: | ||
uri: edam:format_1476 | ||
ui: | ||
- key: inputs.input_1_path | ||
title: "input_1_path: " | ||
description: "Input receptor file path" | ||
type: File | ||
- key: inputs.input_2_path | ||
title: "input_2_path: " | ||
description: "Input ligand file path" | ||
type: File | ||
- key: inputs.input_3_path | ||
title: "input_3_path: " | ||
description: "Input structure file path" | ||
type: File | ||
- key: inputs.input_4_path | ||
title: "input_4_path: " | ||
description: "Input trajectory file path" | ||
type: File | ||
- key: inputs.output_file_path | ||
title: "output_file_path: " | ||
description: "Path to the output file" | ||
type: string |
83 changes: 83 additions & 0 deletions
83
utils/pymol-align-protein-ca-plugin/pymol_align_protein_ca_0@[email protected]
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,83 @@ | ||
#!/usr/bin/env cwl-runner | ||
cwlVersion: v1.0 | ||
|
||
class: CommandLineTool | ||
|
||
label: Align Protein and CA atoms for a trajectory using Pymol | ||
|
||
doc: |- | ||
Align Protein and CA atoms for a trajectory using Pymol | ||
|
||
baseCommand: ["conda", "run", "-n", "project_env", "pymol"] | ||
arguments: ["-rcQ", "/opt/executables/src/polus/mm/utils/pymol_align_protein_ca/__main__.py ", "--"] | ||
# NOTE: Based on the last example here | ||
# See https://pymolwiki.org/index.php/Command_Line_Options | ||
|
||
hints: | ||
DockerRequirement: | ||
dockerPull: polusai/pymol-align-protein-ca-tool@sha256:3d51e1e6cd560b64b33159e153b68560b00701ac81307bce259dbf8d454395fd | ||
|
||
inputs: | ||
input_1_path: | ||
label: Input receptor file path | ||
doc: |- | ||
Input receptor file path | ||
type: File | ||
format: edam:format_1476, edam:format_3877 # pdb, xyz | ||
inputBinding: | ||
prefix: --input_1_path | ||
|
||
input_2_path: | ||
label: Input ligand file path | ||
doc: |- | ||
Input ligand file path | ||
type: File | ||
format: edam:format_1476, edam:format_3877 # pdb, xyz | ||
inputBinding: | ||
prefix: --input_2_path | ||
|
||
input_3_path: | ||
label: Input structure file path | ||
doc: |- | ||
Input structure file path | ||
type: File | ||
format: edam:format_2033 # Gromacs structure *.gro | ||
inputBinding: | ||
prefix: --input_3_path | ||
|
||
input_4_path: | ||
label: Input trajectory file path | ||
doc: |- | ||
Input trajectory file path | ||
type: File | ||
format: edam:format_3910 # Gromacs trajectory *.trr | ||
inputBinding: | ||
prefix: --input_4_path | ||
|
||
output_file_path: | ||
label: Path to the output file | ||
doc: |- | ||
Path to the output file | ||
type: string | ||
format: | ||
- edam:format_1476 # pdb | ||
inputBinding: | ||
prefix: --output_file_path | ||
default: system.pdb | ||
|
||
|
||
outputs: | ||
output_file_path: | ||
label: Path to the output file | ||
doc: |- | ||
Path to the output file | ||
type: File | ||
format: edam:format_1476 # pdb | ||
outputBinding: | ||
glob: $(inputs.output_file_path) | ||
|
||
$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,31 @@ | ||
[tool.poetry] | ||
name = "polus-mm-utils-pymol-align-protein-ca" | ||
version = "0.1.0" | ||
description = "Align Protein and CA atoms for a trajectory using Pymol" | ||
authors = ["Data Scientist <[email protected]>"] | ||
readme = "README.md" | ||
packages = [{include = "polus", from = "src"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.9,<3.13" | ||
typer = "^0.7.0" | ||
sophios = "0.1.4" | ||
mdanalysis = "2.7.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 = [ | ||
"." | ||
] |
7 changes: 7 additions & 0 deletions
7
utils/pymol-align-protein-ca-plugin/src/polus/mm/utils/pymol_align_protein_ca/__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,7 @@ | ||
"""pymol_align_protein_ca.""" | ||
|
||
__version__ = "0.1.0" | ||
|
||
from polus.mm.utils.pymol_align_protein_ca.pymol_align_protein_ca import ( # noqa # pylint: disable=unused-import | ||
pymol_align_protein_ca, | ||
) |
68 changes: 68 additions & 0 deletions
68
utils/pymol-align-protein-ca-plugin/src/polus/mm/utils/pymol_align_protein_ca/__main__.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,68 @@ | ||
"""Package entrypoint for the pymol_align_protein_ca package.""" | ||
|
||
# Base packages | ||
import logging | ||
from os import environ | ||
|
||
import typer | ||
from polus.mm.utils.pymol_align_protein_ca.pymol_align_protein_ca import ( | ||
pymol_align_protein_ca, | ||
) | ||
|
||
logging.basicConfig( | ||
format="%(asctime)s - %(name)-8s - %(levelname)-8s - %(message)s", | ||
datefmt="%d-%b-%y %H:%M:%S", | ||
) | ||
POLUS_LOG = getattr(logging, environ.get("POLUS_LOG", "INFO")) | ||
logger = logging.getLogger("polus.mm.utils.pymol_align_protein_ca.") | ||
logger.setLevel(POLUS_LOG) | ||
|
||
app = typer.Typer(help="pymol_align_protein_ca.") | ||
|
||
|
||
@app.command() | ||
def main( | ||
input_1_path: str = typer.Option( | ||
..., | ||
"--input_1_path", | ||
help="Input receptor file path", | ||
), | ||
input_2_path: str = typer.Option( | ||
..., | ||
"--input_2_path", | ||
help="Input ligand file path", | ||
), | ||
input_3_path: str = typer.Option( | ||
..., | ||
"--input_3_path", | ||
help="Input structure file path", | ||
), | ||
input_4_path: str = typer.Option( | ||
..., | ||
"--input_4_path", | ||
help="Input trajectory file path", | ||
), | ||
output_file_path: str = typer.Option( | ||
..., | ||
"--output_file_path", | ||
help="Path to the output file", | ||
), | ||
) -> None: | ||
"""pymol_align_protein_ca.""" | ||
logger.info(f"input_1_path: {input_1_path}") | ||
logger.info(f"input_2_path: {input_2_path}") | ||
logger.info(f"input_3_path: {input_3_path}") | ||
logger.info(f"input_4_path: {input_4_path}") | ||
logger.info(f"output_file_path: {output_file_path}") | ||
|
||
pymol_align_protein_ca( | ||
input_1_path=input_1_path, | ||
input_2_path=input_2_path, | ||
input_3_path=input_3_path, | ||
input_4_path=input_4_path, | ||
output_file_path=output_file_path, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
app() |
Oops, something went wrong.