Installing R packages on the MAC version of FCS Express

MAC users running FCS Express can install R packages by running one of the following two scripts directly within FCS Express via either the R Add Parameters or the R Cluster Transformation module. The scripts download and install the packages of interest and create a text log report. The log report can be used to check that the installation worked properly and that the packages of interest can be loaded. The name of the log report file will be in the form "FCSExpress installation report YYYY-MM-DD.txt", where YYYY-MM-DD is the current date. The output directory can be defined by the user (see below).

Two scripts are available base on the repository (CRAN or Bioconductor) the package is on. Please, chose the script suitable for you.

 

##Bioconductor Packages Installation for MAC users

Execute <- function(mat)

{

 FCSE7_log_file <- file(paste0("A/FCSExpress installation report ",Sys.Date(),".txt"), open="wt") ##creating the file and opening it for writing

 sink(FCSE7_log_file, type="message") ##diverting R messages to the file

 

 ##Installing the required packages

 source("https://bioconductor.org/biocLite.R")

 biocLite("B",suppressUpdates=TRUE)

 

 ##Checking that the installed package can be properly loaded

 library("B")

 

 sink(type = "message") ## reset sink

 close(FCSE7_log_file) ##close the file

}

 

 

##CRAN Packages Installation for MAC users

Execute <- function(mat)

{

 FCSE7_log_file <- file(paste0("A/FCSExpress installation report ",Sys.Date(),".txt"), open="wt") ##creating the file and opening it for writing

 sink(FCSE7_log_file, type="message") ##diverting R messages to the file

 

 ##Installing the required packages

 install.packages("B")

 

 ##Checking that the installed package can be properly loaded

 library("B")

 

 sink(type = "message") ## reset sink

 close(FCSE7_log_file) ##close the file

}

 

 

Where A and B are defined by the user as follow:

A: is the path where the text log report will be saved (e.g. /Users/YOURNAME/Desktop).

B: is the name of the package that need to be installed.

 

Please do the following before proceeding with the installation:

1. Open a text editor (e.g. TextEdit / NotePad).

2. Copy and past one of the scripts above into a blank page (either the Bioconductor Packages Installation for MAC users or the CRAN Packages Installation for MAC users).

3. Complete the script by inserting A and B.

4. Save the script using ".R" (without quotes) as the file extension.

 

Now that the R script is ready, you can run it in FCS Express via the R Integration tools by following the next steps:

1. Be sure that the R Integration is enabled (if not, please see the Enabling R integration in FCS Express section of this chapter)

2. Open the Transformation window by selecting the Tools tab→Transformations →Transformations command from the ribbon bar.

3. Click on the drop down arrow adjacent to the blue plus NewAdd button.

4. Select either the R Add Parameters or the R Cluster Transformation.

5. Click on the ellipsis at the right of the Template File field to browse for a template *.FCS file. The Transformation window will be populated with the parameters contained in the selected *.FCS file.

6. Select any of the available parameters.

7. Click on the ellipsis at the right of the R Script File field to browse for the R script created few steps ago.

8. Apply the transformation to any plot of your layout. This can be done via either Drag and Drop or via the Formatting dialog.

9. A text log report will be generated in the A location.

 

In order to check that the installed packages can be properly loaded, you can simply open the text log report and check the output messages (if any) generated in response to the library("B") command.

Please, do not hesitate to contact us at support@denovosoftware.com for any question you may have.