Title: | MBCB (Model-based Background Correction for Beadarray) |
---|---|
Description: | This package provides a model-based background correction method, which incorporates the negative control beads to pre-process Illumina BeadArray data. |
Authors: | Yang Xie <[email protected]> |
Maintainer: | Bo Yao <[email protected]> |
License: | GPL (>=2) |
Version: | 1.61.0 |
Built: | 2024-10-30 07:38:16 UTC |
Source: | https://github.com/bioc/MBCB |
This function provides the means of using only the MCMC (Bayesian) background correction method for the Illumina platform.
bg.mcmc(iter=500, burn=200)
bg.mcmc(iter=500, burn=200)
iter |
The iteration count for the Baysian correction. |
burn |
The number of iterations to burn for the Bayesian correction. |
This function returns an array of alpha, mu, and sigma values representing the values computed during the mcmc trial.
This function makes use of two global variables. It will expect obsbead
and obsnc
are both established prior to calling this function. Obviously, this is not ideal, but R's pass-by-value functionality hindered the ability to pass these matrices as parameters. Using global variables increases performance substantially.
Yang Xie [email protected], Min Chen [email protected], Jeff Allen [email protected]
data(MBCBExpressionData) # Use of global variables is obviously not ideal, but with R's pass-by-value # setup, we quickly run out of memory without using them on such large # arrays #all of the signals from sample #2 obsbead <<- expressionSignal[,2] #the negative control values for this sample obsnc <<- negativeControl[,2] #compute the alpha, mu, and sigma values bg.mcmc();
data(MBCBExpressionData) # Use of global variables is obviously not ideal, but with R's pass-by-value # setup, we quickly run out of memory without using them on such large # arrays #all of the signals from sample #2 obsbead <<- expressionSignal[,2] #the negative control values for this sample obsnc <<- negativeControl[,2] #compute the alpha, mu, and sigma values bg.mcmc();
This function provides the means of using only the Robust Multi-Array Average background correction method for the Illumina platform.
bg.rma(pm, n.pts = 2^14)
bg.rma(pm, n.pts = 2^14)
pm |
The data to be background corrected. |
n.pts |
Pertains to the specificity or accuracy of the method. 2^14 is the default. |
A list with two values:
A vector containing the background-corrected values.
The statistical summary of the computation.
This method does not make use of negative control beads.
Yang Xie [email protected], Min Chen [email protected], Jeff Allen [email protected]
data(MBCBExpressionData) bg.rma(expressionSignal[,2]);
data(MBCBExpressionData) bg.rma(expressionSignal[,2]);
This function is used to background-correct the provided data using the selected correction methods. Normalization is not applied.
mbcb.correct (g, control, npBool=TRUE, rmaBool=FALSE, mleBool=FALSE, bayesBool=FALSE, gmleBool=FALSE, iter=500, burn=200, isRawBead=FALSE)
mbcb.correct (g, control, npBool=TRUE, rmaBool=FALSE, mleBool=FALSE, bayesBool=FALSE, gmleBool=FALSE, iter=500, burn=200, isRawBead=FALSE)
g |
The data representing the signal file. |
control |
The data representing the control file. |
npBool |
A boolean value representing the desire to compute the non-parametric background correction values. Set to true if you wish to compute Non-Parametric background correction. |
rmaBool |
A boolean value representing the desire to compute the RMA background correction values. Set to true if you wish to compute RMA background correction. |
mleBool |
A boolean value representing the desire to compute the MLE background correction values. Set to true if you wish to compute MLE background correction. |
bayesBool |
A boolean value representing the desire to compute the Bayes background correction values. Set to true if you wish to compute Bayes background correction. |
gmleBool |
A boolean value representing the desire to compute the GMLE background correction values. Set to true if you wish to compute GMLE background correction. |
iter |
The iteration count; only used in Bayesian correction. |
burn |
The number of iterations which will be burned; only used in Bayesian correction. |
isRawBead |
A boolean value representing whether the input files are bead-level or bead-type. If the input is bead-level, set this value to True so that the raw bead-level values can be summarized to bead-type data. |
This function returns a complex list which can be grouped into two categories:
Background-corrected Values:
The background corrected values of the Non-Parametric method (or an empty data.frame if this method was not used).
The background corrected values of the RMA method (or an empty data.frame if this method was not used).
The background corrected values of the MLE method (or an empty data.frame if this method was not used).
The background corrected values of the Bayesian method (or an empty data.frame if this method was not used).
Average Values
A data.frame of statistics pertaining to the average of the NP normalization method (or an empty data.frame if this method was not used).
A data.frame of statistics pertaining to the average of the RMA method (or an empty data.frame if this method was not used).
A data.frame of statistics pertaining to the average of the MLE method (or an empty data.frame if this method was not used).
A data.frame of statistics pertaining to the average of the Bayesian method (or an empty data.frame if this method was not used).
These values have not been normalized or log2 transformed. See mbcb.main
for such functionality.
Yang Xie [email protected], Min Chen [email protected], Jeff Allen [email protected]
data(MBCBExpressionData) mbcb.correct(expressionSignal, negativeControl);
data(MBCBExpressionData) mbcb.correct(expressionSignal, negativeControl);
This file provides the Graphical-User-Interface for the MBCB package.
mbcb.gui()
mbcb.gui()
This GUI will allow you to easily input data files and a negative-control file and will output a log2-transformed background-corrected file.
The input files should be tab-delimited files in the following form:
signal.txt
g.1 g.2 g.3 g.4 10181072_239_rc-S 160.3 776.4 135.8 407.7 10181072_290-S 138.1 219.8 122.1 142.4 ... ... ... ... ...
neg-con.txt
id g.1 g.2 g.3 g.4 50133 127 213.5 82 103 50315 232 295 143.5 156 ... ... ... ... ...
Note that both of these examples come from a test involving four trials. Your data could use whatever number you'd like.
Yang Xie [email protected], Min Chen [email protected], Jeff Allen [email protected]
data(MBCBExpressionData) #create files from the data provided in this package in the current directory write.table(expressionSignal, 'signal.txt', sep="\t"); write.table(negativeControl, 'negative.control.txt', sep="\t"); #open the GUI; you can use the files just created as input for the signal and # negative control files. mbcb.gui();
data(MBCBExpressionData) #create files from the data provided in this package in the current directory write.table(expressionSignal, 'signal.txt', sep="\t"); write.table(negativeControl, 'negative.control.txt', sep="\t"); #open the GUI; you can use the files just created as input for the signal and # negative control files. mbcb.gui();
This is the main function which incorporates all the others. This should be the most straightforward and autonomous function in the MBCB package.
mbcb.main (signal, control, npBool=TRUE, rmaBool=FALSE, mleBool=FALSE, bayesBool=FALSE, gmleBool=FALSE, paramEstFile="param-est", bgCorrectedFile="bgCorrected", iter=500, burn=200, normMethod="none", isRawBead=FALSE)
mbcb.main (signal, control, npBool=TRUE, rmaBool=FALSE, mleBool=FALSE, bayesBool=FALSE, gmleBool=FALSE, paramEstFile="param-est", bgCorrectedFile="bgCorrected", iter=500, burn=200, normMethod="none", isRawBead=FALSE)
signal |
The data representing the signal file. |
control |
The data representing the control file. |
npBool |
A boolean value representing the desire to compute the non-parametric background correction values. |
rmaBool |
A boolean value representing the desire to compute the RMA background correction values. |
mleBool |
A boolean value representing the desire to compute the MLE background correction values. |
bayesBool |
A boolean value representing the desire to compute the Bayes background correction values. |
gmleBool |
A boolean value representing the desire to compute the GMLE background correction values. |
paramEstFile |
The base file name to which suffixes and a file extension will be appended (i.e. 'C:/output'). These files will store the parameter estimates of each background correction method selected. |
bgCorrectedFile |
The base file name to which suffixes and a file extension will be appended (i.e. 'C:/output'). These files will store the background corrected intensities |
iter |
The iteration count; only used in Bayesian correction. |
burn |
The number of iterations which will be burned; only used in Bayesian correction. |
normMethod |
The normalization method to be used. By default, none will be applied. The choices are: |
isRawBead |
A boolean value representing whether the input files are bead-level or bead-type. If the input is bead-level, set this value to True so that the raw bead-level values can be summarized to bead-type data. |
The function will compute and output log2-tranformed values for the desired background correction methods. Rather than returning this data as R objects, the output is written to files based on the names given in paramEstFile and bgCorrectedFile.
You can use mbcb.parseFile
to create the signal and control matrices from the given files.
Yang Xie [email protected], Min Chen [email protected], Jeff Allen [email protected]
data(MBCBExpressionData) #Use of global variables is obviously not ideal, but with R's pass-by-value # setup, we quickly run out of memory without using them on such large # arrays mbcb.main(expressionSignal, negativeControl);
data(MBCBExpressionData) #Use of global variables is obviously not ideal, but with R's pass-by-value # setup, we quickly run out of memory without using them on such large # arrays mbcb.main(expressionSignal, negativeControl);
This function is used to read the files provided into a format which will be usable by the MBCB package (data.frame).
mbcb.parseFile(sigFile, conFile, isRawBead = FALSE)
mbcb.parseFile(sigFile, conFile, isRawBead = FALSE)
sigFile |
The file-name (character string) representing the signal file. |
conFile |
The file-name (character string) representing the control file. |
isRawBead |
A boolean value representing whether the input files are bead-level or bead-type. If the input is bead-level, set this value to True so that the raw bead-level values can be summarized to bead-type data. |
This function will return a list containing two data frames: sig and con.
Represents the signal file.
Represents the negative control data.frame.
The input files should be tab-delimited files in the following form:
signal.txt
g.1 g.2 g.3 g.4 10181072_239_rc-S 160.3 776.4 135.8 407.7 10181072_290-S 138.1 219.8 122.1 142.4 ... ... ... ... ...
neg-con.txt
id g.1 g.2 g.3 g.4 50133 127 213.5 82 103 50315 232 295 143.5 156 ... ... ... ... ...
Note that both of these examples come from a test involving four trials. Your data could use whatever number you'd like.
Yang Xie [email protected], Min Chen [email protected], Jeff Allen [email protected]
data(MBCBExpressionData) # Create files from the data provided in this package in the current # directory # Obviously, this is the opposite of what the function does, but we need to # write sample files for the sake of the demonstration # The signal and negative control files can be used by calling the above # command without the writing and reading of the data. write.table(expressionSignal, 'signal.txt', sep="\t"); write.table(negativeControl, 'negative.control.txt', sep="\t"); #read in those files just created. data <- mbcb.parseFile('signal.txt', 'negative.control.txt'); signal <- data$sig; negCon <- data$con;
data(MBCBExpressionData) # Create files from the data provided in this package in the current # directory # Obviously, this is the opposite of what the function does, but we need to # write sample files for the sake of the demonstration # The signal and negative control files can be used by calling the above # command without the writing and reading of the data. write.table(expressionSignal, 'signal.txt', sep="\t"); write.table(negativeControl, 'negative.control.txt', sep="\t"); #read in those files just created. data <- mbcb.parseFile('signal.txt', 'negative.control.txt'); signal <- data$sig; negCon <- data$con;
The MBCBExpressionData
dataset consists of two dataframes,
expressionSignal
and negativeControl
. See the vignette
for more detail regarding these data.
data(MBCBExpressionData)
data(MBCBExpressionData)
This function is used to neatly output the values created by the other methods in the MBCB package.
printMBCBOutput(sig, average, rmaBool, npBool, mleBool, bayesBool, gmleBool, avgOutputFile, detailOutputFile)
printMBCBOutput(sig, average, rmaBool, npBool, mleBool, bayesBool, gmleBool, avgOutputFile, detailOutputFile)
sig |
A list corresponding to the backgrdoun-corrected signal values (as is generated by the mbcb.correct function). The list should have elements for all desired background correction methods named 'NP', 'RMA', 'Bayes', and/or 'MLE'. |
average |
A list containing the average values (as is generated by the mbcb.correct function). The list should have elements for all desired background correction methods named 'NP', 'RMA', 'Bayes', and/or 'MLE'. |
npBool |
A boolean value representing the desire to compute the non-parametric background correction values. |
rmaBool |
A boolean value representing the desire to compute the RMA background correction values. |
mleBool |
A boolean value representing the desire to compute the MLE background correction values. |
bayesBool |
A boolean value representing the desire to compute the Bayes background correction values. |
gmleBool |
A boolean value representing the desire to compute the GMLE background correction values. |
avgOutputFile |
The base file name to which suffixes and a file extension will be appended (i.e. 'C:/output'). These files will store the average values of each background correction method selected. |
detailOutputFile |
The base file name to which suffixes and a file extension will be appended (i.e. 'C:/output'). These files will store the background corrected intensities |
This function prints corresponding CSV files based on which background-correction methods were selected.
Yang Xie [email protected], Min Chen [email protected], Jeff Allen [email protected]