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

fix: bug with -O being used for gap opening penalty and samtools output directory #6

Open
wants to merge 2 commits into
base: cloned_master_b915e
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bio/minimap2/aligner/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
log = snakemake.log_fmt_shell(stdout=False, stderr=True)
sort = snakemake.params.get("sorting", "none")
sort_extra = snakemake.params.get("sort_extra", "")
gap_opening = snakemake.params.get("gap_opening", "")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

category Error Handling

The code retrieves the 'gap_opening' parameter from snakemake using snakemake.params.get("gap_opening", ""). However, if this parameter is not provided in the snakemake configuration, it will default to an empty string. This can lead to invalid command line arguments being passed to minimap2 if the empty string is used as the value for the '-O' option.

To handle this case more robustly, consider providing a default value for the 'gap_opening' parameter. For example, you can modify the line to: gap_opening = snakemake.params.get("gap_opening", "0"). This way, if the parameter is not specified, it will default to "0" instead of an empty string, ensuring a valid value is always passed to minimap2.

Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews.


out_ext = infer_out_format(snakemake.output[0])

Expand Down Expand Up @@ -45,6 +46,7 @@
"(minimap2"
" -t {snakemake.threads}"
" {extra} "
" -O {gap_opening} "
" {snakemake.input.target}"
" {snakemake.input.query}"
" {pipe_cmd}"
Expand Down
Loading