-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimulate.Rd
114 lines (88 loc) · 4.58 KB
/
simulate.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simulate.R
\docType{methods}
\name{simulate}
\alias{simulate}
\alias{simulate,Compound-method}
\alias{simulate,DRE-method}
\alias{simulate,SynergyScreen-method}
\title{Simulate an object.}
\usage{
simulate(object, ...)
\S4method{simulate}{Compound}(object, log.ic50.cv = 1, m.range = c(0.5,
2.5), replace = F)
\S4method{simulate}{DRE}(object, compound, control.response = 1,
log.ic50.cv = 1, m.range = c(0.5, 2.5), rel.resp.noise = 0.1,
replace = F)
\S4method{simulate}{SynergyScreen}(object, control.response = 1,
plate.bias.sd = 0.2, blank.response = 0.05, rel.resp.noise = 0.1,
log.ic50.cv = 1, m.range = c(0.5, 2.5), digits = 3, replace = F)
}
\arguments{
\item{object}{object of a supported class, e.g. Compound, DRE or SynergyScreen}
\item{...}{method-specific arguments: see below}
\item{log.ic50.cv}{coefficient of variation, i.e sd/mean, of the distribution that log(IC50) is selected from, numeric}
\item{m.range}{the range of values to select m from, numeric vector of length 2}
\item{replace}{replace pre-existing values of @ic50 and @m? logic}
\item{compound}{list of Compound objects (DRE method)}
\item{control.response}{"true" response value (e.g. OD) of untreated control, numeric}
\item{rel.resp.noise}{average relative noise of the response variable, i.e. mean(random.error/response)}
\item{plate.bias.sd}{standard deviation of plate bias values, see Details, numeric}
\item{blank.response}{average response value of blank wells, numeric}
\item{digits}{number of decimal places in dose values (SynergyScreen method)}
}
\value{
object of the same class as the input object
}
\description{
Depending on the input object, randomly set ic50 and m parameters of median effect equations and simulate dose-response data
for a single experiment or an entire screen
}
\details{
ic50 and m are parameters of the median effect equations for compounds and mixtures. They are simulated as follows:
\enumerate{
\item log(ic50) of a compound is chosen from a normal distribution centered around
0.5*(log(compound@min.dose) + log(compound@max.dose))
with coefficient of variation specified by parameter log.ic50.cv
\item IC50 of a mixture is chosen from a log-normal distribution centered around 1/(sum(fraction[i]/compound[i]@ic50))
with coefficient of variation specified by parameter log.ic50.cv
\item m is chosen from a uniform distribution between m.range[1] and m.range[2]
}
If Compound object(s) in the input already have their @ic50 and @m slots populated and \code{replace} is set to FALSE, the pre-existing
values are retained.
For dose-response experiments, represented by DRE objects, response at each dose is chosen from a normal distribution with mean
determined by the median response equation, i.e. expected.response = control.response / ((dose/ic50)^m + 1),
and standard.deviation = expected.response*rel.resp.noise
In a multi-plate screen, plate bias is multiplicative. All wells that contain cell cultures are multiplied by a bias value.
The bias values are chosen from a normal distribution with the mean of 1 and standard deviation of plate.bias.sd
}
\section{Methods (by class)}{
\itemize{
\item \code{Compound}: Simulate Compound dose-response characteristics
Randomly set ic50 and m parameter of the median effect equation for compound object
\item \code{DRE}: Simulate DRE data
Simulate dose-response experiment data based on the median effect equation with randomly set parameters IC50 and m
\item \code{SynergyScreen}: Simulate a synergy screening experiment
Simulate an entire screen, including plate biases, control wells, median effect equation parameters for compounds
and mixtures, and dose-response experiment data
}}
\examples{
# Load a set of compounds, initialize a SynergyScreen object, and generate a design
cpds3 = readCompoundFile(system.file("extdata/15_cpds_simulation/compounds_3.csv",
package="SynergyScreen"))
screen3 = new("SynergyScreen",compound_list=cpds3)
screen3 = generateDesign(screen3)
# Simulate dose-response characteristics of compounds, mixtures and dose-response data
screen3_sim = simulate(screen3)
# Simulation sets ic50 and m
compound(screen3,"Cpd1")
compound(screen3_sim,"Cpd1")
true.ic50(dre(screen3,"Cpd1"))
true.ic50(dre(screen3_sim,"Cpd1"))
# Simulation sets response values
response(dre(screen3,"Cpd1"))
response(dre(screen3_sim,"Cpd1"))
}
\seealso{
\linkS4class{SynergyScreen}, \linkS4class{Compound}, \linkS4class{DRE}
}