Skip to contents

Helper functions to get processed experiment, plots, tables or data from a glysmith result object.

Usage

cast_exp(x)

cast_plot(x, name = NULL)

cast_table(x, name = NULL)

cast_data(x, name = NULL)

Arguments

x

A glysmith result object.

name

The name of the plot or table to get. If not specified, return available names.

Value

Examples

library(glyexp)
exp <- real_experiment2
result <- forge_analysis(exp)
#>  Identification overview
#>  Identification overview [80ms]
#> 
#>  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 [6.5s]
#> 
#>  QC (post-preprocessing)
#>  QC (post-preprocessing) [149ms]
#> 
#>  Principal component analysis
#>  Principal component analysis [594ms]
#> 
#>  Differential expression analysis (limma)
#> Registered S3 methods overwritten by 'FSA':
#>   method       from
#>   confint.boot car 
#>   hist.boot    car 
#>  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) [193ms]
#> 
#>  Volcano plot
#>  Volcano plot [540ms]
#> 
#>  Heatmap of significant variables
#>  Heatmap of significant variables [95ms]
#> 
#>  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 [7.7s]
#> 
#>  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) [57ms]
#> 
#>  Heatmap of significant traits
#>  Heatmap of significant traits [40ms]
#> 
cast_exp(result)
#> 
#> ── Glycomics Experiment ────────────────────────────────────────────────────────
#>  Expression matrix: 144 samples, 57 variables
#>  Sample information fields: group <fct>
#>  Variable information fields: glycan_composition <comp>, glycan_structure <struct>
cast_table(result)
#> [1] "summary"         "pca_samples"     "pca_variables"   "pca_eigenvalues"
#> [5] "dea"             "derived_traits"  "dta"            
cast_table(result, "summary")
#> # A tibble: 4 × 2
#>   item                       n
#>   <chr>                  <dbl>
#> 1 total_composition       67  
#> 2 total_structure         67  
#> 3 composition_per_sample  52.7
#> 4 structure_per_sample    52.7