Skip to contents

Imports a YAML file and validates it against the block registry.

Usage

av_report_load_template(file)

Arguments

file

Path to a YAML file.

Value

An AlphaVarReportSpec object.

Examples

example_file <- system.file("extdata", "bcl11a_rs1427407_example.csv",
                            package = "AlphaVaR")
obj <- av_import_csv(example_file)
#> Reading bcl11a_rs1427407_example.csv ...

yaml_file <- file.path(tempdir(), "shared_template.yaml")
av_report_save_template(av_report_template_default(), yaml_file)

spec <- av_report_load_template(yaml_file)
spec
#> === AlphaVarReportSpec ===
#> Title: AlphaGenome Variant Analysis Report 
#> Blocks: 27 
#> 
#>   [1] [section]    Section Header
#>   [2] [text]       Markdown Text Block
#>   [3] [table]      QC Summary Table
#>   [4] [plot]       Ridge Plot
#>   [5] [section]    Section Header
#>   [6] [text]       Markdown Text Block
#>   [7] [plot]       Genome Browser View (Interval)
#>   [8] [section]    Section Header
#>   [9] [text]       Markdown Text Block
#>   [10] [plot]       Cumulative Distribution (ECDF)
#>   [11] [plot]       Effect Directionality
#>   [12] [table]      Enrichment Statistics Table
#>   [13] [plot]       Enrichment Volcano Plot
#>   [14] [table]      Gene Impact Table
#>   [15] [section]    Section Header
#>   [16] [text]       Markdown Text Block
#>   [17] [plot]       Enrichment Volcano Plot
#>   [18] [table]      Enrichment Statistics Table
#>   [19] [plot]       Specificity (Tau) per Unit
#>   [20] [table]      Gene Impact Table
#>   [21] [section]    Section Header
#>   [22] [table]      Target Gene Assignment Table
#>   [23] [table]      Gene Impact Table
#>   [24] [plot]       Ranking Boxplot
#>   [25] [plot]       Ridge Plot
#>   [26] [section]    Section Header
#>   [27] [table]      Variant Table

# A template travels between datasets, so its grouping columns are only
# guaranteed to exist in the dataset it was written for.
group_cols <- unique(unlist(lapply(spec$blocks, function(b) b$params$group_by)))
group_cols %in% names(obj$data)
#> [1] TRUE TRUE TRUE