Defining a tSNE transformation

tSNE transformations are performed in FCS Express through the Transformations navigator.

The steps below outline the process of creating a new tSNE transformation for your data:

 

1. Open the Transformation window by selecting the Tools tab → Transformations → Transformations command (Figure 9.143, Step 1). The Transformations window will open as in the figure below.

2. Click on the drop down arrow adjacent to the blue plus greenplus button (Figure below, Step 2).

 

3. Click on tSNE in the drop down list  (Figure below, Step 3).

 

Figure 9.137 Initial steps to create a tSNE transformation.

Figure 9.137 Initial steps to create a tSNE transformation.

 

 

The tSNE dialog will now appear in the Transformation window as seen in Figure 9.144.

Figure 9.138 - The tSNE dialog opens when a new tSNE transformation is created.

Figure 9.138 - The tSNE dialog opens when a new tSNE transformation is created.

 

 

The new tSNE transformation is named as New tSNE by default but it can be easily renamed by either of the following methods:

Right click on the tSNE transformation that needs to be renamedSelect Rename.

Select the tSNE transformation that need to be renamed via left click and press F2 on your keyboard.

Select the tSNE transformation that need to be renamed via left click and click on the NewRename button in the Transformations tool bar.

 

4. Choose a Template File for the tSNE transformation by clicking on the ellipsis to the right of the Template File text box.  

Note: if you wish to define the tSNE transformation on your entire data set rather than an individual data file, you can use a merged data file with a File Identifier Column as the Template File.  The transformation can then be applied to the merged data file, and events therein can be related back to the original data files with the File Identifier Column.  

 

The tSNE dialog will be populated with a list of available parameters to perform a tSNE transformation based on available parameters from the template file (Figure 9.145).

 

Figure 9.139 When a template file is selected, the possible parameters to perform a tSNE transformation are automatically listed in the tSNE dialog.

Figure 9.139 When a template file is selected, the possible parameters to perform a tSNE transformation are automatically listed in the tSNE dialog.

 

 

5.Choose the parameters to be used in the tSNE transformation by checking the boxes next to the parameter names (Figure 9.146 below, Point 1). Parameters can be filtered or sorted to assist in the selection of parameters when multiple parameters are available in the template file. By right clicking in the parameters section, you can use Sort Ascending, Sort Descending, or Unsorted to easily manage parameter ordering and facilitate parameter selection.  In the right click menu, you can easily select parameters by utilizing Check All, Uncheck All, Check Selected, Uncheck Selected, Invert Selection on All. The options Check Selected and Uncheck Selected allow for using the shift key or Ctrl key to multi-select parameters and check or uncheck them all simultaneously.

 

 

6. Select or change to the appropriate Parameter Scaling Options for each of the selected parameters if required (a scale of interest can be applied to All or Checked parameters) (Figure below, Point 2).

 

Options can now be set to customize the transformation.

 

Options

Description

Gate

Allows the user to run tSNE only on the events within a specific gate.

Transformed Data Options

The Display Name Suffix for a transformation can be customized by the user by entering information into the adjacent text box. This modifies what is displayed on a plot when a transformation is applied.

Sampling Options

tSNE can be performed on a subsample of the data with the rest of the data subsequently mapped to the transformed subsampled data after the initial run (see the Estimate tSNE for Unsampled Events option).

Although multiple Sampling Methods are available (please refer to the Sampling Options chapter for more details), the default setting for a tSNE transformation are:

 

Downsampling Algorithm. Default setting is Interval.

 

Sample Size. This parameter indicates how many cells to subsample and perform tSNE on. If the specified Sample Size is higher than the number of available events, tSNE will be run on all available events. Note that the number of available events is dictated by the Gate option. In FCS Express, the default Sample Size is 100.

tSNE Method to Use

Allows the user to set the method to use for running tSNE. Possible choices are Exact tSNE and Barnes-Hut Approximation. The Exact tSNE is the original implementation of the algorithm and is only practical for sample sizes less than 5000 due to speed and memory constraints of this approach. The Barnes-Hut method gives an approximate result of tSNE and is faster than the exact tSNE for larger data sets but there will be little difference in calculation times for smaller data sets. The amount of approximation for the Barnes-Hut method can be specified in the Amount of Approximation (Applies only to Barnes-Hut) field (see next option).

In FCS Express, the default Method for tSNE is the Barnes-Hut Approximation.

Amount of Approximation (Applies Only to Barnes-Hut)

Allow the user to set the Amount of Approximation for the Barnes-Hut method. The Amount of Approximation is a trade-off between speed and accuracy of the approximation. The value ranges from 0 to 1, where higher values indicate a faster computation time but a less accurate approximation and lower values results in a slower computation time but a more accurate approximation. If the approximation value is less than 0.2, the exact tSNE method may be used as well as the Barnes Hut approximation may be slower than the exact tSNE method.

In FCS Express, the default Amount of Approximation is 0.50.

Perplexity

Perplexity is a measure for information. In tSNE, the perplexity is used to sets the number of nearest neighbors considered.

In tSNE, typical values for the perplexity range between 5 and 50.

In FCS Express, the default value for Perplexity is 30.

Number of Iterations

tSNE in an iterative process. This option allows you to set the number of iteration that will be performed by the algorithm.

In FCS Express, the default Number of Iterations is 500.

Use Opt-SNE

Opt-SNE is a variation of the original tSNE algorithm that take advantage from optimized hard-coded settings to improve the final tSNE mapping. Please refer to the tSNE (viSNE) page of the manual for the refernce to the original article.

Estimate tSNE for Unsampled Events

This option determines whether events that did not participate in the tSNE calculation (if you chose less than the total number of events in the Sample Size option) will be mapped to the nearest point that did participate in the tSNE mapping. If this option is unselected, events that did not participate in the tSNE calculation will be have undefined values in the resulting tSNE parameters and will not be plotted, participate in statistical calculations of the tSNE parameters or able to be gated based on the tSNE parameters.

In FCS Express, tSNE is Estimated by default for Unsampled Events.

Change Random Seed

The Random Seed is a number which is used by the random number generator to generate the N random values which are used as input data points for the tSNE calculation. The random number generator will use the Random Seed value and perform a series of math operations on it which result in N random values. 

Since tSNE is a stochastic algorithm, a seed can be set to make results reproducible over the time when tSNE is applied to the same data. Alternatively, the seed can be changed when a different tSNE map is desired. The seed can be changed by either clicking on the Change Random Seed button or by manually inserting a seed in the field.

In FCS Express, the default Random Seed is 6.

Automatically Calculate tSNE

By default tSNE transformation is recalculated as soon as an option in the tSNE dialog is changed. Given that tSNE is an highly demanding algorithm that can take several seconds to be calculate, FCS Express allows the user to disable the automatic calculation of tSNE and to manually calculate tSNE only when required. To defer calculating the tSNE algorithm, uncheck the box for Automatically Calculate tSNE. Doing so will present you with the button to Calculate tSNE  which can be pressed to calculate tSNE on demand.

Please note that this option only regulates the auto update upon changes made within the tSNE dialog. If tSNE is calculated on a gate and that gate is moved or re-sized, tSNE will be automatically recalculated regardless this option. If you want to avoid tSNE auto update upon gate moving/resizing, please refer to the Live Updating Gate chapter of this manual.

 

 

7.(Optional) Select a gate from the Gate drop down menu to only run tSNE transformation on the events within that gate (Figure below, Point 3).

 

8.(Optional) Modify the Display Name Suffix by entering information in the adjacent text box (Figure below, Point 4).

 

9.(Optional) Select a Downsampling Algorithm (Figure below, Point 5). Although multiple Sampling Methods are available (please refer to the Sampling Options chapter for more details), the default Downsampling Algorithm for a tSNE transformation is Interval.

 

10. Enter a value in the Sample Size field by typing the number of events on which tSNE will be performed (Figure below, Point 6).

 

11. Select which method to use for tSNE transformation. Exact tSNE or the Barnes-Hut Approximation (Figure below, Point 7).

 

12. If the Barnes-Hut approach is selected, set the Amount of Approximation for the Barnes-Hut method in the Amount of Approximation (Applies only to Barnes-Hut) field (Figure below, Point 8).

 

13.(Optional) Change the Perplexity by manually inserting a value in the field (Figure below, Point 9).

 

14.(Optional) Change the Number of Iterations that will be performed by manually inserting a value in the field (Figure below, Point 10).

 

15. (Optional) Select whether to use the Opt-SNE settings (Figure below, Point 11).

 

16.(Optional) Select whether to Estimate tSNE for Unsampled events (Figure below, Point 12).

 

17. (Optional) Change the random seed used for tSNE calculation by either clicking on the Change Random Seed button or by manually inserting a seed in the field (Figure below, Point 13).

 

 

Figure 9.140 Steps to complete the tSNE dialog.

Figure 9.140 Steps to complete the tSNE dialog.

 

 

The tSNE transformation has now been defined and will be automatically calculated as soon as it will be applied to a plot. In addition, tSNE transformation will be automatically recalculated as soon as an option in the tSNE dialog will be modified.

 

Given that tSNE is an highly demanding algorithm that can take several seconds to be calculate, FCS Express allows the user to disable the automatic calculation of tSNE upon options changing and to manually calculate tSNE only when required. To defer calculating the tSNE algorithm, uncheck the box for Automatically Calculate tSNE. Doing so will present you with the button to Calculate tSNE (Figure 9.147) which can be pressed to calculate on demand.

Please note that this option only regulates the auto update of tSNE upon changes made within the tSNE dialog. If tSNE is calculated on a gate and that gate is moved or re-sized, tSNE will be automatically recalculated regardless this option. If you want to avoid tSNE auto update upon gate moving/resizing, please refer to the Live Updating Gate chapter of this manual.

Figure 9.141 Unchecking the Automatically Calculate tSNE box will allow the user to calculate tSNE manually only when required.

Figure 9.141 Unchecking the Automatically Calculate tSNE box will allow the user to calculate tSNE manually only when required.

 

 

 

The tSNE transformation can now be applied to any plot in FCS Express and the new tSNE X and tSNE Y parameters chosen from the list of available parameters (Figure 9.148 below). Please also see the Applying a tSNE Transformation section for additional details on applying tSNE mapped transformations to plots.

Figure 9.142 tSNE parameters can be accessed as standard parameters.

Figure 9.142 tSNE parameters can be accessed as standard parameters.