pdimens / harpy

Process raw haplotagging data, from raw sequences to phased haplotypes, batteries included.
https://pdimens.github.io/harpy
GNU General Public License v3.0
11 stars 1 forks source link

harpy sv naibr IndexError: list index out of range #131

Closed azwadriqbal closed 3 weeks ago

azwadriqbal commented 3 weeks ago

Describe the bug

Hi Pavel!

I'm trying to run harpy sv naibr but keep running into this error:

╭──────────────────────────── harpy sv naibr ─────────────────────────────╮
│ Samples:         8                                                      │
│ Genome:          Genome/Drosophila_melanogaster.BDGP6.32.dna.toplevel.… │
│ Sample Pooling:  no                                                     │
│ Perform Phasing: yes                                                    │
│ Output Folder:   SV/naibr/                                              │
│ Workflow Log:    logs/snakemake/sv_naibr.1.25_08_2024.log               │
╰─────────────────────────────────────────────────────────────────────────╯
╭─ Snakefile Error ───────────────────────────────────────────────────────╮
│ If you manually edited the Snakefile, see the error below to fix it. If │
│ you didn't edit it manually, it's probably a bug (oops!) and you should │
│ submit an issue on GitHub: https://github.com/pdimens/harpy/issues      │
╰──────────────────── The error reported by Snakemake ────────────────────╯
Traceback (most recent call last):
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/bin/harpy", line 11, in <module>
    sys.exit(cli())
             ^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/rich_click/rich_command.py", line 367, in __call__
    return super().__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/rich_click/rich_command.py", line 152, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/harpy/sv.py", line 239, in naibr
    launch_snakemake(command, "sv_naibr", start_text, output_dir, sm_log, quiet)
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/harpy/_launch.py", line 113, in launch_snakemake
    startprint = [i for i,j in enumerate(errtext) if j.startswith("total")][0] + 2
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

The command I'm trying to run is: harpy sv naibr --conda -t 20 -g Genome/Drosophila_melanogaster.BDGP6.32.dna.toplevel.fa --vcf Phase/variants.phased.bcf Align/bwa/

Best, Azwad

Harpy Version

1.7.0

File that triggers the error (if applicable)

variants.phased.zip

Harpy error log

$ harpy sv naibr --conda -t 20 -g Genome/Drosophila_melanogaster.BDGP6.32.dna.toplevel.fa --vcf Phase/variants.phased.bcf Align/bwa/

╭──────────────────────────── harpy sv naibr ─────────────────────────────╮
│ Samples:         8                                                      │
│ Genome:          Genome/Drosophila_melanogaster.BDGP6.32.dna.toplevel.… │
│ Sample Pooling:  no                                                     │
│ Perform Phasing: yes                                                    │
│ Output Folder:   SV/naibr/                                              │
│ Workflow Log:    logs/snakemake/sv_naibr.1.25_08_2024.log               │
╰─────────────────────────────────────────────────────────────────────────╯
╭─ Snakefile Error ───────────────────────────────────────────────────────╮
│ If you manually edited the Snakefile, see the error below to fix it. If │
│ you didn't edit it manually, it's probably a bug (oops!) and you should │
│ submit an issue on GitHub: https://github.com/pdimens/harpy/issues      │
╰──────────────────── The error reported by Snakemake ────────────────────╯
Traceback (most recent call last):
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/bin/harpy", line 11, in <module>
    sys.exit(cli())
             ^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/rich_click/rich_command.py", line 367, in __call__
    return super().__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/rich_click/rich_command.py", line 152, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/harpy/sv.py", line 239, in naibr
    launch_snakemake(command, "sv_naibr", start_text, output_dir, sm_log, quiet)
  File "/lustre2/home/nt246_0001/ari22/miniforge3/envs/harpy/lib/python3.12/site-packages/harpy/_launch.py", line 113, in launch_snakemake
    startprint = [i for i,j in enumerate(errtext) if j.startswith("total")][0] + 2
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Before submitting

pdimens commented 3 weeks ago

Looking into this today. There's definitely an error happening with your run, but in trying to print the error, Harpy itself is running into an error. I'll try to get a fix out today, but you'll need to pull the dev version if you need it quickly. I'll let you know when it's ready.

pdimens commented 3 weeks ago

Was the logs/snakemake/sv_naibr.1.25_08_2024.log file generated or not? Usually if you're getting an error regarding the snakefile, it occurs before the logfile is created.

azwadriqbal commented 3 weeks ago

Doesn't look like the log file was generated, but after installing the dev version of harpy the SV module ran without issue!

pdimens commented 3 weeks ago

That's peculiar and somewhat unhelpful. I'm glad it's working, though. I'll close this issue for now, but can reopen it if it happens again.