Tokens can also be customized to create any kind of statistic that you like. In this example, we will calculate the Apo(+)/Apo(-) ratio in the positive sample file ApoMono.002. This is calculated by taking the % of positive cells and dividing them by the % of negative cells.

To insert a Custom Token:

1.Select File tab→Open.

2.Open the layout TokenCustom.fey found in the Tutorial Sample Data archive.

The layout, shown in Figure T5.42, contains two 2D plots a text box containing the text "Apo(+)/Apo(-) ratio: ." We will insert a custom token statistic here (Figure T5.42).

Figure T5.42  Custom Token Layout (TokenCustom.fey)

Figure T5.42  Custom Token Layout (TokenCustom.fey)

3.Click in the text box at the end of the incomplete phrase "Apo(+)/Apo(-) Ratio: ."

4.Select the View tab→Tokens group→Custom Tokens command CustomTokensRibbon.

 

The Custom Tokens window should now appear (Figure T5.44).

5.Right-click inside the upper half of the Custom Tokens window and select New Custom Token from the pop-up menu (Figure T5.44). Alternatively, click on the NewAdd button within the Custom Tokens window.

Figure T5.44  Creating a New Custom Token

Figure T5.44  Creating a New Custom Token

7.Type Apo(+)/Apo(-) Ratio into the Name field of the New Custom Token (Figure T5.45).

8.Press Enter to accept the new name.

9.The Custom Token "Apo(+)/Apo(-) Ratio" should now be highlighted in blue (Figure T5.45).

Figure T5.45  Custom Tokens Dialog

Figure T5.45  Custom Tokens Dialog

To calculate the ratio for this example, we will take the number of events in the positive population (upper right quadrant) and divide it by the number of events in the negative population (lower quadrants).

9.Left-click in the lower half of the Custom Tokens window and enter an equals sign "=" (Figure T5.46).

10. Right-click immediately after the "=" sign to bring up the associated pop up menu.

11. Select Insert Token from the pop up menu (Figure T5.46).

Figure T5.46  Entering a Custom Token Formula

Figure T5.46  Entering a Custom Token Formula

An Insert a Token dialog will appear as in Figure T5.24.

12. Click on Statistic.

13. Click on Insert.

A Create Statistic dialog will appear with the Data Source Category open as in Figure T5.38.

14. Select 10 - Density - ApoMono.002 (FL1-H vs. FL2-H) as the data source.

15. Click the Statistic Category (on the left).

The Statistic Category of the Create Statistic Window will appear as in Figure T5.38. We will now select the statistic that will define the numerator of our custom token.

16. Select Upper Right in the Select a quadrant drop-down list (Figure T5.38).

17. Select Whole Cells in the Gate: drop-down list (Figure T5.38).

18.Select % of Gated Cells from the Statistic: list box (Figure T5.38).

19. Press OK.

The Custom Tokens Editor  (Figure T5.47) will show the statistic in the formula field highlighted in light blue. This is the numerator for our custom token. We will now define the operator and the denominator of our custom token.

20. Enter the division symbol "/" immediately following the statistic we inserted in the last steps (Figure T5.47).

21. Right-click after the "/" symbol to bring up the pop-up menu.

22. Select Insert Token from the pop-up menu (Figure T5.47).  

Figure T5.47  Inserting Statistic for Numerator of Ratio in Custom Tokens 

Figure T5.47  Inserting Statistic for Numerator of Ratio in Custom Tokens 

The Insert a Token dialog box will appear (Figure T5.24).

23.Click Statistic

24.Click Insert

A Create Statistic window will appear with the Data Source Category open . We will now define the denominator of our custom statistic token.

25. Select 10 - Density - ApoMono.002 (FL1-H vs. FL2-H) as the data source .

26. Click on the Statistic Category (Figure T5.37).

The Statistic Category of the Create Statistic Window will appear as in Figure T5.37. We now will select the statistic that will define the denominator of our custom token.

27. Select Lower in the Select a quadrant drop-down list (Figure T5.48).

28. Select % of Gated Cells from the Statistic: list box (Figure T5.48).

29. Select Whole Cells in the Gate: drop-down list (Figure T5.48).

30. Press OK.

Figure T5.48  Defining the Denominator for the Custom Token

Figure T5.48  Defining the Denominator for the Custom Token

--

Note: the order the gates are displayed in the dialog was changed in version 7.20 onwards. Now, all shown gates (i.e. those whose outline is displayed on the plot of interest) are set to be on top of the list.

--

30. Click OK.

The Custom Tokens window (Figure T5.49) will show the upper right quadrant statistic divided by the lower quadrants statistics in the formula field. The tokens are highlighted in blue to indicate that they are being treated as numbers rather than text.

 

Figure T5.49  Final Custom Token Formula

Figure T5.49  Final Custom Token Formula

Now that we have created the custom token for the ratio, we must insert it into the text box.

31. Position the cursor to the end of the text "Apo(+)/Apo(-) Ratio: " within the text box (Figure below).

Tutorial_token_insertion

32. Select the previously hidden Text tab→Insert Text group→Insert Token command from the ribbon (Figure T5.50).

Tip: Alternatively, right-click after the "Apo(+)/Apo(-) Ratio: " text to bring up the pop up menu and select Insert Token.

Figure T5.50  Inserting Token from Text Tab on Ribbon

Figure T5.50  Inserting Token from Text Tab on Ribbon

 

The Insert a Token dialog will appear with the new custom token Apo(+)/Apo(-) Ratio:  listed (Figure T5.51).

33. Click Apo(+)/Apo(-) Ratio under Custom to select it as the token to be inserted.

34. Click Insert to insert the token into the text box.

Figure T5.51  Selecting the Custom Token 

Figure T5.51  Selecting the Custom Token

The Apo(+)/Apo(-) Ratio: value of "3.67" will appear highlighted in grey in the text box (Figure T5.52).

 

Figure T5.52  Displaying the Custom Token in the Text Box

Figure T5.52  Displaying the Custom Token in the Text Box

 

We will now delete the Custom Token and then insert it by dragging it from the Custom Tokens window.

 

35. Select the custom token we inserted after the "Apo(+)/Apo(-) Ratio:" text (you can easily recognize it since it is grey highlighted) (Figure T5.53).

36. Press the Delete on you keyboard to remove the custom token.

 

The Custom Tokens window should still be on the layout as shown in Figure T5.53.

 

37. Click and hold the left mouse button down on the Apo(+)/Apo(-) Ratio custom token highlighted in blue in the Custom Tokens window (Figure T5.54).

38. Drag the mouse, while holding the left mouse button down, to the spot after the Apo(+)/Apo(-) Ratio: text in the text box on the layout page.

 

Figure T5.53  Dragging Custom Token onto Text Box  

Figure T5.53  Dragging Custom Token onto Text Box

39. Release the mouse button to drop the custom token into the text box.  

 

The custom token is now reinserted in the text box as shown in Figure T5.54.

 

Figure T5.54  Reinserted Custom Token

Figure T5.54  Reinserted Custom Token