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 extract-model #152

Merged
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: 0 additions & 29 deletions utils/extract-model-plugin/tests/test_extract_model.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
specVersion: "0.1.0"
name: extract_model
version: 0.1.0
container: extract-model-plugin
container: extract-model-tool
entrypoint:
title: extract_model
description: This class is a wrapper of the Structure Checking tool to extract a model from a 3D structure.
author: Data Scientist
contact: [email protected]
author: Brandon Walker, Nazanin Donyapour
contact: [email protected], [email protected]
repository:
documentation:
citation:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""Tests for extract_model."""
from pathlib import Path

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


def test_extract_model() -> None:
"""Test extract_model."""
# Define paths and input properties
cwl_file_str = "extract_model_0@[email protected]"
cwl_file = Path(__file__).resolve().parent.parent / Path(cwl_file_str)
input_structure_path = Path(__file__).resolve().parent / Path("extract_model.pdb")
config = '{"models": [1, 2, 3]}'

# Create the CWL step
extract_model_step = Step(clt_path=cwl_file)
extract_model_step.input_structure_path = input_structure_path
extract_model_step.output_structure_path = "system.pdb"
extract_model_step.config = config

# Create the workflow and run it
steps = [extract_model_step]
filename = "extract_model_workflow"
workflow = Workflow(steps, filename)
workflow.run()

# Check for the expected output file
outdir = Path("outdir")
files = list(outdir.rglob("system.pdb"))

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