diff options
-rw-r--r-- | DESCRIPTION | 4 | ||||
-rw-r--r-- | INDEX | 4 | ||||
-rw-r--r-- | R/drfit.R | 72 | ||||
-rw-r--r-- | man/checkplate.Rd | 31 |
4 files changed, 106 insertions, 5 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index 7ba2f92..07c87ef 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: drfit -Version: 0.02-4 -Date: 2004-08-31 +Version: 0.03-5 +Date: 2004-09-08 Title: Dose-response data evaluation Author: Johannes Ranke <jranke@uni-bremen.de> Maintainer: Johannes Ranke <jranke@uni-bremen.de> @@ -1,5 +1,7 @@ antifoul Dose-Response data for TBT and Zink Pyrithione in IPC-81 cells +checkplate Check raw data from a specified microtiter + plate drdata Get dose-response data drfit Fit dose-response models -drplot Plot dose-response data and dose-response models +drplot Plot dose-response models @@ -3,7 +3,7 @@ drdata <- function(substances, experimentator = "%", db = "cytotox", ok="'ok'")
{
library(RODBC)
- cytotoxchannel <- odbcConnect("cytotox",uid="cytotox",pwd="cytotox",case="tolower")
+ channel <- odbcConnect("cytotox",uid="cytotox",pwd="cytotox",case="tolower")
slist <- paste(substances,collapse="','")
query <- paste("SELECT conc,viability,unit,experimentator,substance,celltype,",
"plate,ok FROM cytotox WHERE substance IN ('",
@@ -12,7 +12,7 @@ drdata <- function(substances, experimentator = "%", db = "cytotox", celltype,"' AND ",
whereClause," AND ok in (",
ok,")",sep="")
- data <- sqlQuery(cytotoxchannel,query)
+ data <- sqlQuery(channel,query)
names(data)[[1]] <- "dose"
names(data)[[2]] <- "response"
data$dosefactor <- factor(data$dose)
@@ -367,3 +367,71 @@ drplot <- function(drresults, data = FALSE, dtype = "std", alpha = 0.95, }
}
}
+
+checkplate <- function(plate,db="cytotox") {
+ library(RODBC)
+ channel <- odbcConnect(db,uid=db,pwd=db,case="tolower")
+
+ platequery <- paste("SELECT experimentator,substance,celltype,conc,unit,viability,performed,ok FROM ",
+ db," WHERE plate=", plate)
+ controlquery <- paste("SELECT type,response FROM controls WHERE plate=",plate)
+
+ platedata <- sqlQuery(channel,platequery)
+ controldata <- sqlQuery(channel,controlquery)
+
+ if (length(platedata$experimentator) < 1) {
+ cat("There is no response data for plate ",plate," in database ",db,"\n")
+ } else {
+ platedata$experimentator <- factor(platedata$experimentator)
+ platedata$celltype <- factor(platedata$celltype)
+ platedata$substance <- factor(platedata$substance)
+ platedata$unit <- factor(platedata$unit)
+ platedata$performed <- factor(platedata$performed)
+ platedata$ok <- factor(platedata$ok)
+
+ blinds <- subset(controldata,type=="blind")
+ controls <- subset(controldata,type=="control")
+
+ numberOfBlinds <- length(blinds$response)
+ numberOfControls <- length(controls$response)
+ meanOfBlinds <- mean(blinds$response)
+ meanOfControls <- mean(controls$response)
+ stdOfBlinds <- sd(blinds$response)
+ stdOfControls <- sd(controls$response)
+
+ cat("Plate ",plate," from database ",db,"\n",
+ "\tExperimentator: ",levels(platedata$experimentator),"\n",
+ "\tCell type(s): ",levels(platedata$celltype),"\n",
+ "\tPerformed on : ",levels(platedata$performed),"\n",
+ "\tSubstance(s): ",levels(platedata$substance),"\n",
+ "\tConcentration unit: ",levels(platedata$unit),"\n",
+ "\tOK: ",levels(platedata$ok),"\n",
+ "\t\tNumber \tMean \tStandard Deviation\n",
+ "blind\t\t",numberOfBlinds,"\t",meanOfBlinds,"\t",stdOfBlinds,"\n",
+ "control\t",numberOfControls,"\t",meanOfControls,"\t",stdOfControls,"\n")
+
+ par(ask=TRUE)
+
+ boxplot(blinds$response,controls$response,names=c("blinds","controls"),ylab="Response",main=paste("Plate ",plate))
+
+ drdata <- subset(platedata,select=c(substance,conc,viability))
+ drdata$substance <- factor(drdata$substance)
+ substances <- levels(drdata$substance)
+ substances
+
+ plot(log10(drdata$conc),drdata$viability,
+ xlim=c(-2.5, 4.5),
+ ylim= c(-0.1, 2),
+ xlab=paste("Decadic Logarithm of the concentration in ",levels(platedata$unit)),
+ ylab="Viability")
+
+ drdatalist <- split(drdata,drdata$substance)
+
+ for (i in 1:length(drdatalist)) {
+ points(log10(drdatalist[[i]]$conc),drdatalist[[i]]$viability,col=i);
+ }
+
+ legend(3.0,1.5,substances, pch=1, col=1:length(substances))
+ title(main=paste("Plate ",plate," - ",levels(platedata$experimentator)," - ",levels(platedata$celltype)))
+ }
+}
diff --git a/man/checkplate.Rd b/man/checkplate.Rd new file mode 100644 index 0000000..43dcaac --- /dev/null +++ b/man/checkplate.Rd @@ -0,0 +1,31 @@ +\name{checkplate} +\alias{checkplate} +\title{Check raw data from a specified microtiter plate} +\description{ + Report metadata from a specified microtiter plate from a specified database, box + plot positive and negative (blind) controls, and show the response data on the + plate. +} +\usage{ + checkplate(plate,db="cytotox") +} +\arguments{ + \item{plate}{ + The number of the plate identifying it within the database.} + \item{db}{ + The database to be used. Currently only "cytotox" of the UFT Department of + Bioorganic Chemistry is supported.} +} +\value{ + The function lists a report and shows two graphs. +} +\examples{ +# Check plate number 1 in the cytotox database +\dontrun{data <- checkplate(1)} +} +\author{ + Johannes Ranke + \email{jranke@uni-bremen.de} + \url{http://www.uft.uni-bremen.de/chemie/ranke} +} +\keyword{database} |