Skip to content

Commit

Permalink
add clusterGate class. RGLab/CytoML#45
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejiang committed Aug 27, 2018
1 parent 5f70822 commit 11f0a4c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
3 changes: 2 additions & 1 deletion inst/include/cytolib/GatingHierarchy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class GatingHierarchy{
throw(domain_error("no gate available for this node"));
if(g_loglevel>=POPULATION_LEVEL)
PRINT( "update channels for " +node.getName()+"\n");
if(g->getType()!=BOOLGATE&&g->getType()!=LOGICALGATE)
if(g->getType()!=BOOLGATE&&g->getType()!=LOGICALGATE&&g->getType()!=CLUSTERGATE)
g->updateChannels(chnl_map);
}
}
Expand Down Expand Up @@ -292,6 +292,7 @@ class GatingHierarchy{
break;
}
case LOGICALGATE://skip any gating operation since the indice is already set once the gate is added
case CLUSTERGATE:
node.computeStats();
return;
default:
Expand Down
25 changes: 24 additions & 1 deletion inst/include/cytolib/gate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const EVENT_DATA_TYPE pi = 3.1415926535897;
#define RECTGATE 5
#define LOGICALGATE 6
#define CURLYQUADGATE 7
#define CLUSTERGATE 8

#define AND 1
#define OR 2
Expand Down Expand Up @@ -1253,7 +1254,7 @@ class boolGate:public gate {
/**
* \class logicalGate
* \brief a special boolGate
*
* (Now deprecated by the dedicated clusterGate
* This is mainly used to deal with the situation where the gating algorithm (typically clustering based gating) doesn't generate any type of gate object.
* In order still be able to record the gating results (i.e. the logical indices), this logicalGate can be used as the dummy gate to be added to the node.
* Because nodeProperties requires a population node to have a gate to be associated with.
Expand All @@ -1274,6 +1275,28 @@ class logicalGate:public boolGate {
logicalGate():boolGate(){};
};

class clusterGate:public boolGate {
private:
string cluster_method_name_;
unsigned short getType(){return CLUSTERGATE; }
clusterGate * clone(){return new clusterGate(*this);};

public:
string get_cluster_method_name(){return cluster_method_name_;}
void convertToPb(pb::gate & gate_pb){
boolGate::convertToPb(gate_pb);
gate_pb.set_type(pb::CLUSTER_GATE);
//cp nested gate
pb::clusterGate * g_pb = gate_pb.mutable_cg();

g_pb->set_cluster_method(cluster_method_name_);

}
clusterGate(const pb::gate & gate_pb):boolGate(gate_pb), cluster_method_name_(gate_pb.cg().cluster_method()){};

clusterGate(string cluster_method_name):boolGate(),cluster_method_name_(cluster_method_name){};
};

enum QUAD{
Q1,//-+
Q2,//++
Expand Down

0 comments on commit 11f0a4c

Please sign in to comment.