Although any R function can be run by FCS Express via the R integration tool, the user should consider the following specifications for creating the R script containing the function of interest:
1. The user's functions need to be included in a general function named Execute and defined as follow:
Execute <- function(mat) { }
2. The input of the Execute function, mat, is a matrix of fluorescence values. FCS Express allows the user to select which parameters and which events will be included the matrix, as well as the matrix orientation, thus to keep events in rows and parameter in columns (Figure 29.42, on the left) or vice-versa (Figure below, on the right).
Please note that the name of the parameters included in the mat matrix will be accessible in R by using the rownames() or the colnames() functions (when parameter are in rows and in columns respectively).
Figure 29.42. The mat matrix used as input by the Execute function.
3. The aim of the above-mentioned Execute function is to place the user defined data and meta data together in an S4 object suitable to be used by FCS Express.
4. The output of the Execute function is an S4 object containing the user defined data and the metadata. The output represents the new input for FCS Express.
The workflow of how R integration works in FCS Express is given in the figure below (Figure 29.43).
Figure 29.43. Simplified schematic of R integration with FCS Express.
FCS Express currently supports two types of S4 objects as input:
1.R Add Parameter - The method is suitable for adding new columns to the mat matrix. Columns must contain numeric values and can be named.
2.R Cluster Transformation -The method is suitable for cluster based analysis. A column containing the cluster membership of each event is added and clusters may be labeled.
Both input methods can be accessed by selecting the Tools tab→Transformations →Transformations command to launch the Transformations navigator. Clicking on the drop down arrow adjacent to the blue plus button (Figure 29.44) will reveal the R Add parameters and R Cluster Transformation modules described above and presented in further detail in the next sections:
Jump to:
Figure 29.44. Selecting the input method for R integration scripts.