| Title: | Evaluation and Ranking of Normalization Methods for Proteomics Data |
|---|---|
| Description: | Provides tools to evaluate and rank normalization methods for omics datasets using a composite score derived from multiple performance metrics. The package is designed to support systematic benchmarking and comparison of normalization strategies across datasets and experimental settings. It also includes utilities for summarizing results and visualizing normalization performance. |
| Authors: | Julia García Currás [aut, cre] (ORCID: <https://orcid.org/0009-0002-6354-5035>), Axencia Galega de Innovación (GAIN), Xunta de Galicia [fnd] (Industrial Doctorate Grant 2022-2026, Ref. 23_IN606D_2022_2707220) |
| Maintainer: | Julia García Currás <[email protected]> |
| License: | GPL-2 |
| Version: | 0.99.1 |
| Built: | 2026-10-11 10:34:06 UTC |
| Source: | https://github.com/bioc/normScore |
Computes a composite score to rank normalization methods based on multiple quality metrics derived from normalized data matrices.
The function evaluates each normalization method using six criteria: pooled coefficient of variation (PCV), within-group sample correlation, MA-plot trend deviation, mean-SD trend deviation, relative log expression (RLE) consistency, and total intensity consistency. These metrics are scaled, combined into a final score, and used to rank the normalization methods.
In addition, a correction factor derived from the coefficient of variation
of raw sample intensities is applied to the "Log" normalization method.
Optionally, bootstrap resampling is used to estimate mean composite scores
and percentile-based confidence intervals.
normScore( normalizedDataList, groupData, rawData, refGroup = NULL, altGroup = NULL, returnDetails = TRUE, nBoot = 1000 )normScore( normalizedDataList, groupData, rawData, refGroup = NULL, altGroup = NULL, returnDetails = TRUE, nBoot = 1000 )
normalizedDataList |
Named list of normalized numeric matrices or data frames. Each element represents one normalization method, with rows corresponding to features (e.g. proteins) and columns to samples. |
groupData |
|
rawData |
|
refGroup |
|
altGroup |
|
returnDetails |
|
nBoot |
|
The function computes the following six item scores for each normalization method:
Item1: mean pooled coefficient of variation across groups (PVC).
Item2: within-group Spearman correlation summary, transformed so that lower values indicate better performance (Correlation).
Item3: shape-corrected area-based deviation from the
expected MA trend (logFC = 0), based on MAplot.
Item4: area-based deviation of the mean-SD trend from horizontality, based on meanSD plot.
Item5: RLE-based mean absolute percentage error relative to 1.
Item6: quantile-based total intensity consistency metric.
Each item is scaled to the range 0 to 1 using min-max scaling and then summed into a total score. Lower scores indicate better normalization performance.
A correction factor based on the coefficient of variation of total raw sample
intensities is applied only to the normalization method named "Log".
When returnDetails = FALSE, bootstrap resampling of the six item scores
is performed.The results can be visualized using
plotBootstrapNormScore.
If returnDetails = TRUE, returns a list with:
Named numeric vector with the final normalization ranking.
If returnDetails = FALSE, returns a list with:
Named numeric vector with the final normalization ranking.
data.frame with scaled item-wise scores, total
score, and corrected total score for each normalization method.
data.frame with bootstrap mean scores and 95\
percentile confidence intervals for each normalization method.
A ggplot2 object showing the bootstrap mean scores and
confidence intervals.
plotNormScoreDiagnostics,
plotBootstrapNormScore,
simulateData
# Simulate proteomic data simData <- simulateData(nProteins = 1000) # Artificial normalization (just adding shifts to raw data) normalizedDataList <- list( Norm1 = simData$logData + 0.1, Norm2 = simData$logData + 1, Norm3 = simData$logData - 1, Norm4 = simData$logData * 1.1, Norm5 = simData$logData * 0.9, Norm6 = simData$logData * runif(ncol(simData$logData), 0.8, 1.2) ) # Compute ranking result <- normScore( normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, returnDetails = TRUE, nBoot = 100 ) result# Simulate proteomic data simData <- simulateData(nProteins = 1000) # Artificial normalization (just adding shifts to raw data) normalizedDataList <- list( Norm1 = simData$logData + 0.1, Norm2 = simData$logData + 1, Norm3 = simData$logData - 1, Norm4 = simData$logData * 1.1, Norm5 = simData$logData * 0.9, Norm6 = simData$logData * runif(ncol(simData$logData), 0.8, 1.2) ) # Compute ranking result <- normScore( normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, returnDetails = TRUE, nBoot = 100 ) result
Generates a point-range plot showing the mean bootstrap normScore and its 95% confidence interval for each normalization method.
plotBootstrapNormScore(x)plotBootstrapNormScore(x)
x |
A |
A ggplot object showing bootstrap mean normScore values
and 95% confidence intervals for each normalization method.
bootstrapScore <- data.frame( normalization = c("Norm1", "Norm2", "Norm3"), meanNormScore = c(0.8, 1.2, 1.5), ll95 = c(0.6, 1.0, 1.2), ul95 = c(1.0, 1.4, 1.8) ) result <- list(bootstrapScore = bootstrapScore) plotBootstrapNormScore(result)bootstrapScore <- data.frame( normalization = c("Norm1", "Norm2", "Norm3"), meanNormScore = c(0.8, 1.2, 1.5), ll95 = c(0.6, 1.0, 1.2), ul95 = c(1.0, 1.4, 1.8) ) result <- list(bootstrapScore = bootstrapScore) plotBootstrapNormScore(result)
Generates MA plots for each normalization method using the selected reference and alternative groups. These plots are used to assess intensity-dependent differences between groups.
Important! First run validateNormScoreInput() function and them use the
correspondent outputs to plot individual diagnostic graphs as it is shown
in the example below.
plotDiagnosticMA(normalizedDataList, groupData, refGroup, altGroup)plotDiagnosticMA(normalizedDataList, groupData, refGroup, altGroup)
normalizedDataList |
A named list of normalized data matrices. |
groupData |
A data frame with sample names and group labels. |
refGroup |
Character string indicating the reference group. |
altGroup |
Character string indicating the alternative group. |
An arranged ggplot object containing one MA plot per normalization method.
# Simulate proteomic data simData <- simulateData(nProteins = 1000, propDE = 0.5) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = cbind(simData$logData[, 1:20] + -0.8 * (rowMeans(simData$logData, na.rm = TRUE) - mean(rowMeans(simData$logData, na.rm = TRUE))), simData$logData[, 21:40]), Norm2 = cbind(simData$logData[, 1:20] + 0.3 * (rowMeans(simData$logData, na.rm = TRUE) - mean(rowMeans(simData$logData, na.rm = TRUE))), simData$logData[, 21:40]) ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot MA diagnostic plots plotDiagnosticMA( normalizedDataList = inputs$normalizedDataList, groupData = inputs$groupData, refGroup = inputs$refGroup, altGroup = inputs$altGroup ) # Best to Worst: Log > Norm2 > Norm1# Simulate proteomic data simData <- simulateData(nProteins = 1000, propDE = 0.5) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = cbind(simData$logData[, 1:20] + -0.8 * (rowMeans(simData$logData, na.rm = TRUE) - mean(rowMeans(simData$logData, na.rm = TRUE))), simData$logData[, 21:40]), Norm2 = cbind(simData$logData[, 1:20] + 0.3 * (rowMeans(simData$logData, na.rm = TRUE) - mean(rowMeans(simData$logData, na.rm = TRUE))), simData$logData[, 21:40]) ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot MA diagnostic plots plotDiagnosticMA( normalizedDataList = inputs$normalizedDataList, groupData = inputs$groupData, refGroup = inputs$refGroup, altGroup = inputs$altGroup ) # Best to Worst: Log > Norm2 > Norm1
Generates diagnostic plots showing the relationship between sample order by mean intensity and standard deviation for each normalization method.
plotDiagnosticMeanSD(normalizedDataList)plotDiagnosticMeanSD(normalizedDataList)
normalizedDataList |
A named list of normalized data matrices. |
Important! First run validateNormScoreInput() function and them use the
correspondent outputs to plot individual diagnostic graphs as it is shown
in the example below.
An arranged ggplot object containing one plot per normalization method.
# Simulate proteomic data simData <- simulateData(nProteins = 1000, sampleShiftSd = 0.5, sampleShiftCap = 1, sampleSdStrength = -0.5, sampleSdRho = 1.5) # Artificial normalization (just adding shifts to raw data) normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData * runif(ncol(simData$logData), 0.7, 1.2), Norm2 = simData$logData * runif(ncol(simData$logData), 0.8, 1.1) ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot mean-SD diagnostic plots plotDiagnosticMeanSD( normalizedDataList = inputs$normalizedDataList ) # Best to Worst: Norm1 > Norm2 > Log# Simulate proteomic data simData <- simulateData(nProteins = 1000, sampleShiftSd = 0.5, sampleShiftCap = 1, sampleSdStrength = -0.5, sampleSdRho = 1.5) # Artificial normalization (just adding shifts to raw data) normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData * runif(ncol(simData$logData), 0.7, 1.2), Norm2 = simData$logData * runif(ncol(simData$logData), 0.8, 1.1) ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot mean-SD diagnostic plots plotDiagnosticMeanSD( normalizedDataList = inputs$normalizedDataList ) # Best to Worst: Norm1 > Norm2 > Log
Generates the diagnostic plot associated with the PCV item. PCV values are computed for each normalization method and group, and displayed as point-range or boxplot-based summaries depending on the number of groups.
plotDiagnosticPCV(normalizedDataList, groupData)plotDiagnosticPCV(normalizedDataList, groupData)
normalizedDataList |
A named list of normalized data matrices. |
groupData |
A data frame with sample names and group labels. |
Important! First run validateNormScoreInput() function and them use the
correspondent outputs to plot individual diagnostic graphs as it is shown
in the example below.
A ggplot or arranged ggplot object.
# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot pooled coefficient of variation plotDiagnosticPCV( normalizedDataList = inputs$normalizedDataList, groupData = inputs$groupData ) # Best to Worst: Norm2 > Norm1 > Log# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot pooled coefficient of variation plotDiagnosticPCV( normalizedDataList = inputs$normalizedDataList, groupData = inputs$groupData ) # Best to Worst: Norm2 > Norm1 > Log
Generates RLE distribution plots for each normalization method. These plots are used to inspect whether sample-wise RLE distributions are centered and comparable after normalization.
plotDiagnosticRLE(normalizedDataList)plotDiagnosticRLE(normalizedDataList)
normalizedDataList |
A named list of normalized data matrices. |
Important! First run validateNormScoreInput() function and them use the
correspondent outputs to plot individual diagnostic graphs as it is shown
in the example below.
An arranged ggplot object containing one RLE plot per normalization method.
# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot RLE distributions plotDiagnosticRLE( normalizedDataList = inputs$normalizedDataList ) # Best to Worst: Norm2 > Log = Norm1# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot RLE distributions plotDiagnosticRLE( normalizedDataList = inputs$normalizedDataList ) # Best to Worst: Norm2 > Log = Norm1
This file contains plot functions used as outputs for interpreting the detailed ranking results. Plot raw total intensity across samples (ITEM 0)
plotDiagnosticSystematicBias(data)plotDiagnosticSystematicBias(data)
data |
A raw intensity matrix or data frame with proteins in rows and samples in columns. |
Generates the diagnostic plot associated with the systematic bias penalty item (item 0). Raw total intensity is computed for each sample and displayed as a bar plot.
Important! First run validateNormScoreInput() function and them use the
correspondent outputs to plot individual diagnostic graphs as it is shown
in the example below.
A ggplot object.
# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot Systematic Bias Penalty plotDiagnosticSystematicBias(data = inputs$rawData)# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot Systematic Bias Penalty plotDiagnosticSystematicBias(data = inputs$rawData)
Generates sample-wise intensity distribution plots for each normalization method. These plots are used to visually inspect global distributional consistency across samples.
plotDiagnosticTotalIntensity(normalizedDataList)plotDiagnosticTotalIntensity(normalizedDataList)
normalizedDataList |
A named list of normalized data matrices. |
Important! First run validateNormScoreInput() function and them use the
correspondent outputs to plot individual diagnostic graphs as it is shown
in the example below.
An arranged ggplot object containing one intensity distribution plot per normalization method.
# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot log-intensity distributions plotDiagnosticTotalIntensity( normalizedDataList = inputs$normalizedDataList ) # Best to Worst: Norm2 > Norm1 = Log# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot log-intensity distributions plotDiagnosticTotalIntensity( normalizedDataList = inputs$normalizedDataList ) # Best to Worst: Norm2 > Norm1 = Log
Generates the diagnostic plot associated with the correlation item. The plot displays the distribution of within-group sample correlations for each normalization method.
plotDiagnosticWithinGroupCor(normalizedDataList, groupData)plotDiagnosticWithinGroupCor(normalizedDataList, groupData)
normalizedDataList |
A named list of normalized data matrices. |
groupData |
A data frame with sample names and group labels. |
Important! First run validateNormScoreInput() function and them use the
correspondent outputs to plot individual diagnostic graphs as it is shown
in the example below.
A ggplot object.
# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot within-group correlations plotDiagnosticWithinGroupCor( normalizedDataList = inputs$normalizedDataList, groupData = inputs$groupData ) # Best to Worst: Log > Norm2 > Norm1# Simulate proteomic data with considerable systematic bias simData <- simulateData(nProteins = 1000, sampleShiftSd = 1, sampleShiftCap = 0.9) # Adding variations to log raw data to simulate different normalization # situations normalizedDataList <- list( Log = simData$logData, Norm1 = simData$logData + rnorm(n = ncol(simData$logData), mean = 5, sd = 0.5), Norm2 = sweep(simData$logData, 2, apply(simData$logData, 2, median, na.rm = TRUE) - median(as.matrix(simData$logData), na.rm = TRUE), "-") ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE ) # Plot within-group correlations plotDiagnosticWithinGroupCor( normalizedDataList = inputs$normalizedDataList, groupData = inputs$groupData ) # Best to Worst: Log > Norm2 > Norm1
Generates the set of diagnostic plots associated with the individual normScore evaluation items. These plots provide a visual interpretation of the criteria used to assess normalization performance, including raw total intensity, pooled coefficient of variation, within-group correlation, MA plots, mean-SD trends, RLE distributions, and intensity distributions.
plotNormScoreDiagnostics( normalizedDataList, groupData, rawData, refGroup = NULL, altGroup = NULL )plotNormScoreDiagnostics( normalizedDataList, groupData, rawData, refGroup = NULL, altGroup = NULL )
normalizedDataList |
A named list of normalized data matrices or data frames. Each element should contain proteins in rows and samples in columns. |
groupData |
A data frame containing sample-group annotation. The first column is assumed to contain sample names and the second column group labels. |
rawData |
A matrix or data frame containing raw intensity values, with proteins in rows and samples in columns. |
refGroup |
Character string indicating the reference group used for the
MA-plot diagnostic. If |
altGroup |
Character string indicating the alternative group used for
the MA-plot diagnostic. If |
The function validates and aligns the input data before plotting. If only one group is provided, the MA-plot diagnostic is skipped because it requires a comparison between two groups.
A named list of diagnostic plots. Each element corresponds to one
normScore item. If the input contains a single group, the MA-plot element
is returned as NULL.
# Simulate proteomic data simData <- simulateData(nProteins = 1000) # Normalyze ysing NormalyzerDE package normalizedDataList <- list( Norm1 = simData$logData + 0.1, Norm2 = simData$logData + 1, Norm3 = simData$logData - 1, Norm4 = simData$logData * 1.1, Norm5 = simData$logData * 0.9, Norm6 = simData$logData * runif(ncol(simData$logData), 0.8, 1.2) ) # Compute ranking plotNormScoreDiagnostics( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL )# Simulate proteomic data simData <- simulateData(nProteins = 1000) # Normalyze ysing NormalyzerDE package normalizedDataList <- list( Norm1 = simData$logData + 0.1, Norm2 = simData$logData + 1, Norm3 = simData$logData - 1, Norm4 = simData$logData * 1.1, Norm5 = simData$logData * 0.9, Norm6 = simData$logData * runif(ncol(simData$logData), 0.8, 1.2) ) # Compute ranking plotNormScoreDiagnostics( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL )
Simulates two-group quantitative omics data with controlled signal structure, including abundance-dependent variance, differential expression, sample correlation, global shifts, mean-SD dependence, and optional MNAR missingness.
simulateData( nProteins = 10000, nPerGroup = 20, muMean = 18, muSd = 1.2, muClip = c(15, 25), rhoWithin = 0.85, rhoBetween = 0.55, loadingSd = 0.25, sigmaHi = 0.05, sigmaLo = 0.4, gammaSigma = 2.5, propDE = 0.35, logFCSd = 1, logFCMean = 0, heteroLogFC = TRUE, fcHi = 0.55, fcLo = 2.5, gammaFC = 7, sampleShiftSd = 0, sampleShiftCap = 0.2, sampleSdStrength = 0, sampleSdRho = 0.8, sampleSdCap = 0.35, addMissing = TRUE, targetMissing = 0.001, kMnar = 1.2, missingBySampleSd = 0.05, seed = 9396 )simulateData( nProteins = 10000, nPerGroup = 20, muMean = 18, muSd = 1.2, muClip = c(15, 25), rhoWithin = 0.85, rhoBetween = 0.55, loadingSd = 0.25, sigmaHi = 0.05, sigmaLo = 0.4, gammaSigma = 2.5, propDE = 0.35, logFCSd = 1, logFCMean = 0, heteroLogFC = TRUE, fcHi = 0.55, fcLo = 2.5, gammaFC = 7, sampleShiftSd = 0, sampleShiftCap = 0.2, sampleSdStrength = 0, sampleSdRho = 0.8, sampleSdCap = 0.35, addMissing = TRUE, targetMissing = 0.001, kMnar = 1.2, missingBySampleSd = 0.05, seed = 9396 )
nProteins |
|
nPerGroup |
|
muMean |
|
muSd |
|
muClip |
|
rhoWithin |
|
rhoBetween |
|
loadingSd |
|
sigmaHi |
|
sigmaLo |
|
gammaSigma |
|
propDE |
|
logFCSd |
|
logFCMean |
|
heteroLogFC |
|
fcHi |
|
fcLo |
|
gammaFC |
|
sampleShiftSd |
|
sampleShiftCap |
|
sampleSdStrength |
|
sampleSdRho |
|
sampleSdCap |
|
addMissing |
|
targetMissing |
|
kMnar |
|
missingBySampleSd |
|
seed |
|
The simulated data include several structured components:
Protein-wise mean abundance on the log2 scale.
A latent correlation structure inducing stronger within-group than between-group sample correlation.
Abundance-dependent heteroscedastic residual noise to create an MA-like wedge pattern.
Symmetric differential expression between the two groups.
Optional global sample shifts affecting overall intensity.
Optional sample-level mean-SD dependence.
Optional MNAR missingness driven by abundance and sample-specific effects.
The output is intended for testing normalization methods and associated scoring procedures under controlled simulation settings.
A list with the following elements:
Numeric matrix of simulated log2-scale data.
Numeric matrix of simulated raw-scale data, obtained
as 2^logData.
data.frame containing sample names and group labels.
simData <- simulateData( nProteins = 1000, nPerGroup = 5, propDE = 0.2, addMissing = TRUE, seed = 123 ) dim(simData$logData) head(simData$metadata)simData <- simulateData( nProteins = 1000, nPerGroup = 5, propDE = 0.2, addMissing = TRUE, seed = 123 ) dim(simData$logData) head(simData$metadata)
Checks the input objects used by normScore(), including group annotation,
raw data, normalized datasets, sample names, protein names, and bootstrap
settings. The function also aligns the order of rows and columns across
normalized datasets, adds the log-transformed dataset when required, and
identifies whether the analysis contains a single group.
validateNormScoreInput( normalizedDataList, groupData, rawData, refGroup, altGroup, returnDetails = NULL, nBoot = NULL, fromMainFunction = FALSE )validateNormScoreInput( normalizedDataList, groupData, rawData, refGroup, altGroup, returnDetails = NULL, nBoot = NULL, fromMainFunction = FALSE )
normalizedDataList |
A named list of normalized data matrices or data frames. Each element should contain proteins in rows and samples in columns. |
groupData |
A data frame or object coercible to a data frame containing sample-group annotation. The first column is assumed to contain sample names and the second column group labels. |
rawData |
A matrix or data frame containing raw intensity values, with proteins in rows and samples in columns. |
refGroup |
Character string indicating the reference group used for
group-comparison metrics. If |
altGroup |
Character string indicating the alternative group used for
group-comparison metrics. If |
returnDetails |
Logical value indicating whether detailed results
should be returned by |
nBoot |
Numeric value indicating the number of bootstrap resamples. |
fromMainFunction |
Logical value indicating wheter inputs will be used
to |
It can also be used to validate data for diagnostic plotting, using either
the main global funcion plotNormScoreDiagnostic() or any individual
plotting function. In this case, some input parameters are not requiered
for the validation function (nBoot and returnDetails).
A list containing validated and prepared inputs:
normalizedDataList, groupData, rawData, refGroup,
altGroup, returnDetails, nBoot, and singleGroup.
# Simulate proteomic data simData <- simulateData(nProteins = 1000) # Artificial normalization (just adding shifts to raw data) normalizedDataList <- list( Norm1 = simData$logData + 0.1, Norm2 = simData$logData + 1, Norm3 = simData$logData - 1, Norm4 = simData$logData * 1.1, Norm5 = simData$logData * 0.9, Norm6 = simData$logData * runif(ncol(simData$logData), 0.8, 1.2) ) # Validating inputs for normScore() function inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, returnDetails = TRUE, nBoot = 100, fromMainFunction = TRUE ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE )# Simulate proteomic data simData <- simulateData(nProteins = 1000) # Artificial normalization (just adding shifts to raw data) normalizedDataList <- list( Norm1 = simData$logData + 0.1, Norm2 = simData$logData + 1, Norm3 = simData$logData - 1, Norm4 = simData$logData * 1.1, Norm5 = simData$logData * 0.9, Norm6 = simData$logData * runif(ncol(simData$logData), 0.8, 1.2) ) # Validating inputs for normScore() function inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, returnDetails = TRUE, nBoot = 100, fromMainFunction = TRUE ) # Validating inputs for diagnostic graphs inputs <- validateNormScoreInput( normalizedDataList = normalizedDataList, groupData = simData$metadata, rawData = simData$rawData, refGroup = NULL, altGroup = NULL, fromMainFunction = FALSE )