szsctt / intvi_other-tools

0 stars 0 forks source link

Error in rule verse #2

Open TheBready opened 3 years ago

TheBready commented 3 years ago

It seems that there is something wrong with the rule verse. @szsctt Do you know that issue?

verse_references/human/human.nhr, test/out/verse_references/human/human.nin, test/out/verse_references/human/human.nsq
    output: test/out/test/verse/cond0.rep0.human.AAV/integration-sites.txt, test/out/test/verse/cond0.rep0.human.AAV/config.txt
    log: test/out/logs/test_verse_cond0.rep0_human_AAV.log
    jobid: 1
    wildcards: outpath=test/out, dset=test, samp=cond0.rep0, host=human, virus=AAV
    resources: mem_mb=100000, time=2:00:00, nodes=1

InputFunctionException in line 60 of /home/hartkopff/scratch/intvi_other-tools/snakemake_rules/verse.smk:
Error:
  ValueError: cannot convert float NaN to integer
Wildcards:
  outpath=test/out
  dset=test
  samp=cond0.rep0
  host=human
  virus=AAV
Traceback:
  File "/home/<user>/scratch/intvi_other-tools/snakemake_rules/verse.smk", line 85, in <lambda>
  File "/home/<user>/miniconda3/envs/snakemake/lib/python3.8/site-packages/snakemake/executors/__init__.py", line 131, in run_jobs
  File "/home/<user>/miniconda3/envs/snakemake/lib/python3.8/site-packages/snakemake/executors/__init__.py", line 140, in run
  File "/home/<user>/miniconda3/envs/snakemake/lib/python3.8/site-packages/snakemake/executors/__init__.py", line 151, in _run
  File "/home/<user>/miniconda3/envs/snakemake/lib/python3.8/site-packages/snakemake/executors/__init__.py", line 171, in printjob
  File "/home/<user>/miniconda3/envs/snakemake/lib/python3.8/site-packages/snakemake/executors/__init__.py", line 157, in printjob
szsctt commented 3 years ago

This error usually means that one of the required parameters is set to NaN, which can happen if there's a key missing from the config file. From the line, it looks like this is the similarity_thrd key (note the spelling!). Could you double-check that that key is in there? There aren't any defaults in this workflow so if there's one missing somewhere, the whole thing will fail.

TheBready commented 3 years ago

@szsctt, thanks. I will check that.

TheBready commented 3 years ago

Okay, I found the issue. The issue was that I used a relative path for read_directory and out_directory. After changing it to an absolute path, it worked like intended. But it is a weird error for that.

Update: Not fixed yet.

TheBready commented 3 years ago

Okay, now I really found the issue. The problem is that analysis_df_value(wildcards, analysis_df, 'string_of_parameter') looks for the experiment and not for the tool. But only the tools have tool-specific parameters, and for all other tools, it's NaNs.

This change in scripts/input_functions.py would fix it.

def analysis_df_value(wildcards, analysis_df, column_name):
    return analysis_df.loc[(analysis_df['experiment'] == wildcards.dset).idxmax(), column_name] 

to

def analysis_df_value(tool, analysis_df, column_name):
    return analysis_df.loc[(analysis_df['tool'] == tool).idxmax(), column_name] 

Can I create a merge request for that change?