snakemake-wrappers icon indicating copy to clipboard operation
snakemake-wrappers copied to clipboard

fix: fixed GATK3 conda channel priorities and code reformat

Open fgvieira opened this issue 3 years ago • 5 comments
trafficstars

Description

Fixed conda channel priorities, plus some code clean-up

QC

  • [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 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.

fgvieira avatar Aug 11 '22 13:08 fgvieira

Closing in favor of #508. Thanks anyway!

johanneskoester avatar Aug 15 '22 11:08 johanneskoester

I'll re-open it (and convert to draft), since I am planning to add some proper testing for GATK3.

fgvieira avatar Aug 15 '22 12:08 fgvieira

Oh sure, sorry!

johanneskoester avatar Aug 16 '22 12:08 johanneskoester

When I test these changes locally, all works without any error or warning but, on GitHub I am getting a warning and an error:

Environment defines Python version < 3.7. Using Python of the main process to execute script. Note that this cannot be avoided, because the script uses data structures from Snakemake which are Python >=3.7 only.
/usr/share/miniconda/envs/snakemake/bin/python3.10 /tmp/tmpx7gcjxc0/test/.snakemake/scripts/tmpqx1der4s.wrapper.py
Activating conda environment: .snakemake/conda/81a69fc1574731cf5b92c4d702182e2c
Traceback (most recent call last):
  File "/tmp/tmpx7gcjxc0/test/.snakemake/scripts/tmpqx1der4s.wrapper.py", line 13, in <module>
    from snakemake_wrapper_utils.java import get_java_opts
ModuleNotFoundError: No module named 'snakemake_wrapper_utils'

It seems it cannot find snakemake_wrapper_utils, but it is in the environment.yaml file. Could it be because of the Python 3.7 warning? Why does environment on GitHub defines Python version < 3.7 while locally it uses 3.10.5?

fgvieira avatar Aug 18 '22 09:08 fgvieira

Finally managed to get it to work! Had to add python >= 3.10 in the environment, otherwise it would install a python lower than 3.7 (no idea why).

fgvieira avatar Sep 21 '22 12:09 fgvieira