akcorut / kGWASflow

kGWASflow is a Snakemake workflow for performing k-mers-based GWAS.
https://github.com/akcorut/kGWASflow/wiki
MIT License
28 stars 8 forks source link

Error in bowtie2_build #19

Closed Ax3man closed 12 months ago

Ax3man commented 1 year ago

Hi Kivanc,

I managed to complete the gwas run, but am now getting an error in the post-gwas analysis.

[Mon Aug 28 08:46:41 2023]
Job 1863: Creating bowtie2 index of the reference genome...
Reason: Missing output files: resources/ref/genome/bowtie2_index/genome.rev.1.bt2, resources/ref/genome/bowtie2_index/genome.3.bt2,
 resources/ref/genome/bowtie2_index/genome.1.bt2, resources/ref/genome/bowtie2_index/genome.2.bt2, resources/ref/genome/bowtie2_ind
ex/genome.rev.2.bt2, resources/ref/genome/bowtie2_index/genome.4.bt2

Activating conda environment: .snakemake/conda/b8dcc7d0bf53bfb0e15517eb0d690009_
Activating conda environment: .snakemake/conda/b8dcc7d0bf53bfb0e15517eb0d690009_
Traceback (most recent call last):
  File "/MankFlex/wouter/color_selection_lines/kmergwas/kgwasflow/.snakemake/scripts/tmp82_03ohu.wrapper.py", line 21, in <module>
    shell(
  File "/home/wouter/anaconda3/envs/mamba_kgwas/lib/python3.11/site-packages/snakemake/shell.py", line 139, in __new__
    cmd = format(cmd, *args, stepout=2, **kwargs)
  File "/home/wouter/anaconda3/envs/mamba_kgwas/lib/python3.11/site-packages/snakemake/utils.py", line 428, in format
    return fmt.format(_pattern, *args, **variables)
  File "/MankFlex/wouter/color_selection_lines/kmergwas/kgwasflow/.snakemake/conda/b8dcc7d0bf53bfb0e15517eb0d690009_/lib/python3.10
/string.py", line 161, in format
    return self.vformat(format_string, args, kwargs)
  File "/MankFlex/wouter/color_selection_lines/kmergwas/kgwasflow/.snakemake/conda/b8dcc7d0bf53bfb0e15517eb0d690009_/lib/python3.10
/string.py", line 165, in vformat
    result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
  File "/MankFlex/wouter/color_selection_lines/kmergwas/kgwasflow/.snakemake/conda/b8dcc7d0bf53bfb0e15517eb0d690009_/lib/python3.10
/string.py", line 205, in _vformat
    obj, arg_used = self.get_field(field_name, args, kwargs)
  File "/MankFlex/wouter/color_selection_lines/kmergwas/kgwasflow/.snakemake/conda/b8dcc7d0bf53bfb0e15517eb0d690009_/lib/python3.10
/string.py", line 276, in get_field
    obj = getattr(obj, i)
AttributeError: 'InputFiles' object has no attribute 'ref'
[Mon Aug 28 08:46:42 2023]
Error in rule bowtie2_build:
    jobid: 1863
    input: resources/ref/genome/genome.fasta
    output: resources/ref/genome/bowtie2_index/genome.1.bt2, resources/ref/genome/bowtie2_index/genome.2.bt2, resources/ref/genome/bowtie2_index/genome.3.bt2, resources/ref/genome/bowtie2_index/genome.4.bt2, resources/ref/genome/bowtie2_index/genome.rev.1.bt2, resources/ref/genome/bowtie2_index/genome.rev.2.bt2
    log: logs/ref/bowtie2_build/build.log (check log file(s) for error details)
    conda-env: /MankFlex/wouter/color_selection_lines/kmergwas/kgwasflow/.snakemake/conda/b8dcc7d0bf53bfb0e15517eb0d690009_

Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Error! The Snakemake workflow aborted.
Complete log: .snakemake/log/2023-08-28T084030.521134.snakemake.log
ERROR:root:Error running Snakemake: Command '['snakemake', '--use-conda', '--conda-frontend', 'conda', '--cores', '1', '--snakefile', '/home/wouter/anaconda3/envs/mamba_kgwas/lib/python3.11/site-packages/workflow/Snakefile', '--rerun-triggers', 'mtime', 'params', 'input', 'software-env', 'code']' returned non-zero exit status 1.

The mentioned log file (logs/ref/bowtie2_build/build.log) is an empty file.

I noticed the error:

AttributeError: 'InputFiles' object has no attribute 'ref'

While the rule uses reference as the name of the input, not ref (also see these docs?). Could this be the issue?

akcorut commented 12 months ago

Hi @Ax3man,

Sorry for my late reply. I was away the last couple of weeks and finally had time to go through the issues. Thank you for reporting this issue. It is indeed caused by a typo in the bowtie2_build rule. reference should be ref, you are right. Somehow it has escaped my attention. I fixed the issue with the commit 9ef6faf. It should work properly now. Let me know if you encounter any more issues with this rule. I'm closing the issue but feel free to reopen it if the problem continues.

Best, Kivanc

Ax3man commented 12 months ago

Thanks Kivanc, I appreciate it. I guess it's easiest for me to wait until you roll out an update on bioconda?