Skip to content

Commit c206da4

Browse files
author
Daniel Cooke
committed
Rename and refactor decoy/unlocalized supplementary alignment options
1 parent d573f88 commit c206da4

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

src/config/option_collation.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -939,17 +939,23 @@ auto make_read_filterer(const OptionMap& options)
939939
if (options.at("no-adapter-contaminated-reads").as<bool>()) {
940940
result.add(make_unique<IsNotContaminated>());
941941
}
942-
if (options.at("no-reads-with-decoy-supplementary-alignments").as<bool>()) {
942+
const auto max_decoy_supplementary_mq = as_unsigned("max-decoy-supplementary-alignment-mapping-quality", options);
943+
if (max_decoy_supplementary_mq > 0) {
944+
result.add(make_unique<NoDecoySupplementaryAlignments>(max_decoy_supplementary_mq));
945+
} else {
943946
result.add(make_unique<NoDecoySupplementaryAlignments>());
944-
} else if (!options.at("allow-reads-with-good-decoy-supplementary-alignments").as<bool>()) {
945-
result.add(make_unique<NoDecoySupplementaryAlignments>(min_mapping_quality));
946947
}
947-
if (options.at("no-reads-with-unplaced-or-unlocalized-supplementary-alignments").as<bool>()) {
948-
result.add(make_unique<NoUnlocalizedSupplementaryAlignments>());
948+
const auto max_unplaced_supplementary_mq = as_unsigned("max-unplaced-supplementary-alignment-mapping-quality", options);
949+
if (max_unplaced_supplementary_mq > 0) {
950+
result.add(make_unique<NoUnplacedSupplementaryAlignments>(max_unplaced_supplementary_mq));
951+
} else {
949952
result.add(make_unique<NoUnplacedSupplementaryAlignments>());
950-
} else if (!options.at("allow-reads-with-good-unplaced-or-unlocalized-supplementary-alignments").as<bool>()) {
951-
result.add(make_unique<NoUnlocalizedSupplementaryAlignments>(min_mapping_quality));
952-
result.add(make_unique<NoUnplacedSupplementaryAlignments>(min_mapping_quality));
953+
}
954+
const auto max_unlocalized_supplementary_mq = as_unsigned("max-unlocalized-supplementary-alignment-mapping-quality", options);
955+
if (max_unlocalized_supplementary_mq > 0) {
956+
result.add(make_unique<NoUnlocalizedSupplementaryAlignments>(max_unlocalized_supplementary_mq));
957+
} else {
958+
result.add(make_unique<NoUnlocalizedSupplementaryAlignments>());
953959
}
954960
result.shrink_to_fit();
955961
return result;

src/config/option_parser.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -296,21 +296,17 @@ OptionMap parse_options(const int argc, const char** argv)
296296
po::bool_switch()->default_value(false),
297297
"Filter reads with possible adapter contamination")
298298

299-
("no-reads-with-decoy-supplementary-alignments",
300-
po::bool_switch()->default_value(false),
301-
"Filter reads with supplementary alignments mapped to decoy contigs")
302-
303-
("allow-reads-with-good-decoy-supplementary-alignments",
304-
po::bool_switch()->default_value(false),
305-
"Do not filer reads with supplementary alignments mapped to decoy contigs with high mapping quality (--min-mapping-quality)")
299+
("max-decoy-supplementary-alignment-mapping-quality",
300+
po::value<int>()->default_value(5),
301+
"Filter reads with supplementary alignments mapped to decoy contigs with mapping quality greater than this")
306302

307-
("no-reads-with-unplaced-or-unlocalized-supplementary-alignments",
308-
po::bool_switch()->default_value(false),
309-
"Filter reads with supplementary alignments mapped to unplaced or unlocalized contigs")
303+
("max-unplaced-supplementary-alignment-mapping-quality",
304+
po::value<int>()->default_value(5),
305+
"Filter reads with supplementary alignments mapped to unplaced contigs with mapping quality greater than this")
310306

311-
("allow-reads-with-good-unplaced-or-unlocalized-supplementary-alignments",
312-
po::bool_switch()->default_value(false),
313-
"Do not filer reads with supplementary alignments mapped to unplaced or unlocalized contigs with high mapping quality (--min-mapping-quality)")
307+
("max-unlocalized-supplementary-alignment-mapping-quality",
308+
po::value<int>()->default_value(5),
309+
"Filter reads with supplementary alignments mapped to unlocalized contigs with mapping quality greater than this")
314310

315311
("disable-downsampling",
316312
po::bool_switch()->default_value(false),

0 commit comments

Comments
 (0)