Custom Token Example 4: Conditional Statements

This example demonstrates using conditional IF..THEN..ELSE statements in a Custom Token formula.

 

1. Insert a plot and a text box on a layout page. Create a gate around your cells of interest.

2. Open the Custom Token window and dock it.

3. Click on NewAdd (Add) in the docked Custom Token window.

4. Edit New Custom Token to read "Conditional Statement".

5. In the Formula field enter: =IF <space>

6. Choose the Data Source of the token by either of the following methods:

right-click in the Formula area (lower pane of Custom Tokens window) and choose Insert Token from the pop-up menu, and double-click Statistic.  Choose the plot from Step 1 from the Data Source category

drag and drop the plot from Step 1 from your layout page into the lower pane of the Custom Tokens window, and double-click Statistic token.

7. From the Statistic category, select the gate that you created in Step 1 from the drop-down list in the Select Gate field. Highlight # of Events as the statistic. Click OK.

8. Type the following in the formula area: >2000 THEN "There are a lot of cells." ELSE "There are very few cells". The Formula field should resemble Figure 12.59.

 

 

Figure 12.59  Custom Token Example 4 Formula

Figure 12.59  Custom Token Example 4 Formula

 

 

9.  Insert the Custom Token you have just created into the Text Box by either of the following methods:

right-click on the Text Box, choose Insert Token from the pop-up menu, select Conditional Statement from Custom (clicking on the triangle next to Custom to expand the list, necessary), and click the Insert button, or

drag and drop Conditional Statement from the Custom Token List (upper pane of the Custom Tokens window) to an empty spot on your layout or to an existing Text Box.

 

The token will display There are a lot of cells. if the number of events in the Plot #2 is greater than 2000 and There are very few cells. if the number of events is less than or equal to 2000. If you move the gate, the Custom Token formula is recalculated. Therefore, the token will display a different result if the number of events within the gate changes from less than 2000 to greater than 2000 (or vice versa).