Handling effect amplification
amplify.handling.effect.Rd
Amplify handling effect in pre-specified slides by either a location shift or a scale change.
Arguments
- handling.effect
the estimated handling effect dataset to be modified. The dataset must have rows as probes and columns as samples.
- amplify.array.id
the array IDs specified to have its handling effect amplified. If
type = "shift"
ortype = "scale1"
ortype = "multiply"
, a vector of array IDs must be supplied. Iftype = "scale2"
, a list of vectors of array IDs must be supplied; each element in the list must be a vector of array IDs.- amplify.level
a multiplier specified to amplify handling effect by. A numeric multiplier must be supplied if
type = "shift"
ortype = "scale1"
ortype = "multiply"
. A vector of multipliers must be supplied if type = "scale2" and it must have an equal length to theamplify.array.id
list.- type
a choice of amplification type, either "shift", "multiply", "scale1" or "scale2" for either location shift or scale change. By default,
type = "shift"
. Location shift moves the entire specified arrays up or down by a constant. Scale change 1 re-scales expressions that are in inter-quartiles towards the first and the third quartiles Within each array; expressions that are outside of the inter-quartile range remain unchanged. Scale change 2 re-scales expressions by the power of constants that are specified by the user for each batch.
Examples
if (FALSE) {
biological.effect <- estimate.biological.effect(uhdata = uhdata.pl)
handling.effect <- estimate.handling.effect(uhdata = uhdata.pl,
nuhdata = nuhdata.pl)
ctrl.genes <- unique(rownames(uhdata.pl))[grep("NC", unique(rownames(uhdata.pl)))]
biological.effect.nc <- biological.effect[!rownames(biological.effect) %in% ctrl.genes, ]
handling.effect.nc <- handling.effect[!rownames(handling.effect) %in% ctrl.genes, ]
handling.effect.nc.tr <- handling.effect.nc[, c(1:64, 129:192)]
# location shift
handling.effect.nc.tr.shift <- amplify.handling.effect(handling.effect = handling.effect.nc.tr,
amplify.array.id = colnames(handling.effect.nc.tr)[1:64],
amplify.level = 2, type = "shift")
# multiply
handling.effect.nc.tr.add <- amplify.handling.effect(handling.effect = handling.effect.nc.tr,
amplify.array.id = colnames(handling.effect.nc.tr)[1:64],
amplify.level = 2, type = "multiply")
# scale change 1
handling.effect.nc.tr.scale1 <- amplify.handling.effect(handling.effect = handling.effect.nc.tr,
amplify.array.id = colnames(handling.effect.nc.tr)[1:64],
amplify.level = 2, type = "scale1")
# scale change 2
amplify.array.id <- list(1:40, 41:64, (129:160) - 64, (161:192) - 64)
for(i in 1:length(amplify.array.id))
amplify.array.id[[i]] <- colnames(handling.effect.nc.tr)[amplify.array.id[[i]]]
amplify.level <- c(1.2, 1.3, 1/3, 2/3)
handling.effect.nc.tr.scale2 <- amplify.handling.effect(handling.effect = handling.effect.nc.tr,
amplify.array.id = amplify.array.id,
amplify.level = amplify.level,
type = "scale2")
par(mfrow = c(2, 2), mar = c(4, 3, 2, 2))
rng <- range(handling.effect.nc.tr, handling.effect.nc.tr.shift,
handling.effect.nc.tr.scale1, handling.effect.nc.tr.scale2)
boxplot(handling.effect.nc.tr, main = "original",
ylim = rng, pch = 20, cex = 0.2, xaxt = "n")
boxplot(handling.effect.nc.tr.shift, main = "shifted",
ylim = rng, pch = 20, cex = 0.2, xaxt = "n")
boxplot(handling.effect.nc.tr.scale1, main = "scaled 1",
ylim = rng, pch = 20, cex = 0.2, xaxt = "n")
boxplot(handling.effect.nc.tr.scale2, main = "scaled 2",
ylim = rng, pch = 20, cex = 0.2, xaxt = "n")
}