-
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
23fb84d
commit 8fa99ac
Showing
19 changed files
with
103 additions
and
98 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
utils/pre-process/structure-change/pdbfixer-tool/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,31 @@ | ||
# docker build -f Dockerfile -t polusai/pdbfixer-tool . | ||
|
||
FROM condaforge/mambaforge | ||
|
||
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 pdbfixer 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
File renamed without changes.
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
5 changes: 3 additions & 2 deletions
5
utils/pdbfixer-plugin/ict.yml → ...ss/structure-change/pdbfixer-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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
specVersion: 0.1.0 | ||
name: labshare/pdbfixer | ||
version: 0.1.0 | ||
container: polusai/pdbfixer-plugin:0.1.0 | ||
container: polusai/pdbfixer-tool:0.1.0 | ||
entrypoint: "" | ||
title: pdbfixer | ||
description: Fix pdbfiles. | ||
author: Data Scientist ([email protected]) | ||
author: Brandon Walker, Nazanin Donyapour | ||
contact: [email protected], [email protected] | ||
repository: https://github.com/labshare/mmtools | ||
documentation: https://ncats.nih.gov/preclinical/core/informatics | ||
citation: | ||
|
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
64 changes: 64 additions & 0 deletions
64
utils/pre-process/structure-change/pdbfixer-tool/tests/test_pdbfixer.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,64 @@ | ||
"""Tests for pdbfixer.""" | ||
from pathlib import Path | ||
|
||
from polus.mm.utils.pdbfixer.pdbfixer import runpdbfixer | ||
from sophios.api.pythonapi import Step | ||
from sophios.api.pythonapi import Workflow | ||
|
||
|
||
def test_pdbfixer() -> None: | ||
"""Test pdbfixer.""" | ||
add_atoms = "all" | ||
add_residues = True | ||
pdbid = "" | ||
url = "" | ||
replace_nonstandard = True | ||
keep_heterogens = "all" | ||
input_pdb_path = "1msn_protein.pdb" | ||
input_helper_pdb_path = "1msn_protein.pdb" | ||
input_pdb_path = str(Path(__file__).resolve().parent / Path(input_pdb_path)) | ||
input_helper_pdb_path = str( | ||
Path(__file__).resolve().parent / Path(input_helper_pdb_path), | ||
) | ||
output_pdb_path = "test.pdb" | ||
output_pdb_path = str(Path(__file__).resolve().parent / Path(output_pdb_path)) | ||
|
||
runpdbfixer( | ||
input_pdb_path, | ||
input_helper_pdb_path, | ||
output_pdb_path, | ||
add_atoms, | ||
add_residues, | ||
pdbid, | ||
url, | ||
replace_nonstandard, | ||
keep_heterogens, | ||
) | ||
|
||
assert Path(output_pdb_path).exists() | ||
|
||
|
||
def test_cwl_pdb_fixer() -> None: | ||
"""Test the pdbfixer function in cwltool.""" | ||
cwl_file_str = "pdb_fixer_0@[email protected]" | ||
cwl_file = Path(__file__).resolve().parent / Path(cwl_file_str) | ||
# Create a Step instance for pdb_fixer | ||
pdb_fixer = Step(clt_path=cwl_file) | ||
|
||
# Set input properties | ||
pdb_fixer.input_pdb_path = str(Path(__file__).resolve().parent / "1msn_protein.pdb") | ||
pdb_fixer.input_helper_pdb_path = str( | ||
Path(__file__).resolve().parent / "1msn_protein.pdb", | ||
) | ||
pdb_fixer.output_pdb_path = "output.pdb" | ||
|
||
# Define the workflow | ||
steps = [pdb_fixer] | ||
filename = "pdb_fixer" | ||
workflow = Workflow(steps, filename) | ||
|
||
# Run the workflow | ||
workflow.run() | ||
|
||
# Check if the output file exists | ||
assert Path("output.pdb").exists(), "The file 'output.pdb' does not exist." |