RGLab / flowWorkspace

flowWorkspace
GNU Affero General Public License v3.0
44 stars 21 forks source link

Boolean Gates #332

Closed DillonHammill closed 4 years ago

DillonHammill commented 4 years ago

Hi @mikejiang & @jacobpwagner,

I was hoping that you may be able to help me understand how AND/OR boolean gates that refer to multiple distinct nodes are handled. For example, if I wanted to add an OR boolean gate to capture the CD4 T Cells and CD8 T Cells below: image

My understanding is that the parental node to which the boolean gate is applied is irrelevant right? It simply provides a way to anchor the node to the gating tree, is that correct? If this is the case, should they just be added to the root node by default or if not, what is the best way to decide on the parental node to use (perhaps the most recent common ancestor - T Cells in this case)?

I just want to make sure that I implement this correctly in CytoExploreR.

mikejiang commented 4 years ago

You are right, the cell count will be the same (but apparently % will be different), It's up to you to decide where to put the bool node (whichever makes more sense semantically I guess)

DillonHammill commented 4 years ago

Thanks for confirming this @mikejiang, I guess anchoring the boolean node close to the relevant nodes in the gating tree make sense as this will change the order of the nodes in gs_get_pop_paths().

Hope you don't mind me asking another question about booleanFilters. So the booleanFilter constructor expects an expression, in the docs the example wraps the entire expression (replaced back ticks with single quotes here so that you can see it) booleanFilter('4+/TNFa+&!4+/IL2+') whilst in the docs for gs_pop_add() each side of the expression is wrapped separately booleanFilter('CD15 FITC-CD45 PE+'|'CD15 FITC+CD45 PE-'). Just wondering what the difference is? I first thought it may be the special characters but both expressions contain the same special characters. I actually tried both ways with the above case but only wrapping the entire expression seemed to work.

Thanks for your help!

mikejiang commented 4 years ago

You misread the doc, it is back ticks ~booleanFilter(`CD15 FITC-CD45 PE+`|`CD15 FITC+CD45 PE-`)~

DillonHammill commented 4 years ago

Yes that is what I meant, I just used single quotes above because I could not get the back ticks to display correctly.

mikejiang commented 4 years ago

You are right, The entire expression should be enclosed by single pair of back ticks. i.e. booleanFilter(`CD15 FITC-CD45 PE+|CD15 FITC+CD45 PE-`) I fixed the doc.

DillonHammill commented 4 years ago

Thanks @mikejiang.