R/normalization.R
median_normalization.Rd
The method calculates for each sample the median change (i.e. the difference between the observed value and the row average) and subtracts it from each row. Missing values are ignored in the procedure. The method is based on the assumption that a majority of the rows did not change.
median_normalization(X, spike_in_rows = NULL)
X | a matrix or SummarizedExperiment of proteins and samples |
---|---|
spike_in_rows | a numeric or boolean vector that is used to
to normalize the intensities across samples. Default: |
the normalized matrix
syn_data <- generate_synthetic_data(n_proteins = 10) normalized_data <- median_normalization(syn_data$Y) normalized_data#> Condition_1-1 Condition_1-2 Condition_1-3 Condition_2-1 #> protein_1 NA NA 18.81786 NA #> protein_2 19.68449 20.14798 NA NA #> protein_3 21.57751 21.19713 20.78472 21.66849 #> protein_4 NA 19.51963 19.72428 19.57163 #> protein_5 NA 18.97894 19.14153 18.64241 #> protein_6 18.92335 NA 18.91741 19.08084 #> protein_7 NA NA NA NA #> protein_8 19.15080 19.14821 18.38310 19.54753 #> protein_9 25.29130 26.09430 25.89340 25.85084 #> protein_10 NA NA NA 21.07692 #> Condition_2-2 Condition_2-3 #> protein_1 NA 18.53013 #> protein_2 NA NA #> protein_3 21.35948 21.69238 #> protein_4 NA 19.86350 #> protein_5 NA 19.38226 #> protein_6 18.92335 18.33081 #> protein_7 NA NA #> protein_8 19.21620 18.14628 #> protein_9 25.53341 25.93552 #> protein_10 21.31169 21.19959# If we assume that the first 5 proteins are spike-ins normalized_data2 <- median_normalization(syn_data$Y, spike_in_rows = 1:5)