Skip to content

Commit 3bc70d7

Browse files
committed
Add argument to change accuracy percentile of smoothing
1 parent 91a4699 commit 3bc70d7

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

config.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Configuration::Configuration()
4242
("min-sv-length", "", cxxopts::value<int>())
4343
("min-mapq", "", cxxopts::value<int>())
4444
("min-cluster-weight", "", cxxopts::value<int>())
45+
("accq", "", cxxopts::value<float>())
4546
("clipped", "", cxxopts::value<bool>()->default_value("false"))
4647
("noref", "", cxxopts::value<bool>()->default_value("false"))
4748
("noht", "", cxxopts::value<bool>()->default_value("false"))
@@ -68,7 +69,8 @@ void Configuration::parse(int argc, char **argv) {
6869
if (results.count("index"))
6970
index = results["index"].as<std::string>();
7071
if (results.count("fastx"))
71-
fastq = results["fastx"].as<std::string>(); // FIXME: use fastx here and in pingpong
72+
fastq = results["fastx"]
73+
.as<std::string>(); // FIXME: use fastx here and in pingpong
7274
if (results.count("overlap"))
7375
overlap = results["overlap"].as<int>();
7476
if (results.count("bsize"))
@@ -87,6 +89,8 @@ void Configuration::parse(int argc, char **argv) {
8789
min_cluster_weight = results["min-cluster-weight"].as<int>();
8890
if (results.count("min-mapq"))
8991
min_mapq = results["min-mapq"].as<int>();
92+
if (results.count("accq"))
93+
accq = results["accq"].as<float>();
9094
if (results.count("l"))
9195
min_ratio = results["l"].as<float>();
9296
binary = results["binary"].as<bool>();

config.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ static const char INDEX_USAGE_MESSAGE[] =
2424

2525
static const char SMOOTH_USAGE_MESSAGE[] =
2626
"SVDSS smooth --reference <reference> --bam <bam>\n"
27-
" --min-mapq minimum mapping quality (default: 20)\n"
27+
" --min-mapq <INT> minimum mapping quality (default: 20)\n"
28+
" --accq <FLOAT> accuracy percentile for alignments filtering (default: 0.98)\n"
2829
" --threads <INT> number of threads to use (default: 4)\n"
2930
" --help print help message\n";
3031

@@ -69,6 +70,9 @@ class Configuration {
6970
bool verbose = false;
7071
bool help = false;
7172

73+
// smoother
74+
float accq = 0.98;
75+
7276
// pingpong.index
7377
bool binary = false;
7478
// pingpong.search

smoother.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ double Smoother::compute_maxaccuracy() {
342342
hts_idx_destroy(bam_index);
343343
sam_close(bam_file);
344344
std::sort(accuracies.begin(), accuracies.end());
345-
return quantile(accuracies, 0.98);
345+
return quantile(accuracies, config->accq);
346346
}
347347

348348
// BAM writing based on https://www.biostars.org/p/181580/

0 commit comments

Comments
 (0)