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

refactor pdb-plugin #159

Merged
merged 1 commit into from
Aug 5, 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
25 changes: 0 additions & 25 deletions utils/pdb-plugin/tests/test_pdb.py

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ specVersion: 0.1.0
entrypoint: pdb
name: 'labshare/download-pdb-file'
version: 0.1.0
container: polusai/pdb-plugin:0.1.0
container: polusai/pdb-tool:0.1.0
title: Download PDB file
description: Download PDB file
author: [Nazanin Donyapour]
author: Brandon Walker, Nazanin Donyapour
repository: https://github.com/labshare/mmtools
documentation: https://ncats.nih.gov/preclinical/core/informatics
contact: "Nazanin.Donyapour@axleinfo.com"
contact: brandon.walker@axleinfo.com, [email protected]
inputs:
- name: filter
required: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
cwltool = "*"
cwl-utils = "*"
sophios = "0.1.1"

[tool.poetry.group.dev.dependencies]
bump2version = "^1.0.1"
Expand Down
39 changes: 39 additions & 0 deletions utils/pre-process/data-download/pdb-tool/tests/test_pdb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Tests for pdb."""
import json
from pathlib import Path

from sophios.api.pythonapi import Step
from sophios.api.pythonapi import Workflow


def test_pdb() -> None:
"""Test pdb CWL."""
# Define file paths
cwl_file_str = "pdb_0@[email protected]"
cwl_file = Path(__file__).resolve().parent / Path(cwl_file_str)
input_yaml_path = Path("pdb.yml")

# Define configuration
config = {"pdb_code": "1e3g", "filter": False}
config_json = json.dumps(config)

# Create CWLWorkflow and configure it
pdb_step = Step(clt_path=cwl_file)
pdb_step.config = config_json
pdb_step.input_yaml_path = input_yaml_path

# Create Workflow
steps = [pdb_step]
workflow_name = "pdb_workflow"
workflow = Workflow(steps, workflow_name)

# Run Workflow
workflow.run()

# Check if output file exists
outdir = Path(".")
files = list(outdir.rglob("system.pdb"))

assert (
files
), f"The file 'system.pdb' does not exist in any subdirectory of '{outdir}'."
Loading