I've compiled this as a primer to FJML keywords for those who prefer to learn by example. To use these examples, first open your Mac FlowJo to a new workspace with some data, then click Workspace menu, Add Keyword. Once you have created this new keyword, you can double-click its cell in the workspace window, just like in Excel, and enter formulas. Here are some to try (using LMD data made by CXP software.)
|
This syntax..
|
..renders as:
|
notes
|
|
FJML=<>
|
<> |
anything to the right of equals that is not valid FJML is rendered as text. |
|
FJML=<key $SYS> |
CXP |
assuming $SYS = CXP |
|
FJML=File Made By: <key $SYS> |
File Made By: CXP |
assuming $SYS = CXP |
|
FJML=<stat /gate1:Freq. of parent>
|
80.1 |
assuming there is a gate called “gate1” with a stat 80.1 % :) |
|
FJML=<key $P2B> * 2
|
16 * 2 |
assuming Parameter2 exists and its B=16. Notice the failed attempt to invoke a math formula gets parsed as a text string. |
|
FJML={{<key $P2B> * 2}}
|
32 |
the presence of {{ }} brackets around the expression forces FJ to evaluate the contents as a formula. |
|
FJML={{sub(<key $CYT>, 1, 3)}}
|
Interpreter Error. |
assumes $CYT = Cytomics FC 500. Fails to parse as shown, see below for corrected example. |
|
FJML={{sub(“<key $CYT>”, 1, 3)}}
|
Cyt |
notice the quotes around the keyword! |
finally here's a harder one: convert BTIM/ETIM keywords' values (HH:MM:SS) into number of seconds the acquisition took. Since this expression is longer, I'll do it outside the table, split into the components of extracting the hours, days and seconds separately. This code does not take into account the clock resetting/starting over every 24 hrs ;)
to calculate hours in a day and convert to seconds:
3600* abs(num(sub("<key $BTIM>", 1, 2)) - num(sub("<key $eTIM>", 1, 2)))
60* abs(num(sub("<key $BTIM>", 4, 5)) - num(sub("<key $eTIM>", 4, 5)))
abs(num(sub("<key $BTIM>", 7, 8)) - num(sub("<key $eTIM>", 7, 8)))
FJML={{3600* abs(num(sub("<key $BTIM>", 1, 2)) - num(sub("<key $eTIM>", 1, 2))) +60* abs(num(sub("<key $BTIM>", 4, 5)) - num(sub("<key $eTIM>", 4, 5))) +abs(num(sub("<key $BTIM>", 7, 8)) - num(sub("<key $eTIM>", 7, 8)))}}
Comments