CellexalVR  1.1.0
A virtual reality platform for the exploration and analysis of single-cell gene expression data
CellexalVR.AnalysisLogic.RScriptRunner Class Reference

This class runs R code from a file using the console or runs a command via an R server session. More...

Static Public Member Functions

static void SetReferenceManager (ReferenceManager rm)
 
static void SetRScriptPath (string path)
 
static string RunFromCmd (string rCodeFilePath, string args, bool writeOut)
 Runs an R script from a file using Rscript.exe. Example: RScriptRunner.RunFromCmd(curDirectory + "\ImageClustering.r", curDirectory.Replace('\','/')); Getting args passed from C# using R: args = commandArgs(trailingOnly = TRUE) print(args[1]); More...
 
static void WriteToServer (string s)
 Run R code on a running r server session instead of starting a new process and loading the object again. Send it to the server by writing the command to run into the "<servername>.input.R". The R backend will read this file once every second and run the commands inside it via "source(input.R)". More...
 
static string RunRScript (string path, string args="")
 Runs an R script. More...
 

Static Public Attributes

static ReferenceManager referenceManager
 
static ArrayList geneResult = new ArrayList()
 
static bool serverIdle = true
 

Detailed Description

This class runs R code from a file using the console or runs a command via an R server session.

Member Function Documentation

◆ RunFromCmd()

static string CellexalVR.AnalysisLogic.RScriptRunner.RunFromCmd ( string  rCodeFilePath,
string  args,
bool  writeOut 
)
static

Runs an R script from a file using Rscript.exe. Example: RScriptRunner.RunFromCmd(curDirectory + "\ImageClustering.r", curDirectory.Replace('\','/')); Getting args passed from C# using R: args = commandArgs(trailingOnly = TRUE) print(args[1]);

Parameters
rCodeFilePathFile where your R code is located.
argsMultiple R args can be seperated by spaces.
writeOutIf the stdout and stderror should be appended to the R log.
Returns
Returns a string with the R responses.

◆ RunRScript()

static string CellexalVR.AnalysisLogic.RScriptRunner.RunRScript ( string  path,
string  args = "" 
)
static

Runs an R script.

Parameters
pathThe path to the R script.
argsThe arguments, seperated by spaces.
Returns
The result from the R process.

◆ WriteToServer()

static void CellexalVR.AnalysisLogic.RScriptRunner.WriteToServer ( string  s)
static

Run R code on a running r server session instead of starting a new process and loading the object again. Send it to the server by writing the command to run into the "<servername>.input.R". The R backend will read this file once every second and run the commands inside it via "source(input.R)".

Parameters
ss is the full string to be written into the input.R file which the server will then read.
isFileIf the s argument instead is a filePath the function copies that entire file to input.R

The documentation for this class was generated from the following file: