XspecT 0.5.4__tar.gz → 0.7.1__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.
Files changed (135) hide show
  1. {xspect-0.5.4 → xspect-0.7.1}/.github/workflows/docs.yml +1 -1
  2. {xspect-0.5.4 → xspect-0.7.1}/.github/workflows/pypi.yml +1 -1
  3. {xspect-0.5.4 → xspect-0.7.1}/.github/workflows/test.yml +2 -3
  4. {xspect-0.5.4 → xspect-0.7.1}/.gitignore +5 -1
  5. {xspect-0.5.4 → xspect-0.7.1}/PKG-INFO +10 -7
  6. {xspect-0.5.4 → xspect-0.7.1}/README.md +5 -5
  7. xspect-0.7.1/docs/benchmark.md +34 -0
  8. {xspect-0.5.4 → xspect-0.7.1}/docs/cli.md +9 -3
  9. {xspect-0.5.4 → xspect-0.7.1}/docs/contributing.md +5 -5
  10. {xspect-0.5.4 → xspect-0.7.1}/mkdocs.yml +1 -1
  11. {xspect-0.5.4 → xspect-0.7.1}/pyproject.toml +6 -3
  12. {xspect-0.5.4 → xspect-0.7.1}/scripts/benchmark/classify/main.nf +2 -1
  13. {xspect-0.5.4 → xspect-0.7.1}/scripts/benchmark/environment.yml +2 -1
  14. {xspect-0.5.4 → xspect-0.7.1}/scripts/benchmark/main.nf +239 -153
  15. {xspect-0.5.4 → xspect-0.7.1}/scripts/benchmark/nextflow.config +0 -1
  16. {xspect-0.5.4 → xspect-0.7.1}/scripts/benchmark-data/download_data.slurm +1 -1
  17. xspect-0.7.1/scripts/nextflow-utils/environment.yml +8 -0
  18. xspect-0.7.1/scripts/nextflow-utils/main.nf +31 -0
  19. {xspect-0.5.4 → xspect-0.7.1}/src/XspecT.egg-info/PKG-INFO +10 -7
  20. {xspect-0.5.4 → xspect-0.7.1}/src/XspecT.egg-info/SOURCES.txt +13 -6
  21. {xspect-0.5.4 → xspect-0.7.1}/src/XspecT.egg-info/requires.txt +3 -0
  22. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/classify.py +26 -11
  23. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/definitions.py +19 -0
  24. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/download_models.py +3 -1
  25. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/file_io.py +24 -0
  26. {xspect-0.5.4/src/xspect → xspect-0.7.1/src/xspect/handlers}/ncbi.py +82 -7
  27. xspect-0.7.1/src/xspect/handlers/pubmlst.py +130 -0
  28. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/main.py +143 -47
  29. xspect-0.7.1/src/xspect/misclassification_detection/mapping.py +168 -0
  30. xspect-0.7.1/src/xspect/misclassification_detection/point_pattern_analysis.py +102 -0
  31. xspect-0.7.1/src/xspect/misclassification_detection/simulate_reads.py +55 -0
  32. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/model_management.py +61 -3
  33. xspect-0.7.1/src/xspect/models/mlst_result.py +62 -0
  34. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/models/probabilistic_filter_mlst_model.py +96 -101
  35. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/models/probabilistic_filter_model.py +128 -10
  36. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/models/probabilistic_filter_svm_model.py +7 -7
  37. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/models/result.py +2 -0
  38. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/train.py +69 -5
  39. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/web.py +1 -3
  40. xspect-0.5.4/src/xspect/xspect-web/dist/assets/index-Dt_UlbgE.js → xspect-0.7.1/src/xspect/xspect-web/dist/assets/index-Bg0QP9Ys.js +1 -1
  41. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/dist/index.html +1 -1
  42. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/header.tsx +1 -1
  43. xspect-0.7.1/tests/__init__.py +0 -0
  44. {xspect-0.5.4 → xspect-0.7.1}/tests/test_cli.py +3 -1
  45. xspect-0.7.1/tests/test_misclassification_detection.py +92 -0
  46. {xspect-0.5.4 → xspect-0.7.1}/tests/test_model_result.py +2 -0
  47. {xspect-0.5.4 → xspect-0.7.1}/tests/test_ncbi.py +54 -4
  48. xspect-0.5.4/tests/test_probabilisitc_filter_mlst_model.py → xspect-0.7.1/tests/test_probabilistic_filter_mlst_model.py +41 -28
  49. xspect-0.7.1/tests/test_pub_mlst_handler.py +41 -0
  50. xspect-0.5.4/docs/benchmark.md +0 -34
  51. xspect-0.5.4/src/xspect/mlst_feature/mlst_helper.py +0 -241
  52. xspect-0.5.4/src/xspect/mlst_feature/pub_mlst_handler.py +0 -184
  53. xspect-0.5.4/tests/test_pub_mlst_handler.py +0 -53
  54. {xspect-0.5.4 → xspect-0.7.1}/.github/workflows/black.yml +0 -0
  55. {xspect-0.5.4 → xspect-0.7.1}/.github/workflows/pylint.yml +0 -0
  56. {xspect-0.5.4 → xspect-0.7.1}/LICENSE +0 -0
  57. {xspect-0.5.4 → xspect-0.7.1}/docs/index.md +0 -0
  58. {xspect-0.5.4 → xspect-0.7.1}/docs/quickstart.md +0 -0
  59. {xspect-0.5.4 → xspect-0.7.1}/docs/understanding.md +0 -0
  60. {xspect-0.5.4 → xspect-0.7.1}/docs/web.md +0 -0
  61. {xspect-0.5.4 → xspect-0.7.1}/setup.cfg +0 -0
  62. {xspect-0.5.4 → xspect-0.7.1}/src/XspecT.egg-info/dependency_links.txt +0 -0
  63. {xspect-0.5.4 → xspect-0.7.1}/src/XspecT.egg-info/entry_points.txt +0 -0
  64. {xspect-0.5.4 → xspect-0.7.1}/src/XspecT.egg-info/top_level.txt +0 -0
  65. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/__init__.py +0 -0
  66. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/filter_sequences.py +0 -0
  67. {xspect-0.5.4/src/xspect/mlst_feature → xspect-0.7.1/src/xspect/handlers}/__init__.py +0 -0
  68. {xspect-0.5.4/src/xspect/models → xspect-0.7.1/src/xspect/misclassification_detection}/__init__.py +0 -0
  69. {xspect-0.5.4/tests → xspect-0.7.1/src/xspect/models}/__init__.py +0 -0
  70. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/models/probabilistic_single_filter_model.py +0 -0
  71. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/.gitignore +0 -0
  72. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/README.md +0 -0
  73. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/components.json +0 -0
  74. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/dist/assets/index-Ceo58xui.css +0 -0
  75. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/dist/vite.svg +0 -0
  76. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/eslint.config.js +0 -0
  77. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/index.html +0 -0
  78. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/package-lock.json +0 -0
  79. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/package.json +0 -0
  80. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/pnpm-lock.yaml +0 -0
  81. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/public/vite.svg +0 -0
  82. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/App.tsx +0 -0
  83. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/api.tsx +0 -0
  84. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/assets/react.svg +0 -0
  85. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/classification-form.tsx +0 -0
  86. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/classify.tsx +0 -0
  87. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/data-table.tsx +0 -0
  88. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/dropdown-checkboxes.tsx +0 -0
  89. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/dropdown-slider.tsx +0 -0
  90. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/filter-form.tsx +0 -0
  91. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/filter.tsx +0 -0
  92. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/filtering-result.tsx +0 -0
  93. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/landing.tsx +0 -0
  94. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/models-details.tsx +0 -0
  95. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/models.tsx +0 -0
  96. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/result-chart.tsx +0 -0
  97. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/result.tsx +0 -0
  98. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/spinner.tsx +0 -0
  99. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/accordion.tsx +0 -0
  100. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/button.tsx +0 -0
  101. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/card.tsx +0 -0
  102. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/chart.tsx +0 -0
  103. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/command.tsx +0 -0
  104. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/dialog.tsx +0 -0
  105. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/dropdown-menu.tsx +0 -0
  106. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/file-upload.tsx +0 -0
  107. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/form.tsx +0 -0
  108. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/input.tsx +0 -0
  109. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/label.tsx +0 -0
  110. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/navigation-menu.tsx +0 -0
  111. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/popover.tsx +0 -0
  112. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/select.tsx +0 -0
  113. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/separator.tsx +0 -0
  114. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/slider.tsx +0 -0
  115. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/switch.tsx +0 -0
  116. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/table.tsx +0 -0
  117. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/components/ui/tabs.tsx +0 -0
  118. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/index.css +0 -0
  119. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/lib/utils.ts +0 -0
  120. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/main.tsx +0 -0
  121. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/types.tsx +0 -0
  122. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/utils.tsx +0 -0
  123. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/src/vite-env.d.ts +0 -0
  124. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/tsconfig.app.json +0 -0
  125. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/tsconfig.json +0 -0
  126. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/tsconfig.node.json +0 -0
  127. {xspect-0.5.4 → xspect-0.7.1}/src/xspect/xspect-web/vite.config.ts +0 -0
  128. {xspect-0.5.4 → xspect-0.7.1}/tests/conftest.py +0 -0
  129. {xspect-0.5.4 → xspect-0.7.1}/tests/test_file_io.py +0 -0
  130. {xspect-0.5.4 → xspect-0.7.1}/tests/test_model_management.py +0 -0
  131. {xspect-0.5.4 → xspect-0.7.1}/tests/test_probabilistic_filter_model.py +0 -0
  132. {xspect-0.5.4 → xspect-0.7.1}/tests/test_probabilistic_filter_svm_model.py +0 -0
  133. {xspect-0.5.4 → xspect-0.7.1}/tests/test_probabilistic_single_filter_model.py +0 -0
  134. {xspect-0.5.4 → xspect-0.7.1}/tests/test_train.py +0 -0
  135. {xspect-0.5.4 → xspect-0.7.1}/tests/test_web.py +0 -0
@@ -16,7 +16,7 @@ jobs:
16
16
  git config user.email 41898282+github-actions[bot]@users.noreply.github.com
17
17
  - uses: actions/setup-python@v5
18
18
  with:
19
- python-version: 3.x
19
+ python-version: 3.13
20
20
  - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
21
21
  - uses: actions/cache@v4
22
22
  with:
@@ -25,7 +25,7 @@ jobs:
25
25
 
26
26
  - uses: actions/setup-python@v5
27
27
  with:
28
- python-version: "3.x"
28
+ python-version: "3.13"
29
29
 
30
30
  - name: Build release distributions
31
31
  run: |
@@ -19,15 +19,14 @@ jobs:
19
19
  - name: Set up Python
20
20
  uses: actions/setup-python@v4
21
21
  with:
22
- python-version: "3.x"
22
+ python-version: "3.13"
23
23
  - name: Install package
24
24
  run: |
25
25
  python -m pip install --upgrade pip
26
26
  pip install '.[test]'
27
- - name: Download models and train MLST
27
+ - name: Download models
28
28
  run: |
29
29
  xspect models download
30
- yes 1 | xspect models train mlst
31
30
  - name: Test with pytest
32
31
  env:
33
32
  NCBI_API_KEY: ${{ secrets.NCBI_API_KEY }}
@@ -187,4 +187,8 @@ data/
187
187
  results/
188
188
 
189
189
  # Slurm
190
- slurm-*
190
+ slurm-*
191
+ delete.slurm
192
+
193
+
194
+ playground.ipynb
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: XspecT
3
- Version: 0.5.4
3
+ Version: 0.7.1
4
4
  Summary: Tool to monitor and characterize pathogens using Bloom filters.
5
5
  License: MIT License
6
6
 
@@ -29,7 +29,7 @@ Project-URL: Repository, https://github.com/BIONF/XspecT2.git
29
29
  Classifier: Intended Audience :: Developers
30
30
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
31
31
  Classifier: License :: OSI Approved :: MIT License
32
- Requires-Python: >=3.10
32
+ Requires-Python: <3.14,>=3.10
33
33
  Description-Content-Type: text/markdown
34
34
  License-File: LICENSE
35
35
  Requires-Dist: biopython
@@ -45,6 +45,9 @@ Requires-Dist: xxhash
45
45
  Requires-Dist: fastapi
46
46
  Requires-Dist: uvicorn
47
47
  Requires-Dist: python-multipart
48
+ Requires-Dist: mappy
49
+ Requires-Dist: pysam
50
+ Requires-Dist: numpy
48
51
  Provides-Extra: docs
49
52
  Requires-Dist: mkdocs-material; extra == "docs"
50
53
  Requires-Dist: mkdocs-include-markdown-plugin; extra == "docs"
@@ -61,19 +64,19 @@ Dynamic: license-file
61
64
  [![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint)
62
65
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
63
66
 
64
- XspecT is a Python-based tool to taxonomically classify sequence-reads (or assembled genomes) on the species and/or MLST level using [kmer indices] and a [Support Vector Machine].
67
+ XspecT is a Python-based tool to taxonomically classify sequence-reads (or assembled genomes) on the species and/or MLST level using [kmer indices] and a [support vector machine].
65
68
 
66
- XspecT utilizes the uniqueness of kmers and compares extracted kmers from the input-data to a kmer index. Probablistic data structures ensure a fast lookup in this process. For a final prediction, the results are classified using a Support Vector Machine.
69
+ XspecT utilizes the uniqueness of kmers and compares extracted kmers from the input-data to a kmer index. Probablistic data structures ensure a fast lookup in this process. For a final prediction, the results are classified using a support vector machine.
67
70
 
68
71
  The tool is available as a web-based application and as a command line interface.
69
72
 
70
73
  [kmer indices]: https://arxiv.org/abs/1905.09624
71
- [Support Vector Machine]: https://en.wikipedia.org/wiki/Support-vector_machine
74
+ [support vector machine]: https://en.wikipedia.org/wiki/Support-vector_machine
72
75
  <!-- end intro -->
73
76
 
74
77
  <!-- start quickstart -->
75
78
  ## Installation
76
- To install XspecT, please download the lastest 64 bit Python version and install the package using pip:
79
+ To install XspecT, please download Python 3.10 - 3.13 and install the package using pip:
77
80
  ```
78
81
  pip install xspect
79
82
  ```
@@ -111,5 +114,5 @@ For further instructions on how to use the command line interface, please refer
111
114
  ```
112
115
  xspect --help
113
116
  ```
114
- [documentation]: https://bionf.github.io/XspecT2/cli/index.html
117
+ [documentation]: https://bionf.github.io/XspecT/cli/index.html
115
118
  <!-- end quickstart -->
@@ -4,19 +4,19 @@
4
4
  [![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint)
5
5
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
6
6
 
7
- XspecT is a Python-based tool to taxonomically classify sequence-reads (or assembled genomes) on the species and/or MLST level using [kmer indices] and a [Support Vector Machine].
7
+ XspecT is a Python-based tool to taxonomically classify sequence-reads (or assembled genomes) on the species and/or MLST level using [kmer indices] and a [support vector machine].
8
8
 
9
- XspecT utilizes the uniqueness of kmers and compares extracted kmers from the input-data to a kmer index. Probablistic data structures ensure a fast lookup in this process. For a final prediction, the results are classified using a Support Vector Machine.
9
+ XspecT utilizes the uniqueness of kmers and compares extracted kmers from the input-data to a kmer index. Probablistic data structures ensure a fast lookup in this process. For a final prediction, the results are classified using a support vector machine.
10
10
 
11
11
  The tool is available as a web-based application and as a command line interface.
12
12
 
13
13
  [kmer indices]: https://arxiv.org/abs/1905.09624
14
- [Support Vector Machine]: https://en.wikipedia.org/wiki/Support-vector_machine
14
+ [support vector machine]: https://en.wikipedia.org/wiki/Support-vector_machine
15
15
  <!-- end intro -->
16
16
 
17
17
  <!-- start quickstart -->
18
18
  ## Installation
19
- To install XspecT, please download the lastest 64 bit Python version and install the package using pip:
19
+ To install XspecT, please download Python 3.10 - 3.13 and install the package using pip:
20
20
  ```
21
21
  pip install xspect
22
22
  ```
@@ -54,5 +54,5 @@ For further instructions on how to use the command line interface, please refer
54
54
  ```
55
55
  xspect --help
56
56
  ```
57
- [documentation]: https://bionf.github.io/XspecT2/cli/index.html
57
+ [documentation]: https://bionf.github.io/XspecT/cli/index.html
58
58
  <!-- end quickstart -->
@@ -0,0 +1,34 @@
1
+ # Benchmark
2
+
3
+ XspecT is a tool designed for fast and accurate species classification of genome assemblies and simulated reads. To evaluate its classification accuracy, we conducted a benchmark using a set of Acinetobacter genomes.
4
+
5
+ The benchmark was performed by first downloading all available Acinetobacter genomes from RefSeq, filtered on a passed ("OK") taxonomy check status and on them not being part of the training dataset. Genomes assigned to strain IDs were remapped to their respective species IDs, after which genomes with species IDs not contained in XspecT's Acinetobacter model were removed. The remaining genomes were then used to classify both assemblies and simulated reads generated from them. Simulated reads were generated by first filtering on genomes that were categorized as "complete" or "chromosome" by NCBI. The reads were then simulated from the longest contig of each genome (assumed to be the chromosome) using ART. 100 000 reads were simulated for each genome based on the HiSeq 2500 profile, with a read length of 125 bp. The reads were then classified using XspecT with predictions based on the maximum-scoring species.
6
+
7
+ ## Benchmark Results
8
+
9
+ The benchmark results show that XspecT achieves very high classification accuracy of nearly 100% for whole genomes and strong but reduced accuracy of 70% for simulated reads. However, the low macro-average F1 score (0.21) for the read dataset highlights a substantial class imbalance.
10
+
11
+ | Dataset | Total Samples | Matches | Mismatches | Match Rate | Mismatch Rate | Accuracy | Macro Avg F1 | Weighted Avg F1 |
12
+ |-----------|--------------:|----------:|-----------:|-----------:|--------------:|---------:|-------------:|----------------:|
13
+ | Assembly | 13,795 | 13,776 | 19 | 99.86% | 0.14% | ≈1.00 | 0.96 | ≈1.00 |
14
+ | Reads | 121,590,139 | 85,679,572| 35,910,567 | 70.47% | 29.53% | 0.70 | 0.21 | 0.79 |
15
+
16
+ ## Running the benchmark yourself
17
+
18
+ To benchmark XspecT performance yourself, you can use the Nextflow workflow provided in the `scripts/benchmark` directory. This workflow allows you to run XspecT on a set of samples and measure species classification accuracy on both genome assemblies, as well as on simulated reads.
19
+
20
+ Before you run the benchmark, you first need to download benchmarking data to the `data` directory, for example from NCBI. To do so, you can use the bash script in `scripts/benchmark-data` to download the data using the [NCBI Datasets CLI](https://www.ncbi.nlm.nih.gov/datasets/docs/v2/command-line-tools/download-and-install/), which needs to be installed first. The script will download all available Acinetobacter genomes, as well as taxonomic data.
21
+
22
+ To run the benchmark, install [Nextflow](https://www.nextflow.io/docs/latest/install.html) and run the following command:
23
+
24
+ ```bash
25
+ nextflow run scripts/benchmark
26
+ ```
27
+
28
+ This will execute the benchmark workflow, which will classify the samples, as well as reads generated from them, using XspecT. The results will be saved in the `results` directory:
29
+
30
+ - `results/classifications.tsv` for the classifications of the assemblies
31
+ - `results/read_classifications.tsv` for the classifications of the simulated reads
32
+ - `results/confusion_matrix.png` for the confusion matrix of genome assembly classifications
33
+ - `results/mismatches_confusion_matrix.png` for a confusion matrix filtered on mismatches of genome assembly classifications
34
+ - `results/stats.txt` for the statistics of the benchmark run
@@ -27,7 +27,7 @@ This will show a list of all available models, separated by their type (species,
27
27
 
28
28
  ### Downloading Models
29
29
 
30
- To download a basic set of pre-trained models (Acinetobacter and Salonella), run:
30
+ To download a basic set of pre-trained models (Acinetobacter, including Oxford MLST scheme, and Salonella), run:
31
31
 
32
32
  ```bash
33
33
  xspect models download
@@ -43,6 +43,8 @@ To train a model with NCBI data, run the following command:
43
43
  xspect models train ncbi
44
44
  ```
45
45
 
46
+ By default, XspecT filters out NCBI accessions that do not meet minimum N50 thresholds, have an inconclusive taxonomy check status, or are deemed atypical by NCBI. Furthermore, species with "Candidatus" and "sp." in their species names are filtered out. To disable filtering behavior, use the respective flag (see `xspect models train ncbi --help`).
47
+
46
48
  If you would like to train models with manually curated data from a directory, you can use:
47
49
 
48
50
  ```bash
@@ -80,6 +82,8 @@ To train models for MLST classifications, run:
80
82
  xspect models train mlst
81
83
  ```
82
84
 
85
+ XspecT will prompt your for the organism name and the MLST scheme you would like to train a model for.
86
+
83
87
  ## Classification
84
88
 
85
89
  To classify samples, the command `xspect classify` can be used. This command will classify the sample based on the models available in your XspecT installation.
@@ -109,7 +113,7 @@ XspecT uses a kmer-based approach to classify samples. This means that the entir
109
113
 
110
114
  **Example**:
111
115
  ```bash
112
- xspect classify species --sparse-sampling-step 10 Acinetobacter path
116
+ xspect classify species --sparse-sampling-step 10
113
117
  ```
114
118
 
115
119
  This will only consider every 10th kmer in the sample.
@@ -118,7 +122,7 @@ This will only consider every 10th kmer in the sample.
118
122
  By default, the classification results show only the taxonomy ID of each species along with its corresponding score for better readability. To display the full names associated with each taxonomy ID, you can use the `--display-names` (or `-n`) option:
119
123
 
120
124
  ```bash
121
- xspect classify species --display-names Acinetobacter path
125
+ xspect classify species --display-names
122
126
  ```
123
127
  The output will then be formatted as: `Taxonomy_ID - Display_Name: Score` for each species.
124
128
 
@@ -130,6 +134,8 @@ Samples can also be classified based on Multi-locus sequence type schemas. To ML
130
134
  xspect classify mlst
131
135
  ```
132
136
 
137
+ XspecT will prompt you for the organism, MLST scheme, and path to your sample directory.
138
+
133
139
  ## Filtering
134
140
  XspecT can also be used to filter samples based on their classification results. This is useful when analyzing metagenomic samples, for example when looking at genomic bycatch.
135
141
 
@@ -5,8 +5,8 @@ Thank you for your interest in contributing to XspecT! This page provides guidel
5
5
 
6
6
  When contributing to XspecT, please follow the following steps to ensure a smooth process:
7
7
 
8
- - **Read the documentation**: Familiarize yourself with the project by reading the [documentation](https://bionf.github.io/XspecT2/), including the [Understanding XspecT](understanding.md) page and the [architecture overview](#architecture-overview).
9
- - **Follow the coding standards**: Adhere to the project's coding standards and best practices. This includes using consistent naming conventions, writing clear and concise code, and documentation. Furthermore, please make sure your changes are algined with the project's [architecture](#architecture-overview).
8
+ - **Read the documentation**: Familiarize yourself with the project by reading the [documentation](https://bionf.github.io/XspecT/), including the [Understanding XspecT](understanding.md) page and the [architecture overview](#architecture-overview).
9
+ - **Follow the coding standards**: Adhere to the project's coding standards and best practices. This includes ensuring that your code is formatted using [Black](https://black.readthedocs.io/en/stable/) and linted with [Pylint](https://pylint.pycqa.org/en/latest/) for Python code, as well as using consistent naming conventions, writing clear and concise code, and documentation. Please use [pure functions](https://goodresearch.dev/decoupled#learn-to-identify-and-use-pure-functions) where possible and make sure your changes are aligned with the project's [architecture](#architecture-overview).
10
10
  - **Write tests**: Ensure that your changes are covered by tests. We use [pytest](https://docs.pytest.org/en/stable/) for testing. If you add new features or fix bugs, please include tests to verify your changes.
11
11
  - **Document your changes**: Update the documentation to reflect any new features or changes you make. This includes updating the README, Google-style docstrings, and the [Mkdocs](https://www.mkdocs.org)-based documentation.
12
12
  - **Use clear commit messages**: When committing your changes, use clear and descriptive commit messages that explain the purpose of the changes.
@@ -17,12 +17,12 @@ To set up XspecT for development, first make sure you have [Python](https://www.
17
17
 
18
18
  Get started by cloning the repository:
19
19
  ```bash
20
- git clone https://github.com/BIONF/XspecT2.git
20
+ git clone https://github.com/BIONF/XspecT.git
21
21
  ```
22
22
 
23
23
  You then need to build the web application using Vite. Navigate to the `xspect-web` directory, install dependencies, and run the build command, which will also watch for changes:
24
24
  ```bash
25
- cd XspecT2/src/xspect/xspect-web
25
+ cd XspecT/src/xspect/xspect-web
26
26
  ```
27
27
  ```bash
28
28
  npm i
@@ -86,7 +86,7 @@ We use GitHub Actions to run checks on commits and pull requests. These checks i
86
86
 
87
87
  Additionally, Github Actions are also used for deployment:
88
88
 
89
- - **Documentation**: The Mkdocs-based documentation is built and deployed to GitHub Pages on changes to the `main` branch. You can view the documentation at [https://bionf.github.io/XspecT2/](https://bionf.github.io/XspecT2/).
89
+ - **Documentation**: The Mkdocs-based documentation is built and deployed to GitHub Pages on changes to the `main` branch. You can view the documentation at [https://bionf.github.io/XspecT/](https://bionf.github.io/XspecT/).
90
90
  - **Python package**: The Python package is built and uploaded to PyPI when a new release is created. This allows users to easily install the latest version of XspecT using `pip install xspect`. Pre-releases are uploaded to TestPyPI and can be installed using `pip install --index-url https://test.pypi.org/simple/ xspect`.
91
91
 
92
92
  ## Pull Request Process
@@ -7,7 +7,7 @@ theme:
7
7
  plugins:
8
8
  - include-markdown
9
9
  - search
10
- repo_url: https://github.com/BIONF/XspecT2
10
+ repo_url: https://github.com/BIONF/XspecT
11
11
  markdown_extensions:
12
12
  - attr_list
13
13
  nav:
@@ -1,10 +1,10 @@
1
1
  [project]
2
2
  name = "XspecT"
3
- version = "0.5.4"
3
+ version = "0.7.1"
4
4
  description = "Tool to monitor and characterize pathogens using Bloom filters."
5
5
  readme = {file = "README.md", content-type = "text/markdown"}
6
6
  license = {file = "LICENSE"}
7
- requires-python = ">=3.10"
7
+ requires-python = ">=3.10,<3.14"
8
8
  dependencies = [
9
9
  "biopython",
10
10
  "requests",
@@ -18,7 +18,10 @@ dependencies = [
18
18
  "xxhash",
19
19
  "fastapi",
20
20
  "uvicorn",
21
- "python-multipart"
21
+ "python-multipart",
22
+ "mappy",
23
+ "pysam",
24
+ "numpy"
22
25
  ]
23
26
  classifiers = [
24
27
  "Intended Audience :: Developers",
@@ -5,13 +5,14 @@ process classifySample {
5
5
 
6
6
  input:
7
7
  path sample
8
+ val model
8
9
 
9
10
  output:
10
11
  path "${sample.baseName}.json"
11
12
 
12
13
  script:
13
14
  """
14
- xspect classify species -g Acinetobacter -i ${sample} -o ${sample.baseName}.json
15
+ xspect classify species -g ${model} -i ${sample} -o ${sample.baseName}.json
15
16
  """
16
17
 
17
18
  stub:
@@ -2,6 +2,7 @@ name: xspect-benchmark
2
2
  channels:
3
3
  - conda-forge
4
4
  dependencies:
5
+ - python=3.12
5
6
  - pip
6
7
  - pip:
7
- - XspecT
8
+ - XspecT==0.5.4