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

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

Open
Tracked by #41
axiomcura opened this issue Aug 22, 2022 · 1 comment
Assignees

Comments

@axiomcura
Copy link
Member

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
Copy link
Member Author

axiomcura commented Mar 30, 2023

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'

axiomcura added a commit to axiomcura/CytoSnake that referenced this issue Mar 30, 2023
@axiomcura axiomcura self-assigned this Apr 8, 2023
axiomcura added a commit that referenced this issue Apr 12, 2023
* fixed minor pathing bugs

* `cp_process_singlecells` init workflow

* created  cytotable env

* added cytotable config

* added convert.py script

* added parquet variable in common.smk

* added converted parquet helper func

* update common.smk

* added configs param

* init cp_process_singlecells workflow

* Fixed typos

* updated cytotable_convert.smk rule module

* added new error

* added new loader function for general configs

* added more guards

* update convert.py

* fixed extension bug

* removed cytosnake imports see #18

* update config

* fixed parameters naming

* fixed bugs with convert and normalize scripts

* added default env manager

* update pathing and fix #35

* update workflow added documentation

* workflow update

* update configs for normalize

* update feature select module

* removed unused import

* added documentation

* fixed typo

* added suggestions

* Update cytosnake/utils/cyto_paths.py

Co-authored-by: Dave Bunten <[email protected]>

* Update workflows/scripts/convert.py

Co-authored-by: Dave Bunten <[email protected]>

* added comments and suggestions changes

* added pre-commit tools

* pre-commit formatting

* added documentation

* added snakemake input documentation

* added documentation

* removed new lines

* updated convert link and params

---------

Co-authored-by: Dave Bunten <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant