Skip to content

Commit

Permalink
Add missing filter print function header declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
lczech committed May 29, 2024
1 parent 3a50857 commit 7602f74
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 6 deletions.
14 changes: 11 additions & 3 deletions lib/genesis/population/filter/sample_counts_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ size_t sample_counts_filter_stats_category_counts(
// Printing
// =================================================================================================

// --------------------------------------------------------------------------------------
// Print sample stats
// --------------------------------------------------------------------------------------

std::ostream& print_sample_counts_filter_stats(
std::ostream& os,
SampleCountsFilterStats const& stats,
Expand Down Expand Up @@ -203,6 +207,10 @@ std::string print_sample_counts_filter_stats(
return ss.str();
}

// --------------------------------------------------------------------------------------
// Print category stats
// --------------------------------------------------------------------------------------

std::ostream& print_sample_counts_filter_category_stats(
std::ostream& os,
SampleCountsFilterCategoryStats const& stats,
Expand All @@ -213,13 +221,13 @@ std::ostream& print_sample_counts_filter_category_stats(

// Go through all possible enum values and print them
if( stats[SampleCountsFilterTagCategory::kMissingInvalid] > 0 || verbose ) {
os << "Missing: " << stats[SampleCountsFilterTagCategory::kMissingInvalid] << "\n";
os << "Missing: " << stats[SampleCountsFilterTagCategory::kMissingInvalid] << "\n";
}
if( stats[SampleCountsFilterTagCategory::kNumeric] > 0 || verbose ) {
os << "Numerics: " << stats[SampleCountsFilterTagCategory::kNumeric] << "\n";
os << "Numerical: " << stats[SampleCountsFilterTagCategory::kNumeric] << "\n";
}
if( stats[SampleCountsFilterTagCategory::kPassed] > 0 || verbose ) {
os << "Passed: " << stats[SampleCountsFilterTagCategory::kPassed] << "\n";
os << "Passed: " << stats[SampleCountsFilterTagCategory::kPassed] << "\n";
}
return os;
}
Expand Down
36 changes: 35 additions & 1 deletion lib/genesis/population/filter/sample_counts_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ size_t sample_counts_filter_stats_category_counts(
// =================================================================================================

// --------------------------------------------------------------------------------------
// Print stats
// Print sample stats
// --------------------------------------------------------------------------------------

/**
Expand All @@ -255,6 +255,40 @@ std::string print_sample_counts_filter_stats(
bool verbose = false
);

// --------------------------------------------------------------------------------------
// Print category stats
// --------------------------------------------------------------------------------------

std::ostream& print_sample_counts_filter_category_stats(
std::ostream& os,
SampleCountsFilterCategoryStats const& stats,
bool verbose = false
);

std::string print_sample_counts_filter_category_stats(
SampleCountsFilterCategoryStats const& stats,
bool verbose = false
);

inline std::ostream& print_sample_counts_filter_category_stats(
std::ostream& os,
SampleCountsFilterStats const& stats,
bool verbose = false
) {
return print_sample_counts_filter_category_stats(
os, sample_counts_filter_stats_category_counts( stats ), verbose
);
}

inline std::string print_sample_counts_filter_category_stats(
SampleCountsFilterStats const& stats,
bool verbose = false
) {
return print_sample_counts_filter_category_stats(
sample_counts_filter_stats_category_counts( stats ), verbose
);
}

} // namespace population
} // namespace genesis

Expand Down
10 changes: 9 additions & 1 deletion lib/genesis/population/filter/variant_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ size_t variant_filter_stats_category_counts(
// Printing
// =================================================================================================

// --------------------------------------------------------------------------------------
// Print variant stats
// --------------------------------------------------------------------------------------

std::ostream& print_variant_filter_stats(
std::ostream& os,
VariantFilterStats const& stats,
Expand Down Expand Up @@ -258,6 +262,10 @@ std::string print_variant_filter_stats(
return ss.str();
}

// --------------------------------------------------------------------------------------
// Print category stats
// --------------------------------------------------------------------------------------

std::ostream& print_variant_filter_category_stats(
std::ostream& os,
VariantFilterCategoryStats const& stats,
Expand All @@ -277,7 +285,7 @@ std::ostream& print_variant_filter_category_stats(
os << "No samples: " << stats[VariantFilterTagCategory::kSamplesFailed] << "\n";
}
if( stats[VariantFilterTagCategory::kNumeric] > 0 || verbose ) {
os << "Numrics: " << stats[VariantFilterTagCategory::kNumeric] << "\n";
os << "Numrica;: " << stats[VariantFilterTagCategory::kNumeric] << "\n";
}
if( stats[VariantFilterTagCategory::kInvariant] > 0 || verbose ) {
os << "Invariant: " << stats[VariantFilterTagCategory::kInvariant] << "\n";
Expand Down
36 changes: 35 additions & 1 deletion lib/genesis/population/filter/variant_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ size_t variant_filter_stats_category_counts(
// =================================================================================================

// --------------------------------------------------------------------------------------
// Print stats
// Print variant stats
// --------------------------------------------------------------------------------------

/**
Expand All @@ -365,6 +365,40 @@ std::string print_variant_filter_stats(
bool verbose = false
);

// --------------------------------------------------------------------------------------
// Print category stats
// --------------------------------------------------------------------------------------

std::ostream& print_variant_filter_category_stats(
std::ostream& os,
VariantFilterCategoryStats const& stats,
bool verbose = false
);

std::string print_variant_filter_category_stats(
VariantFilterCategoryStats const& stats,
bool verbose = false
);

inline std::ostream& print_variant_filter_category_stats(
std::ostream& os,
VariantFilterStats const& stats,
bool verbose = false
) {
return print_variant_filter_category_stats(
os, variant_filter_stats_category_counts( stats ), verbose
);
}

inline std::string print_variant_filter_category_stats(
VariantFilterStats const& stats,
bool verbose = false
) {
return print_variant_filter_category_stats(
variant_filter_stats_category_counts( stats ), verbose
);
}

} // namespace population
} // namespace genesis

Expand Down

0 comments on commit 7602f74

Please sign in to comment.