rRec: Calculate the mean recovery rate (Pacioni et al 2017) and...

Description Usage Arguments Details Value References Examples

View source: R/rRec.R

Description

rRec calculates the mean and standard deviation growth rate between the time yr0 and yrt, which was defined as 'recovery rate' by Pacioni et al (in press). The function then calculates the strictly standardised mean difference (SSMD, Zhang 2007) for each scenario, and each population contained in the data. rRec uses this statistic to compare each scenario (providing associated p-values) with a baseline scenario.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
rRec(
  data,
  project,
  scenario,
  ST = FALSE,
  runs,
  yr0 = 1,
  yrt,
  save2disk = TRUE,
  dir_out = "DataAnalysis/rRec"
)

Arguments

data

A data.frame generated by collate_dat

project

The Vortex project name

scenario

The ST Vortex scenario name or the scenario that should be used as baseline if simulations were not conducted with the ST module

ST

Whether files are from sensitivity analysis (TRUE), or not (FALSE, default)

runs

The number of Vortex simulation runs

yr0

The time window to be considered (first and last year respectively)

yrt

The time window to be considered (first and last year respectively)

save2disk

Whether to save the output to disk, default: TRUE

dir_out

The local path to store the output. Default: DataAnalysis/Pairwise

Details

The means and standard deviations are calculated as: **check how to insert formula in Roxy tags** rRec = sigma(Ni*Mi) / sigma(Ni) (N1*M1+N2*M2+N3*M3)/(N1+N2+N3) SD =N1*S1+N2*S2+N3*S3/(N1+N2+N3)

Where M is the mean growth rate in each year, N is the sample size (number of simulation runs) and S is the standard deviation.

The baseline scenario is selected with the argument scenario. However, if the simulations were part of a sensitivity testing (as indicated by ST) then the baseline scenario is selected using the scenario with the suffix '(Base)'.

Value

A table (data.table) with the mean rRec and its SD, the SSMD and its associated p-value for each scenario and population

References

Zhang, X. D. 2007. A pair of new statistical parameters for quality control in RNA interference high-throughput screening assays. Genomics 89:552-561.

Pacioni, C., and Mayer, F. (2017). vortexR: an R package for post Vortex simulation analysis.

Examples

1
2
3
4
5
# Using Pacioni et al. example data. See ?pac.clas for more details.
data(pac.clas)
recov <- rRec(pac.clas, project='Pacioni_et_al', scenario='ST_Classic',
              ST=TRUE, runs=3, yr0=1, yrt=120, save2disk=FALSE,
              dir_out='DataAnalysis/rRec')

vortexR documentation built on April 14, 2020, 7:23 p.m.