Skip to contents

This function performs a comprehensive analysis for group comparison.

Usage

forge_analysis(exp, blueprint = blueprint_default(), group_col = "group")

Arguments

exp

A glyexp::experiment() object.

blueprint

A glysmith_blueprint object. Default is blueprint_default().

group_col

Column name of group information in the sample information. Used for various analyses. Default is "group".

Value

A glysmith_result object, with the following components:

  • exp: the experiment after preprocessing.

  • plots: a named list of ggplot objects.

  • tables: a named list of tibbles.

  • meta: a named list of metadata, containing:

    • explanation: a named character vector or list of explanations for each plot and table, with keys like tables$summary and plots$pca.

    • steps: a character vector of the steps of the analysis.

    • log: the messages and outputs from each step.

  • blueprint: the blueprint used for the analysis.

Examples

exp <- glyexp::real_experiment2
result <- forge_analysis(exp)
#>  Identification overview
#>  Identification overview [127ms]
#> 
#>  Preprocessing
#> 
#>  Preprocessing

#> ── Removing variables with too many missing values ──
#>  Preprocessing

#> 
#>  Preprocessing

#>  No QC samples found. Using all samples.
#>  Preprocessing

#>  Applying preset "discovery"...
#>  Preprocessing

#>  Total removed: 10 (14.93%) variables.
#>  Preprocessing

#>  Variable removal completed.
#>  Preprocessing

#> 
#>  Preprocessing

#> ── Normalizing data ──
#>  Preprocessing

#> 
#>  Preprocessing

#>  No QC samples found. Using default normalization method based on experiment type.
#>  Preprocessing

#>  Experiment type is "glycomics". Using `normalize_median_quotient()` + `normalize_total_area()`.
#>  Preprocessing

#>  Normalization completed.
#>  Preprocessing

#> 
#>  Preprocessing

#> ── Normalizing data (Total Area) ──
#>  Preprocessing

#> 
#>  Preprocessing

#>  Total area normalization completed.
#>  Preprocessing

#> 
#>  Preprocessing

#> ── Imputing missing values ──
#>  Preprocessing

#> 
#>  Preprocessing

#>  No QC samples found. Using default imputation method based on sample size.
#>  Preprocessing

#>  Sample size > 100, using `impute_miss_forest()`.
#>  Preprocessing

#>  Imputation completed.
#>  Preprocessing

#> 
#>  Preprocessing

#> ── Correcting batch effects ──
#>  Preprocessing

#> 
#>  Preprocessing

#>  Batch column  not found in sample_info. Skipping batch correction.
#>  Preprocessing

#>  Batch correction completed.
#>  Preprocessing

#>  Preprocessing [5.6s]
#> 
#>  QC (post-preprocessing)
#>  QC (post-preprocessing) [121ms]
#> 
#>  Principal component analysis
#>  Principal component analysis [297ms]
#> 
#>  Differential expression analysis (limma)
#>  Number of groups: 4
#>  Differential expression analysis (limma)

#>  Groups: "H", "M", "Y", and "C"
#>  Differential expression analysis (limma)

#>  Pairwise comparisons will be performed, with levels coming first as reference groups.
#>  Differential expression analysis (limma)

#>  Differential expression analysis (limma) [59ms]
#> 
#>  Volcano plot
#>  Volcano plot [526ms]
#> 
#>  Heatmap of significant variables
#>  Heatmap of significant variables [42ms]
#> 
#>  Skipping `step_sig_enrich_go()` because input is not a glycoproteomics experiment and input has more than 2 groups.
#>  Skipping `step_sig_enrich_kegg()` because input is not a glycoproteomics experiment and input has more than 2 groups.
#>  Skipping `step_sig_enrich_reactome()` because input is not a glycoproteomics experiment and input has more than 2 groups.
#>  Derived trait calculation
#>  Derived trait calculation [2.1s]
#> 
#>  Differential trait analysis (limma)
#>  Number of groups: 4
#>  Differential trait analysis (limma)

#>  Groups: "H", "M", "Y", and "C"
#>  Differential trait analysis (limma)

#>  Pairwise comparisons will be performed, with levels coming first as reference groups.
#>  Differential trait analysis (limma)

#>  Differential trait analysis (limma) [56ms]
#> 
#>  Heatmap of significant traits
#>  Heatmap of significant traits [40ms]
#> 
print(result)
#> 
#> ── GlySmith Analysis Result 
#> Plots: 16, Tables: 7, Data: 7