Skip to content

Commit 42f4248

Browse files
author
Daniel Cooke
committed
Add command line option "--aggregate-annotations"
1 parent 420dfea commit 42f4248

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

scripts/train_random_forest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def run_octopus(octopus, reference, reads, regions, threads, output,
226226
['-t', str(regions), \
227227
'--ignore-unmapped-contigs', \
228228
'--disable-call-filtering', \
229+
'--aggregate-annotations', \
229230
'--threads', str(threads), \
230231
'-o', str(output)]
231232
if annotations == "all":

src/config/option_collation.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,6 +2280,11 @@ auto get_caller_type(const OptionMap& options, const std::vector<SampleName>& sa
22802280
return get_caller_type(options, samples, get_pedigree(options, samples));
22812281
}
22822282

2283+
bool aggregate_annotations(const OptionMap& options)
2284+
{
2285+
return options.at("aggregate-annotations").as<bool>();
2286+
}
2287+
22832288
std::unique_ptr<VariantCallFilterFactory>
22842289
make_call_filter_factory(const ReferenceGenome& reference, ReadPipe& read_pipe, const OptionMap& options,
22852290
boost::optional<fs::path> temp_directory)
@@ -2350,6 +2355,7 @@ make_call_filter_factory(const ReferenceGenome& reference, ReadPipe& read_pipe,
23502355
auto annotations = get_requested_measure_annotations(options);
23512356
output_options.annotations.insert(std::begin(annotations), std::end(annotations));
23522357
}
2358+
output_options.aggregate_allele_annotations = aggregate_annotations(options);
23532359
result->set_output_options(std::move(output_options));
23542360
}
23552361
}

src/config/option_parser.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,10 @@ OptionMap parse_options(const int argc, const char** argv)
748748
po::value<std::vector<std::string>>()->multitoken()->implicit_value(std::vector<std::string> {"active"}, "active")->composing(),
749749
"Annotations to write to final VCF")
750750

751+
("aggregate-annotations",
752+
po::bool_switch()->default_value(false),
753+
"Aggregate all multi-value annotations into a single value")
754+
751755
("filter-vcf",
752756
po::value<fs::path>(),
753757
"Filter the given Octopus VCF without calling")

src/core/csr/filters/training_filter_factory.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ std::unique_ptr<VariantCallFilter> TrainingFilterFactory::do_make(FacetFactory f
5959
output_config.annotations.clear();
6060
output_config.annotations.reserve(measures_.size());
6161
for (const auto& measure : measures_) output_config.annotations.insert(measure.name());
62-
output_config.clear_info = true;
6362
output_config.clear_existing_filters = true;
64-
output_config.aggregate_allele_annotations = true;
6563
return std::make_unique<PassingVariantCallFilter>(std::move(facet_factory), std::move(measures_),
6664
output_config, threading, progress);
6765
}

0 commit comments

Comments
 (0)