Check GAMBL or other metadata for compatibility with various features.

check_gambl_metadata(
  metadata_df,
  to_check = "all",
  show_details = FALSE,
  fix = FALSE
)

Arguments

metadata_df

Data frame output by get_gambl_metadata or some other source of metadata you plan to use.

to_check

Specify one of "uniqueness", "colours" or "completeness" or leave empty to check all.

show_details

Set to TRUE if you want the gory details about issues that are identified.

fix

After identifying an issue, rerun this function with fix=TRUE to address errors (when possible). Currently this doesn't do anything. That's how I roll.

Details

Give this function a metadata output, preferably from get_gambl_metadata, or any other source. The function then checks for duplicate sample IDs, colours for all values in all columns that map to a colour with map_metadata_to_colours and missing columns.

Examples

this_metadata = get_gambl_metadata()
check_gambl_metadata(metadata_df = this_metadata)
#> PASSED uniqueness test for sample_id
#> COO_consensus OK
#> DHITsig_consensus OK
#> possible problem!
#> [1] "0.299 % of values not assigned to an available colour."
#> possible problem!
#> [1] "7.899 % of values not assigned to an available colour."
#> possible problem!
#> [1] "11.67 % of values not assigned to an available colour."
#> possible problem!
#> [1] "71.813 % of values not assigned to an available colour."
#> possible problem!
#> [1] "66.308 % of values not assigned to an available colour."
#> possible problem!
#> [1] "70.796 % of values not assigned to an available colour."
#> possible problem!
#> [1] "100 % of values not assigned to an available colour."