Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correctly handle non str index list for bwa-mem2/mem (#3101)
As reported in #522, currently the `bwa2-mem` wrapper has issues if `idx` is a sequence is it incorrectly checked `input.index` to be as string instead of `input.idx`. This bug was silent, as usually `snakemake.input.index` would always be a available as `functools.partial(<function Namedlist._used_attribute at 0x73ac4dbc0c20>, _name='index')` or similar. Thus the predicate that it was not a `str` was always true. Now with `snakemake=8.16.0` this changed and the bug becomes an error running the already existing tests. While the discussion in #522 indicates, that there is an underlying issue with the concept of `input.idx` being as sequence of indices, this may need rework later. Until all the details are decided, having a correct working version should be still valuable. With the current state any workflow using this wrapper using `snakemake=8.16.0` is broken. ### QC <!-- Make sure that you can tick the boxes below. --> * [x] I confirm that I have followed the [documentation for contributing to `snakemake-wrappers`](https://snakemake-wrappers.readthedocs.io/en/stable/contributing.html). While the contributions guidelines are more extensive, please particularly ensure that: * [x] `test.py` was updated to call any added or updated example rules in a `Snakefile` * [x] `input:` and `output:` file paths in the rules can be chosen arbitrarily * [x] wherever possible, command line arguments are inferred and set automatically (e.g. based on file extensions in `input:` or `output:`) * [x] temporary files are either written to a unique hidden folder in the working directory, or (better) stored where the Python function `tempfile.gettempdir()` points to * [x] the `meta.yaml` contains a link to the documentation of the respective tool or command under `url:` * [x] conda environments use a minimal amount of channels and packages, in recommended ordering <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced documentation clarifying input requirements for index files, ensuring users know all necessary file extensions. - Added a new function to extract the longest common prefix from index file names, improving error handling. - **Bug Fixes** - Updated index file specifications to require a complete list of index files, preventing execution errors due to missing files. - **Documentation** - Improved comments and descriptions in the Snakefile and meta.yaml for better user guidance on index file usage. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Vito Zanotelli <vito.zanotelli@gmail.com>
- Loading branch information