Config YAML file parsing.
Public fields
tool(
character(1))
Tool name.config(
list())
Config list.raw_schemas_all(
tibble())
All raw schemas for tool.tidy_schemas_all(
tibble())
All tidy schemas for tool.
Methods
Examples
tool <- "tool1"
pkg <- "nemo"
conf <- Config$new(tool, pkg)
conf$get_raw_patterns()
#> # A tibble: 3 × 2
#> name value
#> <chr> <chr>
#> 1 table1 "\\.tool1\\.table1\\.tsv$"
#> 2 table2 "\\.tool1\\.table2\\.tsv$"
#> 3 table3 "\\.tool1\\.table3\\.tsv$"
(rv1 <- conf$get_raw_versions())
#> # A tibble: 4 × 2
#> name value
#> <chr> <chr>
#> 1 table1 v1.2.3
#> 2 table1 latest
#> 3 table2 latest
#> 4 table3 latest
conf$get_raw_descriptions()
#> # A tibble: 3 × 2
#> name value
#> <chr> <chr>
#> 1 table1 Table1 for tool1.
#> 2 table2 Table2 for tool1.
#> 3 table3 Table3 for tool1.
conf$get_raw_schemas_all()
#> # A tibble: 4 × 4
#> name tbl_description version schema
#> <chr> <chr> <chr> <list>
#> 1 table1 Table1 for tool1. v1.2.3 <tibble [5 × 2]>
#> 2 table1 Table1 for tool1. latest <tibble [7 × 2]>
#> 3 table2 Table2 for tool1. latest <tibble [3 × 2]>
#> 4 table3 Table3 for tool1. latest <tibble [5 × 2]>
conf$get_raw_schema("table1")
#> # A tibble: 12 × 5
#> name tbl_description version field type
#> <chr> <chr> <chr> <chr> <chr>
#> 1 table1 Table1 for tool1. v1.2.3 SampleID c
#> 2 table1 Table1 for tool1. v1.2.3 Chromosome c
#> 3 table1 Table1 for tool1. v1.2.3 Start i
#> 4 table1 Table1 for tool1. v1.2.3 End i
#> 5 table1 Table1 for tool1. v1.2.3 metricX d
#> 6 table1 Table1 for tool1. latest SampleID c
#> 7 table1 Table1 for tool1. latest Chromosome c
#> 8 table1 Table1 for tool1. latest Start i
#> 9 table1 Table1 for tool1. latest End i
#> 10 table1 Table1 for tool1. latest metricX d
#> 11 table1 Table1 for tool1. latest metricY d
#> 12 table1 Table1 for tool1. latest metricZ d
conf$get_raw_schema("table1", v = "v1.2.3")
#> # A tibble: 5 × 5
#> name tbl_description version field type
#> <chr> <chr> <chr> <chr> <chr>
#> 1 table1 Table1 for tool1. v1.2.3 SampleID c
#> 2 table1 Table1 for tool1. v1.2.3 Chromosome c
#> 3 table1 Table1 for tool1. v1.2.3 Start i
#> 4 table1 Table1 for tool1. v1.2.3 End i
#> 5 table1 Table1 for tool1. v1.2.3 metricX d
conf$are_raw_schemas_valid()
#> [1] TRUE
conf$get_tidy_descriptions()
#> # A tibble: 3 × 2
#> name value
#> <chr> <chr>
#> 1 table1 Table1 for tool1.
#> 2 table2 Table2 for tool1.
#> 3 table3 Table3 for tool1.
(ts1 <- conf$get_tidy_schemas_all())
#> # A tibble: 4 × 5
#> name tbl_description version tbl schema
#> <chr> <chr> <chr> <chr> <list>
#> 1 table1 Table1 for tool1. v1.2.3 tbl1 <tibble [5 × 3]>
#> 2 table1 Table1 for tool1. latest tbl1 <tibble [7 × 3]>
#> 3 table2 Table2 for tool1. latest tbl1 <tibble [3 × 3]>
#> 4 table3 Table3 for tool1. latest tbl1 <tibble [5 × 3]>
conf$get_tidy_schema("table1")
#> # A tibble: 12 × 7
#> name tbl_description version tbl field type description
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 table1 Table1 for tool1. v1.2.3 tbl1 sample_id c sample ID
#> 2 table1 Table1 for tool1. v1.2.3 tbl1 chromosome c chromosome
#> 3 table1 Table1 for tool1. v1.2.3 tbl1 start i start position
#> 4 table1 Table1 for tool1. v1.2.3 tbl1 end i end position
#> 5 table1 Table1 for tool1. v1.2.3 tbl1 metric_x d metric X
#> 6 table1 Table1 for tool1. latest tbl1 sample_id c sample ID
#> 7 table1 Table1 for tool1. latest tbl1 chromosome c chromosome
#> 8 table1 Table1 for tool1. latest tbl1 start i start position
#> 9 table1 Table1 for tool1. latest tbl1 end i end position
#> 10 table1 Table1 for tool1. latest tbl1 metric_x d metric X
#> 11 table1 Table1 for tool1. latest tbl1 metric_y d metric Y
#> 12 table1 Table1 for tool1. latest tbl1 metric_z d metric Z
conf$get_tidy_schema("table1", v = "v1.2.3")
#> # A tibble: 5 × 7
#> name tbl_description version tbl field type description
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 table1 Table1 for tool1. v1.2.3 tbl1 sample_id c sample ID
#> 2 table1 Table1 for tool1. v1.2.3 tbl1 chromosome c chromosome
#> 3 table1 Table1 for tool1. v1.2.3 tbl1 start i start position
#> 4 table1 Table1 for tool1. v1.2.3 tbl1 end i end position
#> 5 table1 Table1 for tool1. v1.2.3 tbl1 metric_x d metric X
conf$get_tidy_schema("table1", subtbl = "tbl1")
#> # A tibble: 12 × 7
#> name tbl_description version tbl field type description
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 table1 Table1 for tool1. v1.2.3 tbl1 sample_id c sample ID
#> 2 table1 Table1 for tool1. v1.2.3 tbl1 chromosome c chromosome
#> 3 table1 Table1 for tool1. v1.2.3 tbl1 start i start position
#> 4 table1 Table1 for tool1. v1.2.3 tbl1 end i end position
#> 5 table1 Table1 for tool1. v1.2.3 tbl1 metric_x d metric X
#> 6 table1 Table1 for tool1. latest tbl1 sample_id c sample ID
#> 7 table1 Table1 for tool1. latest tbl1 chromosome c chromosome
#> 8 table1 Table1 for tool1. latest tbl1 start i start position
#> 9 table1 Table1 for tool1. latest tbl1 end i end position
#> 10 table1 Table1 for tool1. latest tbl1 metric_x d metric X
#> 11 table1 Table1 for tool1. latest tbl1 metric_y d metric Y
#> 12 table1 Table1 for tool1. latest tbl1 metric_z d metric Z
