
Get Data from GlySmith Result
cast_exp.RdHelper functions to get processed experiment, plots, tables or data from a glysmith result object.
Value
cast_exp(): aglyexp::experiment().cast_plot(): aggplot2::ggplot().cast_table(): atibble::tibble().cast_data(): can be any R object.
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