Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: for bwa, auto infer block size, extra tests, code cleanup and add docs #1774

Merged
merged 10 commits into from Oct 30, 2023

Conversation

fgvieira
Copy link
Collaborator

@fgvieira fgvieira commented Aug 30, 2023

Description

  • Automated infer of block size
  • extra tests
  • improve docs
  • code clean up

QC

  • 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 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,
  • 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 Snakefiles 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; 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,
  • Snakefiles pass the linting (snakemake --lint),
  • Snakefiles are formatted with snakefmt,
  • Python wrapper scripts are formatted with black.
  • 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).

@fgvieira
Copy link
Collaborator Author

fgvieira commented Sep 5, 2023

Tried doing:

block_size = snakemake.input.size_mb / 10

but kept getting an error:

Traceback (most recent call last):
[...]
    block_size = snakemake.input.size_mb / 10
                 ^^^^^^^^^^^^^^^^^^^^^^^
[...]
    return self.size / 1024 / 1024
           ^^^^^^^^^
[...]
    return sum(f.size for f in self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
    return sum(f.size for f in self)
               ^^^^^^
AttributeError: 'str' object has no attribute 'size'

It seems to be a snakemake error.

@fgvieira fgvieira changed the title feat: Cleanup wrapper and add docs feat: auto infer block size, extra tests, code cleanup and add docs Sep 5, 2023
@johanneskoester johanneskoester changed the title feat: auto infer block size, extra tests, code cleanup and add docs feat: for bwa, auto infer block size, extra tests, code cleanup and add docs Oct 30, 2023
@johanneskoester johanneskoester merged commit 66940e3 into snakemake:master Oct 30, 2023
7 checks passed
johanneskoester pushed a commit that referenced this pull request Oct 30, 2023
🤖 I have created a release \*beep\* \*boop\*
---
##
[2.9.0](https://www.github.com/snakemake/snakemake-wrappers/compare/v2.8.0...v2.9.0)
(2023-10-30)


### Features

* CNV Facets
([#1773](https://www.github.com/snakemake/snakemake-wrappers/issues/1773))
([74f5e4a](https://www.github.com/snakemake/snakemake-wrappers/commit/74f5e4a72ebb3abed014380314e63ca3db9f36f4))
* encode fastq downloader
([#1798](https://www.github.com/snakemake/snakemake-wrappers/issues/1798))
([1cc3e00](https://www.github.com/snakemake/snakemake-wrappers/commit/1cc3e00c6bbb3761d1ffd07b26acd18a1caa746d))
* for bwa, auto infer block size, extra tests, code cleanup and add docs
([#1774](https://www.github.com/snakemake/snakemake-wrappers/issues/1774))
([66940e3](https://www.github.com/snakemake/snakemake-wrappers/commit/66940e3c69e1a06a6e9b771d10e29b9eb03d9f24))
* Gseapy
([#1822](https://www.github.com/snakemake/snakemake-wrappers/issues/1822))
([2a50eb0](https://www.github.com/snakemake/snakemake-wrappers/commit/2a50eb0b3567843f0082496f84999d1a9a08e2ab))
* unaligned bam input support for minimap2 alignment
([#1863](https://www.github.com/snakemake/snakemake-wrappers/issues/1863))
([76280a5](https://www.github.com/snakemake/snakemake-wrappers/commit/76280a592677e81dc092c66351bc6eb7801da172))


### Bug Fixes

* for nonpareil, use pigz and pbzip2 and auto infer of -X
([#1776](https://www.github.com/snakemake/snakemake-wrappers/issues/1776))
([45860bf](https://www.github.com/snakemake/snakemake-wrappers/commit/45860bfc1a1509311182f7057f4b7a6210be0423))
* moving to utils
([#1770](https://www.github.com/snakemake/snakemake-wrappers/issues/1770))
([b5c0c01](https://www.github.com/snakemake/snakemake-wrappers/commit/b5c0c016b6a3c9c46672d5e5ee13bda934cbb970))


### Performance Improvements

* autopin bio/bwa/mem
([#1907](https://www.github.com/snakemake/snakemake-wrappers/issues/1907))
([99e9f60](https://www.github.com/snakemake/snakemake-wrappers/commit/99e9f604eba4e77c4b3f69cad0e25114c72ff1fd))
* autopin bio/multiqc
([#1906](https://www.github.com/snakemake/snakemake-wrappers/issues/1906))
([6c67666](https://www.github.com/snakemake/snakemake-wrappers/commit/6c676668b49210d8e99bec6948003421528ac5c4))
---


This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@fgvieira fgvieira deleted the bwa_aln branch October 31, 2023 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants