-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHuNonParam.R
More file actions
30 lines (21 loc) · 1.13 KB
/
HuNonParam.R
File metadata and controls
30 lines (21 loc) · 1.13 KB
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
rppa.nonparam <- function(spots, nrep=1, ...){
require(cobs)
spots <- subset(spots, SpotClass=="Sample")
#convert input table so that each dilution is in one column
spots.c <- rppa.serialDilution.format(spots)
#extract number of different dilutions that are not NA
numOfDilutions <- length(unique(spots$DilutionFactor[!is.na(spots$DilutionFactor)]))
#calculate matrix of dilutions
spots.m <- rppa.serialDilution.dilutionMatrix(spots.c, numOfDilutions, highestDilutionFirst=F)
nonpa <- getnonpest(spots.m,3)
#combine estimates with signal information
spots.result <- cbind(spots.c[,1:(ncol(spots.c)-numOfDilutions)], x.weighted.mean=nonpa$x0new, x.err=NA)
spots.summarize <- rppa.serialDilution.summarize(spots.result, ...)
spots.summarize$concentrations <- 2^spots.summarize$x.weighted.mean
spots.summarize$upper <- 0
spots.summarize$lower <- 0
spots.summarize <- spots.summarize[,!(colnames(spots.summarize) %in% c("x.weighted.mean", "x.err"))]
attr(spots.summarize, "title") <- attr(spots, "title")
attr(spots.summarize, "antibody") <- attr(spots, "antibody")
return(spots.summarize)
}