WayScience / CytoSnake

Orchestrating high-dimensional cell morphology data processing pipelines
https://cytosnake.readthedocs.io
Creative Commons Attribution 4.0 International
3 stars 3 forks source link

Unable to import `cytosnake` helper functions causes repetitive code within workflow scripts #18

Open axiomcura opened 2 years ago

axiomcura commented 2 years ago

As mentioned in #17 the workflow scripts currently do not take imports due to snakemake's restrictive design. The issue occurs when declaring an environment within rules in snakemake files.

The snakemake rules are entirely encapsulated within the declared evironment file. Since cytosnake is not an installable package, then it cannot be installed in the environment therefore not having access to cytosnakes helper functions.

A solution to this is making cytosnake making it pip installable. This will allow cytosnake to become a required dependency in the conda environment files, therefore having access to the helper function that cytosnake provides.

axiomcura commented 1 year ago

This is also apparent in when trying to use the from cytosnake.utils.config_util modules. CytoSnake contains it's own helper functions that parses the config files. However, since CytoSnake is not included within the conda environment for each rule, it does not exists. Therefore, I am marking this as a high priority issue because it is essential that all of CytoSnake's helper functions are included in each rule.

Here's the error below:

Activating conda environment: .snakemake/conda/b491f577b7124c295ec8a6bb7a1ff3c1_
WARNING:snakemake.logging:Activating conda environment: .snakemake/conda/b491f577b7124c295ec8a6bb7a1ff3c1_
Traceback (most recent call last):
  File "/home/erikserrano/tests/cytosnake_tests/test_cp_process_singlecells/.snakemake/scripts/tmp1iylq6h9.convert.py", line 15, in <module>
    from cytosnake.guards.ext_guards import has_sqlite_ext
ModuleNotFoundError: No module named 'cytosnake'