| Title: | Analysis of Cell Proliferation Assays |
|---|---|
| Description: | Analysis of cell proliferation assays with a normal-Poisson mixture model. Broman et al. (1996) <doi:10.1016/S0022-1759(96)00136-6>. |
| Authors: | Karl W Broman [aut, cre]
|
| Maintainer: | Karl W Broman <[email protected]> |
| License: | GPL-3 |
| Version: | 0.53-2 |
| Built: | 2026-05-07 06:00:17 UTC |
| Source: | https://github.com/kbroman/npem |
Uses a version of the EM algorithm to fit the normal-Poisson mixture model to data on a cell proliferation assay.
npem.em( y, ests, cells = 10^6, n = c(24, 24, 24, 22), n.plates = 1, use.order.constraint = TRUE, maxit = 2000, tol = 0.000001, maxk = 20, prnt = 0 )npem.em( y, ests, cells = 10^6, n = c(24, 24, 24, 22), n.plates = 1, use.order.constraint = TRUE, maxit = 2000, tol = 0.000001, maxk = 20, prnt = 0 )
y |
Vector of transformed scintillation counts, in lexicographical order (plate by plate and group by group within a plate.) |
ests |
Initial parameter estimates, as a vector of length n.groups +
3*n.plates, of the form ( |
cells |
Number of cells per well. The |
n |
Vector giving the number of wells within each group. This may have length either n.groups (if all plates have the same number of wells per group) or n.groups*n.plates. |
n.plates |
The number of plates in the data. |
use.order.constraint |
If TRUE, force the constraint |
maxit |
Maximum number of EM iterations to perform. |
tol |
Tolerance to determine when to stop the EM algorithm. |
maxk |
Maximum k value in sum calculating E(k | y). |
prnt |
If 0, don't print anything; if 1, print the log likelihood at each iteration; and if 2, print the est's and the log lik. at each iteration. |
Calculations are performed in a C routine. [I should describe the normal-Poisson mixture model here.]
ests |
The estimated parameters in same form as the input
argument |
k |
The estimated number of responding cells per
well, |
ksq |
|
loglik |
The value of
the log likelihood at |
n.iter |
Number of iterations performed. |
Karl W Broman, [email protected]
Broman et al. (1996) Estimation of antigen-responsive T cell
frequencies in PBMC from human subjects. J Immunol Meth 198:119-132
Dempster et al. (1977) Maximum likelihood estimation from incomplete data
via the EM algorithm. J Roy Statist Soc Ser B 39:1-38
npem.sem(), npem.start(),
npsim(), npem.ll()
# get access to an example data set data(p713) # analysis of plate3 # get starting values start.pl3 <- npem.start(p713$counts[[3]],n=p713$n) # get estimates out.pl3 <- npem.em(p713$counts[[3]],start.pl3,n=p713$n) # look at log likelihood at starting and ending points npem.ll(p713$counts[[3]],start.pl3,n=p713$n) npem.ll(p713$counts[[3]],out.pl3$ests,n=p713$n) # repeat with great precision, starting at previous endpoint out.pl3 <- npem.em(p713$counts[[3]],out.pl3$ests, n=p713$n,tol=1e-13) # run SEM algorithm to get standard errors out.sem.pl3 <- npem.sem(p713$counts[[3]],out.pl3,n=p713$n) round(out.pl3$ests,3) round(out.sem.pl3$se,3) # repeat the above for the pair, plates 3 and 4 # get starting values start.pl34 <- npem.start(unlist(p713$counts[3:4]),n=p713$n,n.plates=2) # get estimates out.pl34 <- npem.em(unlist(p713$counts[3:4]),start.pl34,n=p713$n,n.plates=2) # look at log likelihood at starting and ending points npem.ll(unlist(p713$counts[3:4]),start.pl34,n=p713$n,n.plates=2) npem.ll(unlist(p713$counts[3:4]),out.pl34$ests,n=p713$n,n.plates=2) # repeat with great precision, starting at previous endpoint out.pl34 <- npem.em(unlist(p713$counts[3:4]),out.pl34$ests, n=p713$n,tol=1e-13,n.plates=2) # run SEM algorithm to get standard errors out.sem.pl34 <- npem.sem(unlist(p713$counts[3:4]),out.pl34,n=p713$n,n.plates=2) round(out.pl34$ests,3) round(out.sem.pl34$se,3)# get access to an example data set data(p713) # analysis of plate3 # get starting values start.pl3 <- npem.start(p713$counts[[3]],n=p713$n) # get estimates out.pl3 <- npem.em(p713$counts[[3]],start.pl3,n=p713$n) # look at log likelihood at starting and ending points npem.ll(p713$counts[[3]],start.pl3,n=p713$n) npem.ll(p713$counts[[3]],out.pl3$ests,n=p713$n) # repeat with great precision, starting at previous endpoint out.pl3 <- npem.em(p713$counts[[3]],out.pl3$ests, n=p713$n,tol=1e-13) # run SEM algorithm to get standard errors out.sem.pl3 <- npem.sem(p713$counts[[3]],out.pl3,n=p713$n) round(out.pl3$ests,3) round(out.sem.pl3$se,3) # repeat the above for the pair, plates 3 and 4 # get starting values start.pl34 <- npem.start(unlist(p713$counts[3:4]),n=p713$n,n.plates=2) # get estimates out.pl34 <- npem.em(unlist(p713$counts[3:4]),start.pl34,n=p713$n,n.plates=2) # look at log likelihood at starting and ending points npem.ll(unlist(p713$counts[3:4]),start.pl34,n=p713$n,n.plates=2) npem.ll(unlist(p713$counts[3:4]),out.pl34$ests,n=p713$n,n.plates=2) # repeat with great precision, starting at previous endpoint out.pl34 <- npem.em(unlist(p713$counts[3:4]),out.pl34$ests, n=p713$n,tol=1e-13,n.plates=2) # run SEM algorithm to get standard errors out.sem.pl34 <- npem.sem(unlist(p713$counts[3:4]),out.pl34,n=p713$n,n.plates=2) round(out.pl34$ests,3) round(out.sem.pl34$se,3)
Calculates the log likelihood at a single point in the parameter space, for the normal-Poisson mixture model with data on a cell proliferation assay.
npem.ll(y, ests, cells = 10^6, n = c(24, 24, 24, 22), n.plates = 1, maxk = 30)npem.ll(y, ests, cells = 10^6, n = c(24, 24, 24, 22), n.plates = 1, maxk = 30)
y |
Vector of transformed scintillation counts, in lexicographical order (plate by plate and group by group within a plate.) |
ests |
Value of the parameters at which to calculate the log
likelihood, as a vector of length n.groups + 3*n.plates, of the form
( |
cells |
Number of cells per well. The |
n |
Vector giving the number of wells within each group. This may have length either n.groups (if all plates have the same number of wells per group) or n.groups*n.plates. |
n.plates |
The number of plates in the data. |
maxk |
Maximum k value in sum calculating |
Calculations are performed in a C routine.
loglik |
The log likelihood function calculated at the point
|
Karl W Broman, [email protected]
Broman et al. (1996) Estimation of antigen-responsive T cell frequencies in PBMC from human subjects. J Immunol Meth 198:119-132
data(p713) start.pl3 <- npem.start(p713$counts[[3]],n=p713$n) out.pl3 <- npem.em(p713$counts[[3]],start.pl3,n=p713$n) npem.ll(p713$counts[[3]],start.pl3,n=p713$n) npem.ll(p713$counts[[3]],out.pl3$ests,n=p713$n)data(p713) start.pl3 <- npem.start(p713$counts[[3]],n=p713$n) out.pl3 <- npem.em(p713$counts[[3]],start.pl3,n=p713$n) npem.ll(p713$counts[[3]],start.pl3,n=p713$n) npem.ll(p713$counts[[3]],out.pl3$ests,n=p713$n)
Uses the SEM algorithm to obtain estimated standard errors for the MLEs obtained after fitting the normal-Poisson mixture model to data on a cell proliferation assay.
npem.sem( y, npem.em.out, cells = 10^6, start = npem.em.out$ests * 1.05 + 0.001, n = c(24, 24, 24, 22), n.plates = 1, use.order.constraint = TRUE, all.se = TRUE, tol = 0.000001, maxk = 20, prnt = 0, do.var = TRUE, maxit = 1000 )npem.sem( y, npem.em.out, cells = 10^6, start = npem.em.out$ests * 1.05 + 0.001, n = c(24, 24, 24, 22), n.plates = 1, use.order.constraint = TRUE, all.se = TRUE, tol = 0.000001, maxk = 20, prnt = 0, do.var = TRUE, maxit = 1000 )
y |
Vector of transformed scintillation counts, in lexicographical order (plate by plate and group by group within a plate.) |
npem.em.out |
Output from the function |
cells |
Number of cells per well. The |
start |
Starting estimates, some small distance away from the MLE. A
vector of the form ( |
n |
Vector giving the number of wells within each group. This may have length either n.groups (if all plates have the same number of wells per group) or n.groups*n.plates. |
n.plates |
The number of plates in the data. |
use.order.constraint |
If TRUE, force the constraint |
all.se |
If TRUE, do the full SEM algorithm; if FALSE, ignore the
plate-specific parameters (a,b, |
tol |
Tolerance to determine when to stop the EM algorithm. |
maxk |
Maximum k value in sum calculating |
prnt |
If 0, don't print anything; if 1, print out (at each step) the rate matrix and which elements have converged. |
do.var |
If TRUE, calculate the variance-covariance matrix and standard errors; if FALSE, only calculate the full-data information matrix and rate matrix. |
maxit |
Maximum number of iterations to perform. |
Calculations are performed in a C routine. It is important to first run
npem.em() with a very small value for tol, such as
.
infor |
The full-data information matrix |
rates |
The rate matrix ("DM" in Meng and Rubin's notation). |
n.iter |
Number of iterations performed in calculating the rate matrix. |
var |
The estimated variance-covariance matrix. |
se |
The estimated standard
errors. (The square root of the diagnol of |
Karl W Broman, [email protected]
Broman et al. (1996) Estimation of antigen-responsive T cell
frequencies in PBMC from human subjects. J Immunol Meth 198:119-132
Dempster et al. (1977) Maximum likelihood estimation from incomplete data
via the EM algorithm. J Roy Statist Soc Ser B 39:1-38
Meng and Rubin
(1991) Using EM to obtain asymptotic variance-covariance matrices: the SEM
algorithm. J Am Statist Asso 86:899-909
data(p713) start.pl3 <- npem.start(p713$counts[[3]],n=p713$n) out.pl3 <- npem.em(p713$counts[[3]],start.pl3,n=p713$n,tol=1e-13) out.sem.pl3 <- npem.sem(p713$counts[[3]],out.pl3,n=p713$n)data(p713) start.pl3 <- npem.start(p713$counts[[3]],n=p713$n) out.pl3 <- npem.em(p713$counts[[3]],start.pl3,n=p713$n,tol=1e-13) out.sem.pl3 <- npem.sem(p713$counts[[3]],out.pl3,n=p713$n)
Obtains crude starting values, needed for the EM algorithm.
npem.start( y, cells = 10^6, n = c(24, 24, 24, 22), n.plates = 1, n.groups = 4, n.sd = 2, cv = 0.33 )npem.start( y, cells = 10^6, n = c(24, 24, 24, 22), n.plates = 1, n.groups = 4, n.sd = 2, cv = 0.33 )
y |
Vector of transformed scintillation counts, in lexicographical order (plate by plate and group by group within a plate.) |
cells |
Number of cells per well. The |
n |
Vector giving the number of wells within each group. This may have length either n.groups (if all plates have the same number of wells per group) or n.groups*n.plates. |
n.plates |
The number of plates in the data. |
n.groups |
The number of groups. (This is needed here but not
elsewhere, because usually I figure it out from |
n.sd |
Number of SDs above the mean to use as a cutoff |
cv |
Coefficient of variation (= SD/ave) used in randomizing the starting point; use cv=0 to avoid randomization. |
[I should describe the algorithm in more detail here.]
ests |
The parameter estimates to use as starting values for
the EM algorithm, as a vector of length n.groups + 3*n.plates, of the form
( |
Karl W Broman, [email protected]
Broman et al. (1996) Estimation of antigen-responsive T cell frequencies in PBMC from human subjects. J Immunol Meth 198:119-132
data(p713) start.pl3 <- npem.start(p713$counts[[3]],n=p713$n) out.pl3 <- npem.em(p713$counts[[3]],start.pl3,n=p713$n,tol=1e-13)data(p713) start.pl3 <- npem.start(p713$counts[[3]],n=p713$n) out.pl3 <- npem.em(p713$counts[[3]],start.pl3,n=p713$n,tol=1e-13)
Simulate data for a single plate using the normal-Poisson mixture model.
npsim(ests, n = c(24, 24, 24, 22))npsim(ests, n = c(24, 24, 24, 22))
ests |
Parameter values as a vector for the form
( |
n |
Lengths of the |
k |
The simulated numbers of responding cells per well, useful
for comparison with those estimated from |
y |
The simulated transformed scintillation counts, to be used as input
for |
Karl W Broman, [email protected]
Broman et al. (1996) Estimation of antigen-responsive T cell frequencies in PBMC from human subjects. J Immunol Meth 198:119-132
ests <- c(0.5,1.5,2.5,5,15,5) n <- c(24,24,22) dat <- npsim(ests,n) out <- npem.em(dat$y,ests=ests,n=n) jitter <- runif(length(dat$k),-0.1,0.1) plot(dat$k + jitter, out$k, xlab="True no. cells", ylab="Estimated no. cells", lwd=2) plot(dat$y,out$k,type="n",xlab="Response",ylab="Estimated no. cells") for(i in unique(dat$k)) points(dat$y[dat$k==i],out$k[dat$k==i],col=i+1,lwd=2)ests <- c(0.5,1.5,2.5,5,15,5) n <- c(24,24,22) dat <- npsim(ests,n) out <- npem.em(dat$y,ests=ests,n=n) jitter <- runif(length(dat$k),-0.1,0.1) plot(dat$k + jitter, out$k, xlab="True no. cells", ylab="Estimated no. cells", lwd=2) plot(dat$y,out$k,type="n",xlab="Response",ylab="Estimated no. cells") for(i in unique(dat$k)) points(dat$y[dat$k==i],out$k[dat$k==i],col=i+1,lwd=2)
This is data for a limiting dilution assay for a single patient, composed of
6 pairs of plates at 6 different cell concentrations. The data is from the
same subject (at the same time) as p713.2().
p711p711
The data is a list with three components:
counts |
A list of length 12, each component of which is a vector giving the square-root-transformed scintillation counts for a single plate. |
cells |
A vector of length 12, giving the estimated number of cells per well for each of the 12 plates. |
n |
Vector of length 4, giving the number of wells per group, which is the same for each plate. |
Karl W Broman, [email protected]
https://github.com/kbroman/npem
Michael Tigges, Chiron Biocine
This is data for a limiting dilution assay for a single patient, composed of 6 pairs of plates at 6 different cell concentrations.
p713p713
The data is a list with three components:
counts |
A list of length 12, each component of which is a vector giving the square-root-transformed scintillation counts for a single plate. |
cells |
A vector of length 12, giving the estimated number of cells per well for each of the 12 plates. |
n |
Vector of length 4, giving the number of wells per group, which is the same for each plate. |
Karl W Broman, [email protected]
https://github.com/kbroman/npem
Michael Tigges, Chiron Biocine
This is data for a limiting dilution assay for a single patient, composed of
5 pairs of plates at 5 different cell concentrations. The data is from the
same subject (at the same time) as p713().
p713.2p713.2
The data is a list with three components:
counts |
A list of length 10, each component of which is a vector giving the square-root-transformed scintillation counts for a single plate. |
cells |
A vector of length 10, giving the estimated number of cells per well for each of the 10 plates. |
n |
Vector of length 4, giving the number of wells per group, which is the same for each plate. |
Karl W Broman, [email protected]
https://github.com/kbroman/npem
Michael Tigges, Chiron Biocine