readAnti: Read antibody profiling data

View source: R/functions.R

readAntiR Documentation

Read antibody profiling data

Description

Read in antibody profiling data from 96 well plates using positive and negative controls and replicate serial dilutions of patient plasma. Negative control data is assumed to be in the first 4 columns of the first row of data for each plate. The mean of the negative contol is subtracted from all values in the sub column of the output.. Positive control data with a known antibody is assumed to be in columns 5-8 and 9-12 of the first row.

Usage

readAnti(dat, positiveThreshold = 25, dilutions = 300 * 3^(0:3),
  positiveDilutions = 240/3^(0:3), vocal = TRUE, nrows = 8)

Arguments

dat

a file containing the raw data or a data.frame containing raw data. The function assumes that the first column of the first row of each plate contains the patient ID and the remainder of that plate is empty.

positiveThreshold

a single numeric threshold to use for determining a threshold by estimating the OD for this amount of positive control antibody

dilutions

a vector giving dilutions for the serum sample as fold dilution e.g. 2 ul added to 298 ul would be 150.

positiveDilutions

a vector giving dilutions for the positive control as fold dilution e.g. 2 ul added to 298 ul would be 150.

vocal

If TRUE output informational messages

nrows

number of rows in each group of data/plate

Value

a data.frame with a row for each well in the raw plate data with columns:

  • pat The patient identifier from the first column of the raw plate data

  • antigen The antigen identifier from the second column of the raw plate data

  • dilution The serum dilution for the given well

  • pos TRUE if the well was a positive control. Otherwise FALSE

  • neg TRUE if the well was a negative control. Otherwise FALSE

  • od The raw OD value read from the plate data

  • plate The plate number for a well. Plates are numbered starting from 1 for the topmost plate.

  • noAnt The OD value for the negative control well corresponding to this serum dilution

  • sub The raw value with the negative control mean subtracted

Examples

fakeDat<-1:8 %*% t(1/3^rep(0:3,3))
fakeDat[1,]<-c(rep(0.1,4),50*1/3^rep(0:3,2))
raw<-cbind(data.frame('pat'='Test',antigen=LETTERS[1:8]),fakeDat)
tmpFile<-tempfile()
write.table(raw,tmpFile,row.names=FALSE,col.names=FALSE,sep=',')
readAnti(tmpFile)
readAnti(raw)

sherrillmix/antiprofr documentation built on Sept. 3, 2022, 12:19 a.m.