# NOT RUN {
# THE CODE IN THIS EXAMPLE IS THE SAME AS THAT USED IN THE TUTORIAL, AND
# THUS YOU NEED TO DOWNLOAD THE TUTORIAL DATA SET AND SET FILEPATH
# CORRECTLY TO RUN THIS
##---Firstly,declare the parameters required for the functions--
# Folder containing the simulation results, or CSV files
FILEPATH<-"/home/user/Downloads/eFAST/"
# Number of resample curves employed when the parameter space was
# sampled
NUMCURVES<-3
# Array of the parameters to be analysed
PARAMETERS <- c("BindProbability","ChemoThreshold",
"ChemoUpperLinearAdjust","ChemoLowerLinearAdjust",
"VCAMProbabilityThreshold","VCAMSlope","Dummy")
# The number of parameter value sets created in latin-hypercube
# sampling
NUMSAMPLES<-65
# Number of runs performed for each parameter value set
NUMRUNSPERSAMPLE<-300
# The simulation output measures being examined
MEASURES<-c("Velocity","Displacement")
# The output file containing the simulation results from that
# simulation run
RESULTFILENAME<-"trackedCells_Close.csv"
# Not used in this case, but this is useful in cases where two
# result files may exist (for example if tracking cells close
# to an area, and those further away two output files could be used).
# Here, results in a second file are processed if the first is blank
# or does not exist.
ALTERNATIVEFILENAME<-NULL
# Used with CSV result file formats
# The column within the csv results file where the results start.
# This is useful as it restricts what is read in to R, getting round
# potential errors where the first column contains an agent label
# (as R does not read in CSV files where the first column contains
# duplicates)
OUTPUTCOLSTART<-10
# Used with CSV result file formats
# Last column of the output measure results
OUTPUTCOLEND<-11
# Name of the final result file for this analysis, showing the
# partitioning of the variance between input parameters
EFASTRESULTFILENAME<-"eFAST_Analysis.csv"
# Which of the output measures to T-Test for significance (if not all)
OUTPUTMEASURES_TO_TTEST<-1:2
# T-Test confidence level
TTEST_CONF_INT<-0.95
# Boolean to note whether summary graphs should be produced
GRAPH_FLAG<-TRUE
# Timepoints being analysed. Must be NULL if no timepoints being
# analysed, or else be an array of timepoints. Scale sets the
# measure of these timepoints
#TIMEPOINTS<-NULL; TIMEPOINTSCALE<-NULL
# Example Timepoints:
TIMEPOINTS<-c(12,36,48,60); TIMEPOINTSCALE<-"Hours"
# }
# NOT RUN {
# DONTRUN IS SET SO THIS IS NOT EXECUTED WHEN PACKAGE IS COMPILED - BUT THIS
# HAS BEEN TESTED WITH THE TUTORIAL DATA
library(spartan)
# Import the graphing package
library(gplots)
##--- NOW RUN THE FOUR METHODS IN THIS ORDER ----
# FIRSTLY, WHERE MULTIPLE RUNS ARE PERFORMED,
# MEDIAN DISTRIBUTIONS NEED TO BE GAINED FOR EVERY RUN
efast_generate_medians_for_all_parameter_subsets(FILEPATH,
NUMCURVES,PARAMETERS,NUMSAMPLES,NUMRUNSPERSAMPLE,MEASURES,
RESULTFILENAME,ALTERNATIVEFILENAME,OUTPUTCOLSTART,
OUTPUTCOLEND,TIMEPOINTS,TIMEPOINTSCALE)
# NOW NEED TO CREATE THE OUTPUT FILE THAT THE EFAST ANALYSIS SCRIPTS
# USE - A FILE SHOWING THE OVERALL MEDIAN RESULTS FOR EACH THE RUNS
# PERFORMED FOR EVERY PARAMETER OF INTEREST, FOR THAT CURVE.
# ONE FILE IS CREATED PER CURVE
efast_get_overall_medians(FILEPATH,NUMCURVES,PARAMETERS,NUMSAMPLES,
MEASURES,TIMEPOINTS,TIMEPOINTSCALE)
# NOW THESE ALLCURVE.CSV FILES HAVE BEEN GENERATED, FULL ANALYSIS
# CAN BEGIN
efast_run_Analysis(FILEPATH,MEASURES,PARAMETERS,NUMCURVES,
NUMSAMPLES,OUTPUTMEASURES_TO_TTEST,TTEST_CONF_INT,
GRAPH_FLAG,EFASTRESULTFILENAME,
TIMEPOINTS,TIMEPOINTSCALE)
# IF ANALYSING A SIMULATION AT SET TIMEPOINTS, YOU CAN PLOT THE Si
# MEASURE OVER TIME
ploteFASTSiFromTimepointFiles(FILEPATH,PARAMETERS,MEASURES,
EFASTRESULTFILENAME,TIMEPOINTS,TIMEPOINTSCALE)
# }
Run the code above in your browser using DataLab