README.md

qcSSMD

An R Package for quality control using SSMD in HTS studies

qcSSMD can be installed from github

install.packages("devtools") # If not already installed

devtools::install_github("Karena6688/qcSSMD")

An example of codes

library(qcSSMD)

Table 3: Critical Value for our paper

n1.vec = c(304, 12, 76, 6, 1276, 20)

n2.vec = c(8, 8, 6, 6, 12, 12)

ssmdC.vec = rep( NA, length(n1.vec) )

for( i in 1:length(n1.vec) ) {

n1 = n1.vec[i]

n2 = n2.vec[2]

ssmdC.vec[i] = ssmdC.homoVAR.fn(n1, n2, Alpha=0.05, Beta=3)

}

round(ssmdC.vec, 2)

[1] 3.47 4.14 3.61 4.44 3.43 3.95

Calculation of estimated SSMD and critical values (CVB3) for Figure 2 in our paper

data("data.CVB3CRISPR", package="qcSSMD")

data.df = dataCVB3.df

data.df[1:3, ]

plate wellType row column intensity

1 plate01 MISC 1 1 NA

2 plate01 MISC 1 2 NA

3 plate01 Sample 1 3 -1.123124

plateName = "plate"; rowName = "row"; colName = "column"

wellName = "wellType"

unique(data.df[, wellName])

[1] MISC Sample Negative Control Positive Control

Levels: MISC Negative Control Positive Control Sample

negName="Negative Control"; sampleName = "Sample"

strongPos = "Positive Control"

Intensity = "intensity"

plate.vec = as.vector(data.df[, plateName])

plates = unique(plate.vec)

nPlate = length(plates) #[1] 20

nRow=8; nCol=12; nWell = nRow * nCol

uniqWells = unique(data.df[, wellName])

uniqWells

ssmdEst.mat = ssmdEst.homoVAR.frame.fn(dataIn.df=data.df[, c("plate", "wellType", "intensity")],

                                   negREF=sampleName, positiveCTRL=strongPos,

                                   pREFtrim=0.05, approx=FALSE, method="UMVUE")

ssmdC.mat = ssmdC.homoVAR.frame.fn(dataIn.df=data.df[, c("plate", "wellType", "intensity")],

                               negREF=sampleName, positiveCTRL=strongPos,

                               pREFtrim=0.05, Alpha=0.05, Beta=-3)

cbind(ssmdC.mat, ssmdEst.mat)

nNeg nPos ssmdC SSMDest SSMDvar

plate01 76 2 -3.960271 -12.663432 1.3965338

plate02 76 2 -3.960271 -29.364049 6.3783474

plate03 76 2 -3.960271 -4.009796 0.3724396

plate04 76 2 -3.960271 -8.802837 0.8083237

plate05 76 2 -3.960271 -3.194938 0.3307698

plate06 76 2 -3.960271 -6.177287 0.5291611

plate07 76 2 -3.960271 -4.954670 0.4325597

plate08 76 2 -3.960271 -16.486185 2.1874504

plate09 76 2 -3.960271 -6.820598 0.5885104

plate10 76 2 -3.960271 -6.261448 0.5365915

plate11 76 2 -3.960271 -5.337859 0.4605531

plate12 76 2 -3.960271 -17.997794 2.5574307

plate13 76 2 -3.960271 -4.218945 0.3846550

plate14 76 2 -3.960271 -2.920622 0.3188626

plate15 76 2 -3.960271 -6.524026 0.5604200

plate16 76 2 -3.960271 -7.399418 0.6469308

plate17 76 2 -3.960271 -11.012721 1.1191355

plate18 76 2 -3.960271 -3.216893 0.3317689

plate19 15 2 -4.453375 -5.285416 1.6714767

plate20 15 2 -4.453375 -10.415101 5.6415125

which(ssmdC.mat[,"ssmdC"] > -3.6)

plate05 plate14 plate18

5 14 18

zFactor.mat =

zFactor.frame.fn(dataIn.df=data.df[, c("plate", "wellType", "intensity")],

             negREF=sampleName, positiveCTRL=strongPos,

             pREFtrim=0.05)

zFactor.mat

nNeg nPos zFactor

plate01 76 2 0.693357677

plate02 76 2 0.605537146

plate03 76 2 -0.108346532

plate04 76 2 0.572083527

plate05 76 2 0.109450165

plate06 76 2 0.253034110

plate07 76 2 -0.788300004

plate08 76 2 0.414847464

plate09 76 2 -0.184409587

plate10 76 2 0.271449317

plate11 76 2 0.209600383

plate12 76 2 0.507104275

plate13 76 2 0.001489705

plate14 76 2 -0.276235473

plate15 76 2 0.129317651

plate16 76 2 0.492069732

plate17 76 2 0.443485465

plate18 76 2 0.255556462

plate19 15 2 0.366625799

plate20 15 2 0.643618021

Figure 2:

Fig. 2a

par(mar=c(5.1, 4.4, 1.1, 1.1))

par(mfrow=c(1,1))

uniqWells

[1] empty Sample negativeCTRL positiveCTRL

col.vec=c("black", "lightblue", "white","red")

wellplotOrders = 1:4

pch.vec = rep(1, length(col.vec))

x.df=cbind(plateWelltoX.fn(data.df[,c(plateName, rowName, colName)], nRow, nCol, byRow=FALSE),

        "wellType"=data.df[, wellName])

Intensity = "intensity"

y.vec = data.df[, Intensity]

yrange = range(y.vec, na.rm=T)

yrange = c(-15, max(yrange))

plot( range(x.df$x), yrange, type="n", xlab="Plate Number (Plate-well series by column)",

  ylab="Normalized Intensity", axes=FALSE, main="")

axis(2, las=2)

axis(1, at=unique(x.df[,"plateOrder"]-1)*nWell, label=unique(x.df[,"plateOrder"]), las=2 )

box()

for( i in wellplotOrders ) {

condt = x.df[,"wellType"] == uniqWells[i]

points( x.df[condt,"x"], y.vec[condt], col=col.vec[i], cex=0.5)

}

legend("bottomright", legend=c("Sample wells", "Positive control"),

   col=col.vec[c(2,4)], pch=1, cex=1)

Fig. 2b

par(mar=c(5.1, 4.4, 1.1, 1.1))

xat = c(1:20); yat = 0:(-15)*2

SSMD.mat = cbind("SSMDest"=ssmdEst.mat[, "SSMDest"], "ssmdC"=ssmdC.mat[, "ssmdC"])

yRange = c( min(SSMD.mat), 0 )

plot( c(1, length(plates)), yRange, type="n", axes=FALSE,

  xlab="Plate Number", ylab="SSMD",

  main="")

axis(1, at=xat, labels=xat, las=2); axis(2, at=yat, labels=yat, las=2); box()

for(i in 1:ncol(SSMD.mat) ) {

points( 1:length(plates), SSMD.mat[,i], col=i )

lines( 1:length(plates), SSMD.mat[,i], col=i )

}

lines( c(1-10, length(plates)+10 ), rep(-3.6, 2), col="grey" )

legend("bottomright", legend=c("Estimated value", "Critical value", "ROT cutoff"),

   col=c("black", "red", "grey"), lty=1, pch=1, cex=1)

Fig. 2c

col.vec1 = c("red", "black")

xat = c(1:20); yat = 2:(-8)/2

yRange = range(zFactor.mat[, "zFactor"])

plot( c(1, length(plates) ), yRange, type="n", axes=FALSE,

  xlab="Plate Number", ylab="z-factor",

  main="")

axis(1, at=xat, labels=xat, las=2); axis(2, at=yat, labels=yat, las=2); box()

points( 1:length(plates), zFactor.mat[, "zFactor"] )

lines( 1:length(plates), zFactor.mat[, "zFactor"] )

lines( c(1-10, length(plates)+10 ), rep(0, 2), col="grey" )

legend("bottomright", legend=c("plug-in value", "z-factor = 0"),

   col=c("black", "grey"), lty=1, pch=1, cex=1)

end of codes for our paper

Data

The related dataset is stored in Excel files in the subdirectory "extdata".

The data may also be obtained through running the following command lines in R after installing qcSSMD

library(qcSSMD)

data("data.CVB3CRISPR", package="qcSSMD")

The CVB3 CRISPR/CAS9 screen was published originally in

Kim, H. S. et al. Arrayed CRISPR screen with image-based assay reliably uncovers host genes required for coxsackievirus infection. Genome Res 28, 859-868 (2018).

Functions

qcSSMD contains the following major functions.

plateWelltoX.fn

ssmdC.homoVAR.fn

ssmdC.homoVAR.frame.fn

ssmdEst.homoVAR.fn

ssmdEst.homoVAR.frame.fn

ssmdEstCore.homoVAR.fn

zFactor.frame.fn

Author

Dandan Wang and Xiaohua Douglas Zhang, Ph.D., Professor, University of Macau and University of Kentucky

Paper

Issues of z-factor and a solution for quality control in high-throughput screening studies



Karena6688/qcSSMD documentation built on July 23, 2020, 9:50 a.m.