
BASH(BLData, array, neighbours=NULL, transFun = logGreenChannelTransform, outlierFun = illuminaOutlierMethod, compn=3, wtsname=NULL, compact = TRUE, diffuse = TRUE, extended = TRUE, cinvasions = 10, dinvasions = 15, einvasions = 20, bgcorr = "median", maxiter = 10, compcutoff = 8, compdiscard = TRUE, diffcutoff = 10, diffsig = 0.0001, diffn = 3, difftwotail = FALSE, useLocs = TRUE, ...)
BeadLevelList
HULK
, by calculating the neighbours matrix once and passing it to the two functions.BASHCompact
BASHDiffuse
BGFilter
.method
argument of BGFilter
). Note that "none" may be the correct setting if HULK
has already been applied.generateNeighbours
for more details.BASH
pipeline function performs three types of defect analysis on an image. The first, COMPACT DEFECTS, finds large clusters of outliers, as per BASHCompact
. The outliers are found using findAllOutliers()
. We then find which outliers are clustered together. This process is iterative - having found a compact defect, we remove it, and then see if any more defects are found.
The second, DIFFUSE DEFECTS, finds areas which are densely populated with outliers (which are not necessarily connected), as per BASHDiffuse
. To make this type of defect more obvious, we first generate an ERROR IMAGE, and then find outliers based on this image. (The error image is calculated by using method = "median"
and bgfilter = "medianMAD"
in generateE
, unless ebgcorr = FALSE
in which case we use bgfilter = "median"
.) Now we consider a neighbourhood around each bead and count the number of outlier beads in this region. Using a binomial test we determine whether this is more that we would expect if the outliers were evenly spread over the entire array. If so, we mark it as a diffuse defect. (A clustering algorithm similar to the compact defect analysis is run to reduce false positives.)
After each of these two analyses, we "close" the image, filling in gaps.
The third, EXTENDED DEFECTS, returns a score estimating how much the background is changing across an array, as per BASHExtended
. To estimate the background intensity, we generate an error image using the median filter (i.e. generateE
with method = "median"
and bgfilter = "median"
). We divide the variance of this by the variance of an error image without using the median filter, to obtain our extended score.
It should be noted that to avoid repeated computation of distance, a "neighbours" matrix is used in the analysis. This matrix describes which beads are close to other beads. If a large number of beads are missing (for example, if beads with ProbeID = 0 were discarded) then this algorithm may be affected.
For more detailed descriptions of the algorithms, read the help files of the respective functions listed in "see also".
BASH is currently quite a slow, memory-intensive function. It will only run on a single array at a time, and for analysis of multiple arrays, we recommend parallelising the command. An example is shown using the base parallel package.
BASHCompact
, BASHDiffuse
, BASHExtended
, generateNeighbours
, HULK
## Not run:
#
# if(require(beadarrayExampleData)){
#
# data(exampleBLData)
# output <- BASH(exampleBLData,array=1,useLocs=FALSE)
# exampleBLData <- setWeights(exampleBLData, output$wts, array=1) #apply BASH weights to exampleBLData
#
# ###BASH only accepts one array at a time, but it can be made to run in a parallel fashion
# library(parallel)
#
# output <- mclapply(c(1,2), function(x) BASH(exampleBLData, array=x, useLocs=FALSE))
#
# for(i in 1:2){
# exampleBLData <- setWeights(exampleBLData, output[[i]]$wts, array=i)
# }
#
#
# #diffuse test is stricter
# output <- BASH(exampleBLData, diffsig = 0.00001,array=1, useLocs=FALSE)
#
# #more outliers on the error image are used in the diffuse analysis
# output <- BASH(exampleBLData, diffn = 2,array=1, useLocs=FALSE)
#
# #only perform compact & diffuse analyses (we will only get weights)
# output <- BASH(exampleBLData, extended = FALSE,array=1, useLocs=FALSE)
#
# #attempt to correct for background.
# output <- BASH(exampleBLData, bgcorr = "median",array=1, useLocs=FALSE)
# }
#
# else{
#
# stop("You will need the beadarrayExampleData package to run this example")
# }
#
#
#
# ## End(Not run)
Run the code above in your browser using DataLab