Skip to content

Commit 9c5c788

Browse files
committed
Add CLI flag to ignore haplotagging information
1 parent bd2b268 commit 9c5c788

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

caller.cpp

+10-12
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,17 @@ vector<Cluster> Caller::split_cluster(const Cluster &cluster) {
104104
Cluster cluster_2 = cluster;
105105
cluster_2.clear();
106106
for (const SubRead &sr : cluster.subreads) {
107-
if (sr.htag == 0)
107+
if (config->useht) {
108+
if (sr.htag == 1)
109+
cluster_1.add_subread(sr);
110+
else if (sr.htag == 2)
111+
cluster_2.add_subread(sr);
112+
else
113+
// 0 or no tag
114+
cluster_0.add_subread(sr);
115+
} else {
108116
cluster_0.add_subread(sr);
109-
else if (sr.htag == 1)
110-
cluster_1.add_subread(sr);
111-
else if (sr.htag == 2)
112-
cluster_2.add_subread(sr);
117+
}
113118
}
114119
cluster_0.cov1 = -1;
115120
cluster_0.cov2 = -1;
@@ -118,13 +123,6 @@ vector<Cluster> Caller::split_cluster(const Cluster &cluster) {
118123
cluster_2.cov0 = -1;
119124
cluster_2.cov1 = -1;
120125

121-
assert(cluster_0.size() <= cluster_0.cov0 &&
122-
cluster_1.size() <= cluster_1.cov1 &&
123-
cluster_2.size() <= cluster_2.cov2);
124-
125-
assert(cluster_1.size() != 0 || cluster_2.size() != 0 ||
126-
cluster_0.size() != 0);
127-
128126
vector<Cluster> out_subclusters;
129127
if (cluster_1.size() == 0 && cluster_2.size() == 0) {
130128
// no alignment is tagged, use length

config.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Configuration::Configuration()
4444
("min-cluster-weight", "", cxxopts::value<int>())
4545
("clipped", "", cxxopts::value<bool>()->default_value("false"))
4646
("noref", "", cxxopts::value<bool>()->default_value("false"))
47+
("noht", "", cxxopts::value<bool>()->default_value("false"))
4748
("noassemble", "", cxxopts::value<bool>()->default_value("false"))
4849
("noputative", "", cxxopts::value<bool>()->default_value("false"))
4950
("binary", "", cxxopts::value<bool>()->default_value("false"))
@@ -93,6 +94,7 @@ void Configuration::parse(int argc, char **argv) {
9394
al_accuracy = results["acc"].as<float>();
9495
binary = results["binary"].as<bool>();
9596
clipped = results["clipped"].as<bool>();
97+
useht = !results["noht"].as<bool>();
9698
noref = results["noref"].as<bool>();
9799
assemble = !(results["noassemble"].as<bool>());
98100
putative = !(results["noputative"].as<bool>());

config.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static const char CALL_USAGE_MESSAGE[] =
4343
" --clusters <FILE> store clusters to this file (default: do not store)\n"
4444
" --min-cluster-weight <INT> minimum number of supporting superstrings for a call to be reported (default: 2)\n"
4545
" --min-sv-length <INT> minimum length of reported SVs (default: 25)\n"
46+
" --noht do not use haplotagging information even if present\n"
4647
" --noref do not report 0/0 calls\n"
4748
" --min-mapq minimum mapping quality (default: 20)\n"
4849
" --clipped calls SVs from clipped SFS (EXPERIMENTAL)\n"
@@ -86,6 +87,7 @@ class Configuration {
8687
int min_indel_length = 20;
8788
uint min_cluster_weight = 2;
8889
float min_ratio = 0.97; // FIXME: change name
90+
bool useht = true;
8991
bool noref = false;
9092
bool clipped = false;
9193

0 commit comments

Comments
 (0)