Skip to contents

Exports an AlphaVarReportSpec to a YAML file for sharing or version control.

Usage

av_report_save_template(spec, file)

Arguments

spec

An AlphaVarReportSpec.

file

Path to the output YAML file.

Value

The file path invisibly.

Examples

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

group_col <- intersect(c("biosample_type", "output_type"), names(obj$data))[1]

spec <- av_report_template_default() |>
  av_report_add_block("plot_ranking",
    params = list(group_by = group_col),
    title = "Signal by biosample type")

yaml_file <- file.path(tempdir(), "alphavar_template.yaml")
av_report_save_template(spec, yaml_file)

writeLines(readLines(yaml_file, n = 6))
#> title: AlphaGenome Variant Analysis Report
#> blocks:
#> - block_id: section_header
#>   params:
#>     title: Dataset Summary
#>     level: 1