Hi Zachary,
The channels are equalized by subtracting the differences between medians so that the channels median values align. You can see the code below for more info!
Best,
Devon
.normalizePeptides = function(input) {
input[, MedianLog2Int := median(log2Intensity, na.rm = TRUE),
by = c("Run", "Channel")]
median_baseline = median(
unique(input[, list(Run, Channel, MedianLog2Int)])[, MedianLog2Int],
na.rm = TRUE
)
input[, Diff := median_baseline - MedianLog2Int]
input[, log2Intensity := log2Intensity + Diff]
input[, Intensity := 2 ^ log2Intensity]
input[, Diff := NULL]