
Automatic Data Preprocessing
auto_clean.RdPerform automatic data preprocessing on glycoproteomics or glycomics data. This function applies an intelligent preprocessing pipeline that includes normalization, missing value handling, imputation, aggregation (for glycoproteomics data), and batch effect correction.
For glycomics data, this function calls these functions in sequence:
For glycoproteomics data, this function calls these functions in sequence:
Usage
auto_clean(
exp,
group_col = "group",
batch_col = "batch",
remove_preset = "discovery",
batch_prop_threshold = 0.3,
check_batch_confounding = TRUE,
batch_confounding_threshold = 0.4,
standardize_variable = TRUE
)Arguments
- exp
A
glyexp::GlycomicSE()orglyexp::GlycoproteomicSE()object.- group_col
The column name in sample_info for groups. Default is "group". Can be NULL when no group information is available.
- batch_col
The column name in sample_info for batches. Default is "batch". Can be NULL when no batch information is available.
- remove_preset
The preset for removing variables. Default is "discovery". Available presets:
"simple": remove variables with more than 50% missing values.
"discovery": more lenient, remove variables with more than 80% missing values, but ensure less than 50% of missing values in at least one group.
"biomarker": more strict, remove variables with more than 40% missing values, and ensure less than 60% of missing values in all groups.
- batch_prop_threshold
The proportion of variables that must show significant batch effects to perform batch correction. Default is 0.3 (30%).
- check_batch_confounding
Whether to check for confounding between batch and group variables. Default to TRUE.
- batch_confounding_threshold
The threshold for Cramer's V to consider batch and group variables highly confounded. Only used when
check_batch_confoundingis TRUE. Default to 0.4.- standardize_variable
Whether to call
glyexp::standardize_variable()after aggregation. Set toFALSEto skip network calls for faster testing. Default isTRUE.
Examples
library(glyexp)
exp <- real_experiment
auto_clean(exp)
#>
#> ── Removing variables with too many missing values ──
#>
#> ℹ Applying preset "discovery"...
#> ℹ Total removed: 24 (0.56%) variables.
#> ✔ Variable removal completed.
#>
#> ── Normalizing data ──
#>
#> ℹ Normalization method: `normalize_median()`
#> ℹ Reason: default for "glycoproteomics".
#> ✔ Normalization completed.
#>
#> ── Imputing missing values ──
#>
#> ℹ Imputation method: `impute_min_prob()`
#> ℹ Reason: default for "glycoproteomics" with n_samples < 30.
#> ✔ Imputation completed.
#>
#> ── Aggregating data ──
#>
#> ℹ Aggregating to "gfs" level
#> ✔ Aggregation completed.
#>
#> ── Normalizing data again ──
#>
#> ℹ Normalization method: `normalize_median()`
#> ℹ Reason: default for "glycoproteomics".
#> ✔ Normalization completed.
#>
#> ── Correcting batch effects ──
#>
#> ℹ Batch column batch not found in sample_info. Skipping batch correction.
#> ✔ Batch correction completed.
#>
#> ── GlycoproteomicSE ────────────────────────────────────────────────────────────
#> ℹ Abundance assay: 12 samples, 3979 variables
#> ℹ Glycan type: N
#> ℹ Row data fields: protein <chr>, glycan_composition <comp>, glycan_structure <struct>, protein_site <int>, gene <chr>
#> ℹ Column data fields: group <fct>
#> ℹ Metadata fields: exp_type <chr>, glycan_type <chr>, quant_method <chr>