csuite 0.1.0__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.
csuite-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lucas De Vrieze
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
csuite-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,76 @@
1
+ Metadata-Version: 2.4
2
+ Name: csuite
3
+ Version: 0.1.0
4
+ Summary: Streamlined workflows for sequence and protein structure similarity-based gene cluster mining
5
+ Author-email: Lucas De Vrieze <lucas.devrieze@kuleuven.be>
6
+ Maintainer-email: Lucas De Vrieze <lucas.devrieze@kuleuven.be>
7
+ License: MIT
8
+ Classifier: Programming Language :: Python :: 3.12
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
13
+ Requires-Python: >=3.12.0
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: cblaster>=1.4.0
17
+ Requires-Dist: cagecleaner>=1.5.2
18
+ Requires-Dist: cfoldseeker>=0.2.0
19
+ Provides-Extra: doc
20
+ Requires-Dist: sphinx; extra == "doc"
21
+ Requires-Dist: sphinx_rtd_theme; extra == "doc"
22
+ Dynamic: license-file
23
+
24
+ # csuite
25
+
26
+ [![Docs](https://img.shields.io/readthedocs/csuite-miner/latest?style=flat-square&maxAge=600&logo=readthedocs)](https://csuite-miner.readthedocs.io/en/latest/)
27
+ [![Downloads](https://anaconda.org/bioconda/csuite/badges/downloads.svg)](https://bioconda.github.io/recipes/csuite/README.html#download-stats)
28
+ [![Bioconda](https://img.shields.io/conda/vn/bioconda/csuite?style=flat-square&maxAge=3600&logo=anaconda)](https://anaconda.org/bioconda/csuite)
29
+ [![Docker Image Version](https://img.shields.io/docker/v/lucodevro/csuite?sort=semver&label=docker&logo=docker)](https://hub.docker.com/r/lucodevro/csuite)
30
+ [![PyPI version](https://img.shields.io/pypi/v/csuite?sort=semver&logo=pypi)](https://pypi.org/project/csuite/)
31
+
32
+ ## Description
33
+ The `csuite` is an **orchestrator tool** that integrates several query-based gene cluster mining tools into streamlined end-to-end workflows, removing the sizeable file plumbing and settings transferring overhead. It supports both **searches using sequence or protein structure similarity**, **dereplicates hit sets** respecting both gene cluster and host diversity, and makes attractive alignments and **visualisations**.
34
+
35
+ > [!TIP]
36
+ > The `csuite` bundles several stand-alone gene cluster mining and processing tools. Its workflow commands have a similar design philosophy as MMseqs2's and FoldSeek's easy-* commands. They are end-to-end workflows with a reduced number of options, while the stand-alone tools provide more fine-grained control of the settings. By installing `csuite`, you install all these tools at once!
37
+
38
+ ![workflows](csuite_workflows_animated.gif)
39
+
40
+ ## Features
41
+
42
+ - Query-based gene cluster mining using sequence similarity (driven by [`cblaster`](https://github.com/gamcil/cblaster)).
43
+ - Query-based gene cluster mining using protein structure similarity (driven by [`cfoldseeker`](https://github.com/LucoDevro/cfoldseeker)).
44
+ - Dereplicating hit sets with respect for both gene cluster and host taxonomic diversity (driven by [`CAGEcleaner`](https://github.com/LucoDevro/CAGEcleaner)).
45
+ - Attractive interactive gene cluster alignment visualisations (driven by [`clinker`](https://github.com/gamcil/clinker)).
46
+ - Multiple workflows to facilitate each combination of search mode and data source.
47
+ - Support for both local and remote search modes (such as NCBI nr, or AlphaFoldDB, resp.).
48
+ - Automatic genomic context database construction from sets of protein sequences or structures (driven by `cblaster makedb`, or `cfoldseeker-cds`).
49
+ - Support for extracting gene cluster Genbank files (driven by `cblaster extract_clusters`, or `cfoldseeker-seqs`).
50
+
51
+ ## Installation, documentation and more
52
+ For installation instructions, usage, explanations and more, head over to the [`csuite` docs](https://csuite-miner.readthedocs.io/en/latest/)!
53
+
54
+ ## Citations
55
+ If you found `csuite` useful, please cite our manuscript:
56
+
57
+ ```
58
+ De Vrieze, L., Masschelein, J. (2026) In preparation
59
+ ```
60
+
61
+ The `csuite` member tools rely heavily on the following tools, so please give these proper credit as well:
62
+
63
+ ```
64
+ Gilchrist, C.L.M., Booth, T.J., van Wersch, B., van Grieken, L., Medema, M.H., & Chooi, Y-H. (2021). cblaster: a remote search tool for rapid identification and visualisation of homologous gene clusters. Bioinformatics Advances, https://doi.org/10.1093/bioadv/vbab016
65
+ van Kempen, M., Kim, S.S., Tumescheit, C., Mirdita, M., Lee, J., Gilchrist, C.L.M., Söding, J., Steinegger, M. (2024). Fast and accurate protein structure search with Foldseek. Nature Biotechnology, 42, https://doi.org/10.1038/s41587-023-01773-0
66
+ Steinegger, M., & Söding, J. (2017). MMseqs2 enables sensitive protein sequence searching for the analysis of massive data sets. Nature Biotechnology, 35, https://doi.org/10.1038/nbt.3988
67
+ Huckvale, E., Moseley, H.N.B. (2023). kegg_pull: a software package for the RESTful access and pulling from the Kyoto Encyclopedia of Gene and Genomes. BMC Bioinformatics, 24(78), https://doi.org/10.1186/s12859-023-05208-0
68
+ Salamzade, R., & Kalan, L. R. (2025). skDER and CiDDER: two scalable approaches for microbial genome dereplication. Microbial Genomics, 11(7), https://doi.org/10.1099/mgen.0.001438
69
+ Shaw, J., & Yu, Y. W. (2023). Fast and robust metagenomic sequence comparison through sparse chaining with skani. Nature Methods, 20(11), 1661–1665. https://doi.org/10.1038/s41592-023-02018-3
70
+ ```
71
+
72
+ ## License
73
+
74
+ `csuite` is freely available under an MIT license.
75
+
76
+ Use of the third-party software, libraries or code referred to in the References section above may be governed by separate terms and conditions or license provisions. Your use of the third-party software, libraries or code is subject to any such terms and you should check that you can comply with any applicable restrictions or terms and conditions before use.
csuite-0.1.0/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # csuite
2
+
3
+ [![Docs](https://img.shields.io/readthedocs/csuite-miner/latest?style=flat-square&maxAge=600&logo=readthedocs)](https://csuite-miner.readthedocs.io/en/latest/)
4
+ [![Downloads](https://anaconda.org/bioconda/csuite/badges/downloads.svg)](https://bioconda.github.io/recipes/csuite/README.html#download-stats)
5
+ [![Bioconda](https://img.shields.io/conda/vn/bioconda/csuite?style=flat-square&maxAge=3600&logo=anaconda)](https://anaconda.org/bioconda/csuite)
6
+ [![Docker Image Version](https://img.shields.io/docker/v/lucodevro/csuite?sort=semver&label=docker&logo=docker)](https://hub.docker.com/r/lucodevro/csuite)
7
+ [![PyPI version](https://img.shields.io/pypi/v/csuite?sort=semver&logo=pypi)](https://pypi.org/project/csuite/)
8
+
9
+ ## Description
10
+ The `csuite` is an **orchestrator tool** that integrates several query-based gene cluster mining tools into streamlined end-to-end workflows, removing the sizeable file plumbing and settings transferring overhead. It supports both **searches using sequence or protein structure similarity**, **dereplicates hit sets** respecting both gene cluster and host diversity, and makes attractive alignments and **visualisations**.
11
+
12
+ > [!TIP]
13
+ > The `csuite` bundles several stand-alone gene cluster mining and processing tools. Its workflow commands have a similar design philosophy as MMseqs2's and FoldSeek's easy-* commands. They are end-to-end workflows with a reduced number of options, while the stand-alone tools provide more fine-grained control of the settings. By installing `csuite`, you install all these tools at once!
14
+
15
+ ![workflows](csuite_workflows_animated.gif)
16
+
17
+ ## Features
18
+
19
+ - Query-based gene cluster mining using sequence similarity (driven by [`cblaster`](https://github.com/gamcil/cblaster)).
20
+ - Query-based gene cluster mining using protein structure similarity (driven by [`cfoldseeker`](https://github.com/LucoDevro/cfoldseeker)).
21
+ - Dereplicating hit sets with respect for both gene cluster and host taxonomic diversity (driven by [`CAGEcleaner`](https://github.com/LucoDevro/CAGEcleaner)).
22
+ - Attractive interactive gene cluster alignment visualisations (driven by [`clinker`](https://github.com/gamcil/clinker)).
23
+ - Multiple workflows to facilitate each combination of search mode and data source.
24
+ - Support for both local and remote search modes (such as NCBI nr, or AlphaFoldDB, resp.).
25
+ - Automatic genomic context database construction from sets of protein sequences or structures (driven by `cblaster makedb`, or `cfoldseeker-cds`).
26
+ - Support for extracting gene cluster Genbank files (driven by `cblaster extract_clusters`, or `cfoldseeker-seqs`).
27
+
28
+ ## Installation, documentation and more
29
+ For installation instructions, usage, explanations and more, head over to the [`csuite` docs](https://csuite-miner.readthedocs.io/en/latest/)!
30
+
31
+ ## Citations
32
+ If you found `csuite` useful, please cite our manuscript:
33
+
34
+ ```
35
+ De Vrieze, L., Masschelein, J. (2026) In preparation
36
+ ```
37
+
38
+ The `csuite` member tools rely heavily on the following tools, so please give these proper credit as well:
39
+
40
+ ```
41
+ Gilchrist, C.L.M., Booth, T.J., van Wersch, B., van Grieken, L., Medema, M.H., & Chooi, Y-H. (2021). cblaster: a remote search tool for rapid identification and visualisation of homologous gene clusters. Bioinformatics Advances, https://doi.org/10.1093/bioadv/vbab016
42
+ van Kempen, M., Kim, S.S., Tumescheit, C., Mirdita, M., Lee, J., Gilchrist, C.L.M., Söding, J., Steinegger, M. (2024). Fast and accurate protein structure search with Foldseek. Nature Biotechnology, 42, https://doi.org/10.1038/s41587-023-01773-0
43
+ Steinegger, M., & Söding, J. (2017). MMseqs2 enables sensitive protein sequence searching for the analysis of massive data sets. Nature Biotechnology, 35, https://doi.org/10.1038/nbt.3988
44
+ Huckvale, E., Moseley, H.N.B. (2023). kegg_pull: a software package for the RESTful access and pulling from the Kyoto Encyclopedia of Gene and Genomes. BMC Bioinformatics, 24(78), https://doi.org/10.1186/s12859-023-05208-0
45
+ Salamzade, R., & Kalan, L. R. (2025). skDER and CiDDER: two scalable approaches for microbial genome dereplication. Microbial Genomics, 11(7), https://doi.org/10.1099/mgen.0.001438
46
+ Shaw, J., & Yu, Y. W. (2023). Fast and robust metagenomic sequence comparison through sparse chaining with skani. Nature Methods, 20(11), 1661–1665. https://doi.org/10.1038/s41592-023-02018-3
47
+ ```
48
+
49
+ ## License
50
+
51
+ `csuite` is freely available under an MIT license.
52
+
53
+ Use of the third-party software, libraries or code referred to in the References section above may be governed by separate terms and conditions or license provisions. Your use of the third-party software, libraries or code is subject to any such terms and you should check that you can comply with any applicable restrictions or terms and conditions before use.
File without changes
@@ -0,0 +1,147 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ import argparse
5
+ import logging
6
+ from functools import partial
7
+
8
+ from csuite.validators import (validate_report_args,
9
+ validate_cblaster_search_args,
10
+ validate_cblaster_makedb_args,
11
+ validate_remote_extract_args,
12
+ )
13
+ from cfoldseeker.main import parse_and_validate_arguments as cfs_arg_validator
14
+ from cfoldseeker.build_cds_db import parse_and_validate_arguments as cfscds_arg_validator
15
+ from cfoldseeker.extract_sequences import parse_and_validate_arguments as cfsext_arg_validator
16
+ from cagecleaner.validators import parse_and_validate_arguments as ccl_arg_validator
17
+
18
+ from csuite.defaults import (cfoldseekerDefaultConfiguration,
19
+ cfoldseekerCDSDefaultConfiguration,
20
+ CAGEcleanerDefaultConfiguration,
21
+ mainDefaultConfiguration,
22
+ reportDefaultConfiguration,
23
+ cblasterSearchDefaultConfiguration,
24
+ cblasterMakedbDefaultConfiguration,
25
+ extractDefaultConfiguration,
26
+ )
27
+
28
+
29
+ LOG = logging.getLogger(__name__)
30
+
31
+ # List which modules/tools are part of which workflow
32
+ WORKFLOW_TOOLS = {'remote_struc': ['MAIN', 'CFS'],
33
+ 'local_struc': ['MAIN', 'CFSCDS', 'CFS'],
34
+ 'remote_struc_derep': ['MAIN', 'CFS', 'rCCL'],
35
+ 'local_struc_derep': ['MAIN', 'CFSCDS', 'CFS', 'lCCL'],
36
+ 'remote_seq': ['MAIN', 'CBL'],
37
+ 'local_seq': ['MAIN', 'CBLDB', 'CBL'],
38
+ 'remote_seq_derep': ['MAIN', 'CBL', 'rCCL'],
39
+ 'local_seq_derep': ['MAIN', 'CBLDB', 'CBL', 'lCCL'],
40
+ 'derep': ['MAIN', 'CCL'],
41
+ 'report': ['MAIN', 'OUT'],
42
+ 'remote_extract': ['MAIN', 'rEXT'],
43
+ 'local_extract': ['MAIN', 'lEXT']
44
+ }
45
+
46
+ # Define the default argument values for each tool
47
+ TOOL_DEFAULT_CONFS = {'MAIN': mainDefaultConfiguration(),
48
+ 'CFS': cfoldseekerDefaultConfiguration(),
49
+ 'CFSCDS': cfoldseekerCDSDefaultConfiguration(),
50
+ 'lCCL': CAGEcleanerDefaultConfiguration(),
51
+ 'rCCL': CAGEcleanerDefaultConfiguration(),
52
+ 'CCL': CAGEcleanerDefaultConfiguration(),
53
+ 'OUT': reportDefaultConfiguration(),
54
+ 'CBL': cblasterSearchDefaultConfiguration(),
55
+ 'CBLDB': cblasterMakedbDefaultConfiguration(),
56
+ 'rEXT': extractDefaultConfiguration(),
57
+ 'lEXT': extractDefaultConfiguration(),
58
+ }
59
+
60
+ # Define the validator function for each tool
61
+ TOOL_ARG_VALIDATORS = {'MAIN': vars, # No validation for main args, just parsing; validation is done by tools
62
+ 'CFS': partial(cfs_arg_validator, skip_context_table_check = True),
63
+ 'CFSCDS': cfscds_arg_validator,
64
+ 'CCL': ccl_arg_validator,
65
+ 'lCCL': partial(ccl_arg_validator, bypass_source = 'local'),
66
+ 'rCCL': partial(ccl_arg_validator, bypass_source = 'remote'),
67
+ 'OUT': validate_report_args,
68
+ 'CBL': validate_cblaster_search_args,
69
+ 'CBLDB': validate_cblaster_makedb_args,
70
+ 'rEXT': validate_remote_extract_args,
71
+ 'lEXT': cfsext_arg_validator,
72
+ }
73
+
74
+
75
+ def categorise_args(args: argparse.Namespace) -> dict[str:argparse.Namespace]:
76
+ """
77
+ Categorise the argument namespace by workflow.
78
+
79
+ The arguments collected through the CLI are grouped by the tool that requires them, as indicated through the CLI
80
+ argument labels. Missing argument values are imputed from the default tool configurations.
81
+
82
+ The argument labels are prefixed by the codename of the tool that requires them.
83
+ For example, an argument `par1` required by tools `tool1` and `tool2` will be encoded as `tool1_tool2$par1`.
84
+
85
+ Args:
86
+ args (argparse.Namespace): Unparsed CLI argument namespace
87
+
88
+ Returns:
89
+ categorised_args (dict[argparse.Namespace]): dictionary of unparsed argument namespaces per tool
90
+ involved in the workflow, supplemented with default argument values.
91
+
92
+ Note:
93
+ Categorising arguments is facilitated by toolname prefixes in the argument names (see CLI subparsers.)
94
+ """
95
+ # Temporary parsing of the argument values
96
+ all_args = vars(args)
97
+
98
+ # Determine selected tools/modules
99
+ selected_tools = WORKFLOW_TOOLS[all_args['command']]
100
+
101
+ # Categorise arguments by tool
102
+ categorised_args = {}
103
+ for tool in selected_tools:
104
+ # Extract the arguments relevant for this tool using the prefixed argument labels
105
+ tool_args = {k.split('$')[1] : v # Which argument-value pair?
106
+ for k,v in all_args.items()
107
+ if tool in k.split('$')[0].split('_') # Is it required by this tool?
108
+ }
109
+
110
+ # Parse default argument values for this tool
111
+ default_args = TOOL_DEFAULT_CONFS[tool]
112
+ tool_args_with_defaults = vars(default_args)
113
+
114
+ # Add or adjust freshly parsed arguments to the default configuration to end up with a fully populated namespace
115
+ for arg_key, arg_val in tool_args.items():
116
+ tool_args_with_defaults[arg_key] = arg_val
117
+
118
+ # Define the new namespace for this tool
119
+ categorised_args[tool] = argparse.Namespace(**tool_args_with_defaults)
120
+
121
+ return categorised_args
122
+
123
+
124
+ def parse_and_validate_args(categorised_args: dict[str:argparse.Namespace]) -> dict:
125
+ """
126
+ Parse and validate the argument namespace for each tool.
127
+
128
+ Parses the arguments for each tool, and validates them using their associated validator functions.
129
+
130
+ Args:
131
+ categorised_args (dict[argparse.Namespace]): dictionary of unparsed argument namespaces per tool
132
+ involved in the workflow.
133
+
134
+ Returns:
135
+ parsed_categorised_args (dict): dictionary of dictionaries of argument name-value pairs,
136
+ grouped by tool involved in a workflow.
137
+ """
138
+ # Determine which validator functions will be needed for each tool
139
+ selected_validators = {tool: TOOL_ARG_VALIDATORS[tool] for tool in categorised_args.keys()}
140
+
141
+ # Parse and validate each tool's argument namespace using the selected validator
142
+ parsed_categorised_args = {}
143
+ for tool, validator in selected_validators.items():
144
+ parsed_categorised_args[tool] = validator(categorised_args[tool])
145
+
146
+ return parsed_categorised_args
147
+