Skip to content

Commit

Permalink
feat!: replace individual seqkit wrappers with a single wrapper for a…
Browse files Browse the repository at this point in the history
…ll seqkit commands (#1426)

<!-- Ensure that the PR title follows conventional commit style (<type>:
<description>)-->
<!-- Possible types are here:
https://github.com/commitizen/conventional-commit-types/blob/master/index.json
-->

### Description

<!-- Add a description of your PR here-->

### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] I confirm that:

For all wrappers added by this PR, 

* there is a test case which covers any introduced changes,
* `input:` and `output:` file paths in the resulting rule can be changed
arbitrarily,
* either the wrapper can only use a single core, or the example rule
contains a `threads: x` statement with `x` being a reasonable default,
* rule names in the test case are in
[snake_case](https://en.wikipedia.org/wiki/Snake_case) and somehow tell
what the rule is about or match the tools purpose or name (e.g.,
`map_reads` for a step that maps reads),
* all `environment.yaml` specifications follow [the respective best
practices](https://stackoverflow.com/a/64594513/2352071),
* wherever possible, command line arguments are inferred and set
automatically (e.g. based on file extensions in `input:` or `output:`),
* all fields of the example rules in the `Snakefile`s and their entries
are explained via comments (`input:`/`output:`/`params:` etc.),
* `stderr` and/or `stdout` are logged correctly (`log:`), depending on
the wrapped tool,
* 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 (see
[here](https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir);
this also means that using any Python `tempfile` default behavior
works),
* the `meta.yaml` contains a link to the documentation of the respective
tool or command,
* `Snakefile`s pass the linting (`snakemake --lint`),
* `Snakefile`s are formatted with
[snakefmt](https://github.com/snakemake/snakefmt),
* Python wrapper scripts are formatted with
[black](https://black.readthedocs.io).
* Conda environments use a minimal amount of channels, in recommended
ordering. E.g. for bioconda, use (conda-forge, bioconda, nodefaults, as
conda-forge should have highest priority and defaults channels are
usually not needed because most packages are in conda-forge nowadays).

---------

Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>
  • Loading branch information
fgvieira and johanneskoester committed Jun 13, 2023
1 parent 71d672c commit c7a4d96
Show file tree
Hide file tree
Showing 34 changed files with 246 additions and 373 deletions.
File renamed without changes.
14 changes: 0 additions & 14 deletions bio/seqkit/fx2tab/meta.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions bio/seqkit/fx2tab/test/Snakefile

This file was deleted.

8 changes: 0 additions & 8 deletions bio/seqkit/fx2tab/test/reads/a.fastq

This file was deleted.

18 changes: 0 additions & 18 deletions bio/seqkit/fx2tab/wrapper.py

This file was deleted.

6 changes: 0 additions & 6 deletions bio/seqkit/grep/environment.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions bio/seqkit/grep/meta.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions bio/seqkit/grep/test/Snakefile

This file was deleted.

8 changes: 0 additions & 8 deletions bio/seqkit/grep/test/reads/a.fastq

This file was deleted.

19 changes: 0 additions & 19 deletions bio/seqkit/grep/wrapper.py

This file was deleted.

16 changes: 16 additions & 0 deletions bio/seqkit/meta.yaml
@@ -0,0 +1,16 @@
name: SeqKit generic wrapper
url: https://bioinf.shenwei.me/seqkit/usage/
description: |
Run SeqKit.
authors:
- Filipe G. Vieira
input:
- input file(s)
output:
- output file(s)
params:
- command: SeqKit command to use.
- extra: Optional parameters.
notes: |
* First `input` and `output` file is considered to be the main one.
* Keys for extra `input` and `output` files need to match `seqkit` arguments without the `-file` suffix (if present).
6 changes: 0 additions & 6 deletions bio/seqkit/rmdup/environment.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions bio/seqkit/rmdup/meta.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions bio/seqkit/rmdup/test/Snakefile

This file was deleted.

30 changes: 0 additions & 30 deletions bio/seqkit/rmdup/wrapper.py

This file was deleted.

6 changes: 0 additions & 6 deletions bio/seqkit/stats/environment.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions bio/seqkit/stats/meta.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions bio/seqkit/stats/test/Snakefile

This file was deleted.

8 changes: 0 additions & 8 deletions bio/seqkit/stats/test/reads/a.fastq

This file was deleted.

18 changes: 0 additions & 18 deletions bio/seqkit/stats/wrapper.py

This file was deleted.

6 changes: 0 additions & 6 deletions bio/seqkit/subseq/environment.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions bio/seqkit/subseq/meta.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions bio/seqkit/subseq/test/Snakefile

This file was deleted.

3 changes: 0 additions & 3 deletions bio/seqkit/subseq/test/sequences/t.fa

This file was deleted.

27 changes: 0 additions & 27 deletions bio/seqkit/subseq/wrapper.py

This file was deleted.

0 comments on commit c7a4d96

Please sign in to comment.