Skip to content

Commit 2f91f29

Browse files
committedDec 22, 2018
minor reorg of ReadFilter
1 parent c4942ce commit 2f91f29

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed
 

‎SeqLib/ReadFilter.h

+5
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,11 @@ class ReadFilterCollection {
549549
return num;
550550
}
551551

552+
/** Check that the filter collection includes something.
553+
* If not, then give it a universal includer
554+
*/
555+
void CheckHasIncluder();
556+
552557
// Return the a tab-delimited tally of which filters were satisfied.
553558
// Includes the header:
554559
// total_seen_count total_passed_count region region_passed_count rule rule_passed_count

‎src/ReadFilter.cpp

+20-13
Original file line numberDiff line numberDiff line change
@@ -263,20 +263,27 @@ bool ReadFilter::isReadOverlappingRegion(const BamRecord &r) const {
263263

264264
}
265265

266-
// check that there is at least one non-excluder region.
267-
// if not, give global includer
268-
bool has_includer = false;
269-
for (std::vector<ReadFilter>::const_iterator kk = m_regions.begin(); kk != m_regions.end(); ++kk)
270-
if (!kk->excluder)
271-
has_includer = true;
272-
if (!has_includer) {
273-
ReadFilter mr;
274-
mr.m_abstract_rules.push_back(rule_all);
275-
mr.id = "WG_includer";
276-
m_regions.push_back(mr);
277-
}
278-
266+
// make sure that there is at least one includer region
267+
this->CheckHasIncluder();
268+
279269
}
270+
271+
void ReadFilterCollection::CheckHasIncluder() {
272+
273+
// check that there is at least one non-excluder region.
274+
// if not, give global includer
275+
bool has_includer = false;
276+
for (std::vector<ReadFilter>::const_iterator kk = m_regions.begin(); kk != m_regions.end(); ++kk)
277+
if (!kk->excluder)
278+
has_includer = true;
279+
if (!has_includer) {
280+
ReadFilter mr;
281+
mr.m_abstract_rules.push_back(rule_all);
282+
mr.id = "WG_includer";
283+
m_regions.push_back(mr);
284+
}
285+
286+
}
280287

281288
void ReadFilter::setRegions(const GRC& g) {
282289
m_grv = g;

0 commit comments

Comments
 (0)
Please sign in to comment.