Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify class Rec_Event's constructors #57

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions igor_src/Rec_Event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ using namespace std;

//std::ofstream log_file(std::string("/media/quentin/419a9e2c-2635-471b-baa0-58a693d04d87/data/tcr_murugan/one_seq_comp/logs.txt"));

Rec_Event::Rec_Event(Gene_class gene , Seq_side side ): priority(0) , event_class(gene) , event_side(side) , name("Undefined_event_name") ,len_min(INT16_MAX) , len_max(INT16_MIN) , type(Undefined_t), event_index(INT16_MIN) , updated(false),fixed(false) , current_realizations_index_vec(vector<int>()) , scenario_downstream_upper_bound_proba(-1),event_upper_bound_proba(-1),scenario_upper_bound_proba(-1),current_realization_index(nullptr){} //FIXME why does this exist? anyway fix initilization


Rec_Event::Rec_Event(Gene_class gene , Seq_side side , unordered_map<string , Event_realization>& realizations): Rec_Event(gene,side) {
this->event_realizations = realizations;
}

Rec_Event::Rec_Event(): Rec_Event( Undefined_gene , Undefined_side ) {}
Rec_Event::Rec_Event(Gene_class gene , Seq_side side , const unordered_map<string,Event_realization>& realizations): event_class(gene) , event_side(side), event_realizations(realizations){}



Expand Down
33 changes: 16 additions & 17 deletions igor_src/Rec_Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ struct Event_realization {
*/
class Rec_Event {
public:
Rec_Event();
Rec_Event(Gene_class, Seq_side );
Rec_Event(Gene_class, Seq_side ,std::unordered_map<std::string,Event_realization>&);
Rec_Event() = default;
Rec_Event(Gene_class, Seq_side , const std::unordered_map<std::string,Event_realization>& realizations = {});
virtual ~Rec_Event();
virtual std::shared_ptr<Rec_Event> copy() = 0;//TODO make it const somehow
virtual int size()const;
Expand Down Expand Up @@ -190,27 +189,27 @@ class Rec_Event {

protected:
std::unordered_map < std::string, Event_realization > event_realizations;
int priority;
Gene_class event_class;
Seq_side event_side ;
Rec_Event_name name; //Construct the name in a smart way so that it is unique
int priority = 0;
Gene_class event_class = Undefined_gene;
Seq_side event_side = Undefined_side;
Rec_Event_name name = "Undefined_event_name"; //Construct the name in a smart way so that it is unique
std::string nickname;
int len_min;
int len_max;
Event_type type;
int event_index;
int len_min = INT16_MAX;
int len_max = INT16_MIN;
Event_type type = Undefined_t;
int event_index = INT16_MIN;
std::forward_list<std::tuple<int,int,int>> memory_and_offsets;//0: event identifier , 1: memory layer , 2: offset
bool updated;
bool updated = false;
bool viterbi_run;
bool initialized;
size_t event_marginal_size;
bool fixed;
double event_upper_bound_proba;
double scenario_downstream_upper_bound_proba;
double scenario_upper_bound_proba; // Used at runtime to store the upper bound probability of the whole scenario
bool fixed = false;
double event_upper_bound_proba = -1;
double scenario_downstream_upper_bound_proba = -1;
double scenario_upper_bound_proba = -1; // Used at runtime to store the upper bound probability of the whole scenario
std::forward_list<double*> updated_proba_bounds_list;
std::vector<int> current_realizations_index_vec;
const int* current_realization_index;
const int* current_realization_index = nullptr;
int current_downstream_proba_memory_layers[6];


Expand Down