Commit 6925a0de authored by Mikaël Salson's avatar Mikaël Salson

germline.{cpp,h}: Use a constant to tell that delta_min was not set

Moreover ~0 was a pretty bad choice as it is usually -1. Therefore we now use
INT_MAX which should be safer now.
parent 31015489
......@@ -107,7 +107,7 @@ Germline::Germline(string _code, char _shortcut,
Germline::Germline(string code, char shortcut, string path, json json_recom,
int delta_min, string seed, int max_indexing)
{
if (delta_min == ~0) {
if (delta_min == UNSET_DELTA_MIN) {
delta_min = DEFAULT_DELTA_MIN;
if (json_recom.find("4") != json_recom.end()) {
......@@ -311,7 +311,7 @@ void MultiGermline::build_from_json(string path, string json_filename_and_filter
json json_parameters = json_value["parameters"];
string seed = json_parameters["seed"];
if (default_delta_min == ~0) {
if (default_delta_min == UNSET_DELTA_MIN) {
if (json_parameters.count("delta_min") > 0) {
delta_min = json_parameters["delta_min"];
}
......
......@@ -12,9 +12,11 @@
#include "../lib/json.hpp"
#include "kmerstorefactory.hpp"
#include "bioreader.hpp"
#include <climits>
#define DEFAULT_DELTA_MIN -10
#define DEFAULT_DELTA_MIN_D 0
#define UNSET_DELTA_MIN INT_MAX
#define DEFAULT_GERMLINE_SEED SEED_S10
enum SEGMENTATION_METHODS {
......@@ -74,7 +76,7 @@ class Germline {
int max_indexing=0);
Germline(string _code, char shortcut, string path, json json_recom,
int delta_min=~0, string seed="", int max_indexing=0);
int delta_min=UNSET_DELTA_MIN, string seed="", int max_indexing=0);
~Germline();
......@@ -161,7 +163,7 @@ class MultiGermline {
* filter: see GERMLINES_FILTER
* max_indexing:
*/
void build_from_json(string path, string json_filename_and_filter, int filter, int default_delta_min=~0,
void build_from_json(string path, string json_filename_and_filter, int filter, int default_delta_min=UNSET_DELTA_MIN,
string default_seed="", int default_max_indexing=0);
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment