pori-python 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pori_python/__init__.py +1 -0
- pori_python/graphkb/__init__.py +2 -0
- pori_python/graphkb/constants.py +220 -0
- pori_python/graphkb/genes.py +540 -0
- pori_python/graphkb/match.py +710 -0
- pori_python/graphkb/py.typed +0 -0
- pori_python/graphkb/statement.py +48 -0
- pori_python/graphkb/util.py +523 -0
- pori_python/graphkb/vocab.py +198 -0
- pori_python/ipr/__init__.py +0 -0
- pori_python/ipr/annotate.py +373 -0
- pori_python/ipr/connection.py +214 -0
- pori_python/ipr/constants.py +9 -0
- pori_python/ipr/inputs.py +593 -0
- pori_python/ipr/ipr.py +390 -0
- pori_python/ipr/main.py +512 -0
- pori_python/ipr/py.typed +0 -0
- pori_python/ipr/summary.py +412 -0
- pori_python/ipr/therapeutic_options.py +83 -0
- pori_python/ipr/util.py +173 -0
- pori_python/types.py +177 -0
- pori_python-0.1.0.dist-info/LICENSE +674 -0
- pori_python-0.1.0.dist-info/METADATA +151 -0
- pori_python-0.1.0.dist-info/RECORD +49 -0
- pori_python-0.1.0.dist-info/WHEEL +5 -0
- pori_python-0.1.0.dist-info/dependency_links.txt +1 -0
- pori_python-0.1.0.dist-info/entry_points.txt +2 -0
- pori_python-0.1.0.dist-info/top_level.txt +2 -0
- tests/__init__.py +0 -0
- tests/test_graphkb/__init__.py +0 -0
- tests/test_graphkb/data.py +78 -0
- tests/test_graphkb/test_genes.py +306 -0
- tests/test_graphkb/test_graphkb.py +32 -0
- tests/test_graphkb/test_match.py +662 -0
- tests/test_graphkb/test_statement.py +100 -0
- tests/test_graphkb/test_util.py +151 -0
- tests/test_graphkb/test_vocab.py +85 -0
- tests/test_ipr/__init__.py +0 -0
- tests/test_ipr/constants.py +3 -0
- tests/test_ipr/test_annotate.py +149 -0
- tests/test_ipr/test_connection.py +97 -0
- tests/test_ipr/test_inputs.py +295 -0
- tests/test_ipr/test_ipr.py +338 -0
- tests/test_ipr/test_main.py +154 -0
- tests/test_ipr/test_probe.py +72 -0
- tests/test_ipr/test_summary.py +157 -0
- tests/test_ipr/test_upload.py +274 -0
- tests/test_ipr/test_util.py +29 -0
- tests/test_ipr/util.py +9 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from pori_python.ipr.util import create_variant_name_tuple, trim_empty_values
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@pytest.mark.parametrize(
|
|
7
|
+
"input,output_keys",
|
|
8
|
+
[[{"key": 0}, ["key"]], [{"key": None}, []], [{"key": ""}, []], [{"gene1": None}, ["gene1"]]],
|
|
9
|
+
)
|
|
10
|
+
def test_trim_empty_values(input, output_keys):
|
|
11
|
+
modified_object = trim_empty_values(input)
|
|
12
|
+
assert sorted(modified_object.keys()) == sorted(output_keys)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@pytest.mark.parametrize(
|
|
16
|
+
"variant,result",
|
|
17
|
+
[
|
|
18
|
+
[
|
|
19
|
+
{"variantType": "exp", "gene": "GENE", "expressionState": "increased expression"},
|
|
20
|
+
"increased expression",
|
|
21
|
+
],
|
|
22
|
+
[{"variantType": "cnv", "gene": "GENE", "cnvState": "amplification"}, "amplification"],
|
|
23
|
+
[{"variantType": "other", "gene2": "GENE", "variant": "GENE:anything"}, "anything"],
|
|
24
|
+
],
|
|
25
|
+
)
|
|
26
|
+
def test_create_variant_name_tuple(variant, result):
|
|
27
|
+
gene, name = create_variant_name_tuple(variant)
|
|
28
|
+
assert name == result
|
|
29
|
+
assert gene == "GENE"
|
tests/test_ipr/util.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
class QueryMock:
|
|
2
|
+
def __init__(self, return_values) -> None:
|
|
3
|
+
self.return_values = return_values
|
|
4
|
+
self.index = -1
|
|
5
|
+
|
|
6
|
+
def __call__(self, *args, **kwargs):
|
|
7
|
+
self.index += 1
|
|
8
|
+
ret_val = self.return_values[self.index] if self.index < len(self.return_values) else []
|
|
9
|
+
return ret_val
|