XspecT 0.2.2__tar.gz → 0.2.3__tar.gz
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.
- {xspect-0.2.2/src/XspecT.egg-info → xspect-0.2.3}/PKG-INFO +1 -1
- {xspect-0.2.2 → xspect-0.2.3}/pyproject.toml +1 -1
- {xspect-0.2.2 → xspect-0.2.3/src/XspecT.egg-info}/PKG-INFO +1 -1
- {xspect-0.2.2 → xspect-0.2.3}/src/XspecT.egg-info/SOURCES.txt +1 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/main.py +6 -2
- xspect-0.2.3/tests/test_cli.py +61 -0
- {xspect-0.2.2 → xspect-0.2.3}/.github/workflows/black.yml +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/.github/workflows/docs.yml +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/.github/workflows/pylint.yml +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/.github/workflows/pypi.yml +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/.github/workflows/test.yml +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/.gitignore +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/LICENSE +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/README.md +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/About.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/AddFilter.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/AddSpecies1.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/AddSpecies2.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/BF.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/ClAssT_Ergebnis1.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/ClAssT_Ergebnis2.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/ClAssT_Ergebnis3.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/ClAssT_Hauptseite.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/CommandLine_Input.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/CommandLine_results.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/CommandLine_whole.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/How2Use.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/HowtouseAspecT.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/XspecT_Ergebnis1.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/XspecT_Ergebnis2.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/XspecT_Ergebnis3.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/XspecT_Ergebnis4.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/XspecT_Hauptseite.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/XspecT_Runtime.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/XspecT_Runtime_Oxa.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/XspecT_Startseite.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/change_pw.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/modify_vecs.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Instructions/pictures/secretkey.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/Makefile +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/cli.md +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/conf.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/diagrams/probabilistic_filter_models.md +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/img/logo.png +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/index.md +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/input_data.md +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/installation.md +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/make.bat +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/quickstart.md +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/docs/web.md +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/setup.cfg +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/XspecT.egg-info/dependency_links.txt +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/XspecT.egg-info/entry_points.txt +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/XspecT.egg-info/requires.txt +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/XspecT.egg-info/top_level.txt +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/__init__.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/definitions.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/download_filters.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/fastapi.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/file_io.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/model_management.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/models/__init__.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/models/probabilistic_filter_model.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/models/probabilistic_filter_svm_model.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/models/probabilistic_single_filter_model.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/models/result.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/pipeline.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/run.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train_filter/__init__.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train_filter/create_svm.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train_filter/extract_and_concatenate.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train_filter/html_scrap.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train_filter/ncbi_api/__init__.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train_filter/ncbi_api/download_assemblies.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train_filter/ncbi_api/ncbi_assembly_metadata.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train_filter/ncbi_api/ncbi_children_tree.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/src/xspect/train_filter/ncbi_api/ncbi_taxon_metadata.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/__init__.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/conftest.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/test_file_io.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/test_model_management.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/test_model_result.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/test_pipeline.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/test_probabilistic_filter_model.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/test_probabilistic_filter_svm_model.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/test_probabilistic_single_filter_model.py +0 -0
- {xspect-0.2.2 → xspect-0.2.3}/tests/test_train.py +0 -0
|
@@ -75,6 +75,7 @@ src/xspect/train_filter/ncbi_api/ncbi_children_tree.py
|
|
|
75
75
|
src/xspect/train_filter/ncbi_api/ncbi_taxon_metadata.py
|
|
76
76
|
tests/__init__.py
|
|
77
77
|
tests/conftest.py
|
|
78
|
+
tests/test_cli.py
|
|
78
79
|
tests/test_file_io.py
|
|
79
80
|
tests/test_model_management.py
|
|
80
81
|
tests/test_model_result.py
|
|
@@ -59,12 +59,16 @@ def classify(genus, path, meta, step):
|
|
|
59
59
|
|
|
60
60
|
# define pipeline
|
|
61
61
|
pipeline = Pipeline(genus + " classification", "Test Author", "test@example.com")
|
|
62
|
-
species_execution = ModelExecution(
|
|
62
|
+
species_execution = ModelExecution(
|
|
63
|
+
genus.lower() + "-species", sparse_sampling_step=step
|
|
64
|
+
)
|
|
63
65
|
if meta:
|
|
64
66
|
species_filtering_step = PipelineStep(
|
|
65
67
|
StepType.FILTERING, genus, 0.7, species_execution
|
|
66
68
|
)
|
|
67
|
-
genus_execution = ModelExecution(
|
|
69
|
+
genus_execution = ModelExecution(
|
|
70
|
+
genus.lower() + "-genus", sparse_sampling_step=step
|
|
71
|
+
)
|
|
68
72
|
genus_execution.add_pipeline_step(species_filtering_step)
|
|
69
73
|
pipeline.add_pipeline_step(genus_execution)
|
|
70
74
|
else:
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Test XspecT CLI"""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import pytest
|
|
5
|
+
from click.testing import CliRunner
|
|
6
|
+
from src.xspect.main import cli
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@pytest.mark.parametrize(
|
|
10
|
+
["assembly_file_path", "genus", "species"],
|
|
11
|
+
[
|
|
12
|
+
(
|
|
13
|
+
"GCF_000069245.1_ASM6924v1_genomic.fna",
|
|
14
|
+
"Acinetobacter",
|
|
15
|
+
"470",
|
|
16
|
+
),
|
|
17
|
+
(
|
|
18
|
+
"GCF_000018445.1_ASM1844v1_genomic.fna",
|
|
19
|
+
"Acinetobacter",
|
|
20
|
+
"470",
|
|
21
|
+
),
|
|
22
|
+
("GCF_000006945.2_ASM694v2_genomic.fna", "Salmonella", "28901"),
|
|
23
|
+
],
|
|
24
|
+
indirect=["assembly_file_path"],
|
|
25
|
+
)
|
|
26
|
+
def test_species_assignment(assembly_file_path, genus, species):
|
|
27
|
+
"""Test the species assignment"""
|
|
28
|
+
runner = CliRunner()
|
|
29
|
+
result = runner.invoke(cli, ["classify", genus, assembly_file_path])
|
|
30
|
+
|
|
31
|
+
run_path = result.output.strip().split("'")[1]
|
|
32
|
+
with open(run_path, encoding="utf-8") as f:
|
|
33
|
+
result_content = json.load(f)
|
|
34
|
+
assert result_content["results"][0]["prediction"] == species
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@pytest.mark.parametrize(
|
|
38
|
+
["assembly_file_path", "genus", "species"],
|
|
39
|
+
[
|
|
40
|
+
(
|
|
41
|
+
"GCF_000069245.1_ASM6924v1_genomic.fna",
|
|
42
|
+
"Acinetobacter",
|
|
43
|
+
"470",
|
|
44
|
+
),
|
|
45
|
+
],
|
|
46
|
+
indirect=["assembly_file_path"],
|
|
47
|
+
)
|
|
48
|
+
def test_metagenome_mode(assembly_file_path, genus, species):
|
|
49
|
+
"""Test the metagenome mode"""
|
|
50
|
+
runner = CliRunner()
|
|
51
|
+
result = runner.invoke(cli, ["classify", "-m", genus, assembly_file_path])
|
|
52
|
+
|
|
53
|
+
run_path = result.output.strip().split("'")[1]
|
|
54
|
+
with open(run_path, encoding="utf-8") as f:
|
|
55
|
+
result_content = json.load(f)
|
|
56
|
+
assert (
|
|
57
|
+
result_content["results"][0]["subprocessing_steps"][0]["result"][
|
|
58
|
+
"prediction"
|
|
59
|
+
]
|
|
60
|
+
== species
|
|
61
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|