Description Usage Arguments Details Value Examples

View source: R/RUVIII_C_Varying.R

Compute amount of replication, assuming varying controls

1 | ```
RUVIII_C_Varying_residual_dimension(Y, M, potentialControls)
``` |

`Y` |
The input data matrix. Must be a matrix, not a data.frame. It should contain missing (NA) values, rather than zeros. |

`M` |
The design matrix containing information about technical replicates. It should not contain an intercept term! |

`potentialControls` |
The names of the control variables which are known to be constant across the observations |

When applying RUV-III-C with varying controls, the amount of replication available for normalisation depends on the variable being normalised. The amount of replication is measured as the number of technical replicates in which a variable is measured (rows of the design matrix) minus the number of biological samples (columns of the design matrix) in which a variable is measured. This value is useful as a filtering criteria, because variables with a low amount of replication will be poorly normalised by the RUV family of methods.

A vector of integers, one per column of Y.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
data(crossLab)
#Design matrix containing information about which runs are technical replicates of each other.
#In this case, random pairings of mass-spec runs analysing the same sample, at different sites.
#Note that we specify no intercept term!
M <- model.matrix(~ grouping - 1, data = peptideData)
#Get out the list of peptides, both HEK (control) and peptides of interest.
peptides <- setdiff(colnames(peptideData), c("filename", "site", "mixture", "Date", "grouping"))
#Reduce the data matrix to only the peptide data
onlyPeptideData <- data.matrix(peptideData[, peptides])
#All the human peptides are potential controls. That is, everything that's not an SIS peptides.
potentialControls <- setdiff(peptides, sisPeptides)
#But we want to use controls that are *often* found
potentialControlsOftenFound <- names(which(apply(onlyPeptideData[, potentialControls], 2,
function(x) sum(is.na(x))) <= 10))
#Actually run correction
results <- RUVIII_C_Varying_residual_dimension(Y = log10(onlyPeptideData), M = M,
potentialControls = potentialControlsOftenFound)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.