write_cbio_clinical: Write cBioPortal clinical file

View source: R/cboilerplate.R

write_cbio_clinicalR Documentation

Write cBioPortal clinical file

Description

Wrapper function for creating clinical files. There are two: PATIENT and SAMPLE. The PATIENT file is actually optional, so there are only checks for making sure SAMPLE can be created. df is expected to be a table containing clinical data available, and maybe even some irrelevant data (since NF data is not well-normalized and there is a single table with everything).

Usage

write_cbio_clinical(
  df,
  ref_map,
  na_recode = c("NA", "NaN", "unknown", "Unknown"),
  delim = "\t",
  publish_dir = ".",
  verbose = TRUE
)

Arguments

df

A data.frame representing clinical dataset to publicize.

ref_map

YAML or JSON mapping. See details.

na_recode

Possible NA values to replace with a blank string (which seems to be standard) in exported file.

delim

Delimiter character used for writing file, defaults to tab-delimited per cBioPortal specs.

publish_dir

Directory path to write to, defaults to current.

verbose

Report where file has been written.

Details

This relies on a ref_map specification to know which clinical data to include for cBioPortal and how to segregate the clinical attributes into the right files. For example, say df contains clinical variables A-X, but mappings are only specified for variables A-C, L-M and others are not meant to be surfaced/made public. This will subset the df to what's specified in the mapping. Conversely, if there is a mapping for variable Z that is not in the clinical data, this will throw error.


nf-osi/nfportalutils documentation built on Feb. 26, 2024, 1:05 p.m.