olink_norm_input_check {OlinkAnalyze} | R Documentation |
Check inputs of olink_normalization
function.
Description
This function is a wrapper of multiple help functions which check the inputs
of the olink_normalization
function.
Usage
olink_norm_input_check(
df1,
df2,
overlapping_samples_df1,
overlapping_samples_df2,
df1_project_nr,
df2_project_nr,
reference_project,
reference_medians
)
Arguments
df1 |
First dataset to be used in normalization (required). |
df2 |
Second dataset to be used in normalization. |
overlapping_samples_df1 |
Samples to be used for adjustment factor calculation in df1 (required). |
overlapping_samples_df2 |
Samples to be used for adjustment factor calculation in df2. |
df1_project_nr |
Project name of first dataset (df1). |
df2_project_nr |
Project name of first dataset (df2). |
reference_project |
Project name of reference_project. Should be one of df1_project_nr or df2_project_nr. Indicates the project to which the other project is adjusted to. |
reference_medians |
Dataset with columns "OlinkID" and "Reference_NPX". Used for reference median normalization. |
Details
The following checks are performed:
-
Determines the normalization to be performed by intersecting inputs with internal global variable
olink_norm_mode_combos
.Returns the type of normalization to be performed from
olink_norm_modes
.Message with the normalization type.
Error message if input is invalid.
-
Checks if all inputs are of the expected class:
-
df1
,df2
andreference_medians
: tibble or R6 ArrowObject -
overlapping_samples_df1
,overlapping_samples_df2
,df1_project_nr
,df2_project_nr
andreference_project
: Character vector
-
Also checks the validity of names of project and reference project.
Error if invalid input classes are detected.
-
olink_norm_input_check_df_cols
:Detects the column names of input datasets
df1
anddf2
to allow for alternative names.Returns named list of column names to use downstream.
Warning if
Normalization
column missing from all datasets.Warning if
LOD
is missing or if there are multipleLOD
columns.Error if required columns are missing.
Error if not all input datasets have or lack
Normalization
column.Error if input datasets have been quantified with different methods.
-
Checks validity of dataset containing
reference_medians
.Error if required columns are missing based on
olink_norm_ref_median_cols
.Error if columns are not of the correct class bases on
olink_norm_ref_median_cols
.Error if there duplicate assay identifiers.
-
olink_norm_input_check_samples
:Check character vectors of reference sample identifiers for:
Being present in
df1
and/ordf2
.Duplicate identifiers.
-
olink_norm_input_clean_assays
:Returns a named list with the updated
df1
,df2
and/orreference_medians
.Removes assays that are not of the format OID followed by 5 digits.
Removes assays that are marked with
Normalization = EXCLUDED
.
-
olink_norm_input_assay_overlap
:Returns a named list with the updated
df1
,df2
and/orreference_medians
.Remove assays not shared between
df1
anddf2
, or betweendf1
andreference_medians
.
-
Check if all assays in
df1
anddf2
have been originally normalized with the same method "Intensity" or "Plate control".Warning is thrown if not.
Value
Named list of updated inputs to use for normalization:
-
df1
: dataset df1. -
df2
:NULL
if reference median normalization, or dataset df2. -
overlapping_samples_df1
: character vector of reference samples from df1. -
overlapping_samples_df2
:NULL
if reference median normalization, or character vector of reference samples from df1. -
df1_project_nr
: name of df1 project. -
df2_project_nr
:NULL
if reference median normalization, or name of df2 project. -
reference_project
:NULL
if reference median normalization, or name of reference project. -
reference_medians
:NULL
if bridge or subset normalization, or dataset with reference_medians. -
df1_cols
: column names of df1 to use downstream. -
df2_cols
:NULL
if reference median normalization, or column names of df2 to use downstream. -
norm_mode
: one of bridge, subset, ref_median, and norm_ht_3k indicating the normalization to be performed.
Author(s)
Klev Diamanti