Writes a contrasts.tsv file and a metadata.yaml sidecar file to the specified directory. Accepts prolfqua-native column names and renames them to the standardized snake_case format.

write_contrast_results(data, path, metadata, col_map = .col_map_to_standard)

Arguments

data

data.frame with contrast results (one row per protein x contrast)

path

directory to write to (created if it does not exist)

metadata

list with required fields: dataset, method, method_description, input_file, software_version, date, and ground_truth

col_map

named character vector mapping input column names to standard names. Defaults to the prolfqua-native mapping. Names are input columns, values are output columns.

Value

Invisibly returns the path written to.

Examples

if (FALSE) { # \dontrun{
metadata <- list(
  dataset = "ionstar_maxquant",
  method = "prolfqua_lm_mod",
  method_description = "Linear model with variance moderation",
  input_file = "MAXQuant_IonStar2018_PXD003881.zip/evidence.txt",
  input_level = "peptide",
  aggregation = "median_polish",
  normalization = "robscale",
  software_version = paste0("prolfqua ", packageVersion("prolfqua")),
  date = Sys.Date(),
  contrasts = c("dilution_(4.5/3)_1.5", "dilution_(6/4.5)_1.3(3)"),
  ground_truth = list(
    id_column = "protein_id",
    positive = list(label = "ECOLI", pattern = "ECOLI"),
    negative = list(label = "HUMAN", pattern = "HUMAN")
  )
)
write_contrast_results(contrast_data, "/tmp/ionstar_lm", metadata)
} # }