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

Check specificity input for numeric values only #65

Open
pascaltimshel opened this issue Jan 11, 2021 · 0 comments
Open

Check specificity input for numeric values only #65

pascaltimshel opened this issue Jan 11, 2021 · 0 comments
Labels
check&catch error checks and catching of errors. If very serious issue, report as bug enhancement New feature or request

Comments

@pascaltimshel
Copy link
Collaborator

pascaltimshel commented Jan 11, 2021

Problem

Print more informative error messages if the specificity input matrix is not all numeric.

Solution

Ensure that the specificity matrix:

  1. can be parsed/read (using pandas)
  2. contains all numeric values (no characters etc)
  3. possibly additional checks...

Appendix

Example (semi cryptic) error message if specificity input contains characters values (and/or missing values?)

[Thu Jan  7 16:15:57 2021]
Error in rule make_annot:
    jobid: 299
    output: /opt/projects/data_processed.LIMITED_BACKUP/CELLECT_out/CELLECT-LDSC/precomputation/DATASETagg_copd_celltype/DATASETagg_copd_celltype.COMBINED_ANNOT.15.anno
t.gz
    log: /opt/projects/data_processed.LIMITED_BACKUP/CELLECT_out/CELLECT-LDSC/logs/log.make_annot_snake.DATASETagg_copd_celltype.15.txt (check log file(s) for error message)
    conda-env: /opt/software/pnt/CELLECT/.snakemake/conda/765b9fea

RuleException:
CalledProcessError in line 259 of /opt/software/pnt/CELLECT/cellect-ldsc.snakefile:
Command 'source /home/pnt/anaconda3/bin/activate '/opt/software/pnt/CELLECT/.snakemake/conda/765b9fea'; set -euo pipefail;  python /opt/software/pnt/CELLECT/.snakemake/scripts/tmpwj1v708y.mak
e_annot_from_geneset_all_chr_snake.py' returned non-zero exit status 1.
  File "/home/pnt/anaconda3/envs/snakemake/lib/python3.9/site-packages/snakemake/executors/__init__.py", line 2231, in run_wrapper
  File "/opt/software/pnt/CELLECT/cellect-ldsc.snakefile", line 259, in __rule_make_annot
  File "/home/pnt/anaconda3/envs/snakemake/lib/python3.9/site-packages/snakemake/executors/__init__.py", line 560, in _callback
  File "/home/pnt/anaconda3/envs/snakemake/lib/python3.9/concurrent/futures/thread.py", line 52, in run
  File "/home/pnt/anaconda3/envs/snakemake/lib/python3.9/site-packages/snakemake/executors/__init__.py", line 546, in cached_or_run
  File "/home/pnt/anaconda3/envs/snakemake/lib/python3.9/site-packages/snakemake/executors/__init__.py", line 2262, in run_wrapper
Traceback (most recent call last):
  File "/opt/software/pnt/CELLECT/.snakemake/scripts/tmps30nn0av.make_annot_from_geneset_all_chr_snake.py", line 299, in <module>
    dict_of_beds = map_ES_values_to_genes(overlap_df, specificity_df)
  File "/opt/software/pnt/CELLECT/.snakemake/scripts/tmps30nn0av.make_annot_from_geneset_all_chr_snake.py", line 87, in map_ES_values_to_genes
    max_ES_vals_dict[cell_type] = pybedtools.bedtool.BedTool.from_dataframe(get_max_ES_vals(chr_overlap_df, cell_type_ES_dict))
  File "/opt/software/pnt/CELLECT/.snakemake/scripts/tmps30nn0av.make_annot_from_geneset_all_chr_snake.py", line 63, in get_max_ES_vals
    max_ES_val = np.max(ES_val_list)
  File "/opt/software/pnt/CELLECT/.snakemake/conda/765b9fea/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 2505, in amax
    initial=initial)
  File "/opt/software/pnt/CELLECT/.snakemake/conda/765b9fea/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
TypeError: cannot perform reduce with flexible type
@pascaltimshel pascaltimshel added enhancement New feature or request check&catch error checks and catching of errors. If very serious issue, report as bug labels Jan 11, 2021
@pascaltimshel pascaltimshel changed the title Check specificity input Check specificity input for numeric values only Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
check&catch error checks and catching of errors. If very serious issue, report as bug enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant