-
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
682ea9a
commit b190fca
Showing
8 changed files
with
107 additions
and
94 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
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,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
version=$(<VERSION) | ||
docker build . -t polusai/extract-pdbids-drugbank-xsdata-plugin:${version} | ||
docker build . -t polusai/extract-pdbids-drugbank-xsdata-tool:${version} |
14 changes: 0 additions & 14 deletions
14
utils/extract-pdbids-drugbank-xsdata-plugin/environment.yml
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,15 +1,30 @@ | ||
[tool.poetry] | ||
name = "polus-mm-utils-extract-pdbids-drugbank-xsdata" | ||
version = "0.1.0" | ||
description = "Filter Drugbank database using xsData" | ||
description = "Filter DrugBank database using xsData" | ||
authors = ["Nazanin Donyapour <[email protected]>", "Brandon Walker <[email protected]>"] | ||
readme = "README.md" | ||
packages = [{include = "polus", from = "src"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.9,<3.12" | ||
python = ">=3.9,<3.13" | ||
typer = "^0.7.0" | ||
cwltool = "3.1.20240404144621" | ||
sophios = "0.1.4" | ||
pandas = "2.2.2" | ||
rdkit = "2024.3.5" | ||
|
||
# Specifying xsdata-pydantic with extra options | ||
xsdata-pydantic = { version = "*", extras = ["cli", "lxml", "soap"] } | ||
|
||
|
||
# Specifying additional index and package | ||
drugbank-schemas = { version = "0.1.4", source = "test-pypi"} | ||
|
||
# Ensure the correct priority for the additional index | ||
[[tool.poetry.source]] | ||
name = "test-pypi" | ||
url = "https://test.pypi.org/simple/" | ||
priority = "explicit" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
bump2version = "^1.0.1" | ||
|
@@ -19,18 +34,10 @@ pre-commit = "^3.2.1" | |
black = "^23.3.0" | ||
mypy = "^1.1.1" | ||
ruff = "^0.3.0" | ||
drugbank_schemas = { version = "0.1.4", source = "testpypi" } | ||
|
||
[[tool.poetry.source]] | ||
name = "testpypi" | ||
url = "https://test.pypi.org/simple/" | ||
secondary = true | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.pytest.ini_options] | ||
pythonpath = [ | ||
"." | ||
] | ||
pythonpath = ["."] |
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
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
from polus.mm.utils.extract_pdbids_drugbank_xsdata.extract_pdbids_drugbank_xsdata import ( # noqa: E501 | ||
extract_pdbids_drugbank_xsdata, | ||
) | ||
from sophios.api.pythonapi import Step | ||
from sophios.api.pythonapi import Workflow | ||
|
||
|
||
def test_extract_pdbids_drugbank_xsdata() -> None: | ||
|
@@ -15,6 +17,37 @@ def test_extract_pdbids_drugbank_xsdata() -> None: | |
|
||
input_xml_path = str(Path(__file__).resolve().parent / Path(input_xml_path)) | ||
|
||
extract_pdbids_drugbank_xsdata(input_xml_path, [], inchi, [], "out.txt") | ||
extract_pdbids_drugbank_xsdata(input_xml_path, [], inchi, [], "output.txt") | ||
|
||
assert Path("out.txt").exists() | ||
assert Path("output.txt").exists() | ||
|
||
|
||
def test_extract_pdbids_drugbank_xsdata_cwl() -> None: | ||
"""Test extract_pdbids_drugbank_xsdata CWL.""" | ||
cwl_file = Path("extract_pdbids_drugbank_xsdata_0@[email protected]") | ||
|
||
# Create the step for the CWL file | ||
extract_pdbids_drugbank_xsdata_step = Step(clt_path=cwl_file) | ||
|
||
input_xml_path = "drugbank_10_fake_records_5.1.10.xml" | ||
input_xml_path = str(Path(__file__).resolve().parent / Path(input_xml_path)) | ||
|
||
inchi = ["InChI3491", "InChI8564", "InChI7556"] | ||
|
||
extract_pdbids_drugbank_xsdata_step.drugbank_xml_file_path = input_xml_path | ||
extract_pdbids_drugbank_xsdata_step.inchi = inchi | ||
extract_pdbids_drugbank_xsdata_step.output_txt_path = "output_cwl.txt" | ||
|
||
# Define the workflow with the step | ||
steps = [extract_pdbids_drugbank_xsdata_step] | ||
filename = "extract_pdbids_drugbank_xsdata" | ||
workflow = Workflow(steps, filename) | ||
|
||
# Run the workflow | ||
workflow.run() | ||
|
||
# Check for the existence of the output file | ||
outdir = Path("outdir") | ||
assert any( | ||
file.name == "output_cwl.txt" for file in outdir.rglob("*") | ||
), "The file output_cwl.txt was not found." |