From aef5cd9e64cc130a064d86f85d81381a11069735 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Thu, 3 Oct 2024 13:05:07 +0200 Subject: [PATCH] Add a --mcs command-line option for enabling multi-context seeds --- src/cmdline.cpp | 2 ++ src/cmdline.hpp | 1 + src/main.cpp | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cmdline.cpp b/src/cmdline.cpp index ec5f7e70..a4f2c068 100644 --- a/src/cmdline.cpp +++ b/src/cmdline.cpp @@ -54,6 +54,7 @@ CommandLineOptions parse_command_line_arguments(int argc, char **argv) { args::ValueFlag end_bonus(parser, "INT", "Soft clipping penalty [10]", {'L'}); args::Group search(parser, "Search parameters:"); + args::Flag mcs(parser, "mcs", "Use multi-context seeds for finding hits", {"mcs"}); args::ValueFlag f(parser, "FLOAT", "Top fraction of repetitive strobemers to filter out from sampling [0.0002]", {'f'}); args::ValueFlag S(parser, "FLOAT", "Try candidate sites with mapping score at least S of maximum mapping score [0.5]", {'S'}); args::ValueFlag M(parser, "INT", "Maximum number of mapping sites to try [20]", {'M'}); @@ -130,6 +131,7 @@ CommandLineOptions parse_command_line_arguments(int argc, char **argv) { if (end_bonus) { opt.end_bonus = args::get(end_bonus); } // Search parameters + if (mcs) { opt.mcs = args::get(mcs); } if (f) { opt.f = args::get(f); } if (S) { opt.dropoff_threshold = args::get(S); } if (M) { opt.max_tries = args::get(M); } diff --git a/src/cmdline.hpp b/src/cmdline.hpp index f780ba3d..7cd1e730 100644 --- a/src/cmdline.hpp +++ b/src/cmdline.hpp @@ -62,6 +62,7 @@ struct CommandLineOptions { int end_bonus { 10 }; // Search parameters + bool mcs { false }; float f { 0.0002 }; float dropoff_threshold { 0.5 }; int max_tries { 20 }; diff --git a/src/main.cpp b/src/main.cpp index 30f5c368..660e1678 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -196,7 +196,7 @@ int run_strobealign(int argc, char **argv) { map_param.dropoff_threshold = opt.dropoff_threshold; map_param.rescue_level = opt.rescue_level; map_param.max_tries = opt.max_tries; - map_param.use_mcs = false; //opt.r < 200; + map_param.use_mcs = opt.mcs; map_param.output_format = ( opt.is_abundance_out ? OutputFormat::Abundance : opt.is_sam_out ? OutputFormat::SAM : @@ -231,6 +231,7 @@ int run_strobealign(int argc, char **argv) { } logger.debug() << "Auxiliary hash length: " << index_parameters.randstrobe.aux_len << "\n"; + logger.info() << "Using multi-context seeds: " << (map_param.use_mcs ? "yes" : "no") << '\n'; StrobemerIndex index(references, index_parameters, opt.bits); if (opt.use_index) { // Read the index from a file