Skip to content

False positive for -a detection in --mm2-params when using --cap-kalloc option #201

Description

@JohGi

Hi,

I'm running into a false positive when passing certain --mm2-params to ragtag.py scaffold. For instance:

ragtag.py scaffold --mm2-params '--cap-kalloc 100m -x asm5' reference.fasta query.fasta

triggers this error:

Traceback (most recent call last):
  File "/usr/local/bin/ragtag_scaffold.py", line 577, in <module>
    main()
  File "/usr/local/bin/ragtag_scaffold.py", line 420, in main
    al.run_aligner()
  File "/usr/local/lib/python3.9/site-packages/ragtag_utilities/Aligner.py", line 126, in run_aligner
    if all([self.params_are_valid(), self.exec_is_valid()]):
  File "/usr/local/lib/python3.9/site-packages/ragtag_utilities/Aligner.py", line 199, in params_are_valid
    raise ValueError("Alignments must not be in SAM format (-a).")
ValueError: Alignments must not be in SAM format (-a)."

even though I'm not using -a. Looking at the code, it seems that the check causes any option containing the letter "a" (like --cap-kalloc) to trigger the error.

I think something like:

all_flags = self.params_string.split()
if "-a" in all_flags:
    raise ValueError("Alignments must not be in SAM format (-a).")

could fix the issue.

Thanks a lot for your work on RagTag!
Best,
Johanna

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions