Skip to contents

Genes are ordered by descending alteration frequency, then samples are ordered so that the most frequently altered gene's carriers come first, ties broken by the next gene down. This is the "memo sort" cBioPortal popularised; it is what makes mutual exclusivity between drivers visible as a staircase.

Usage

oncoplot_memo_sort(alterations, genes = NULL, samples = NULL)

Arguments

alterations

A data frame with columns gene, sample and class.

genes

Optional character vector to use instead of the derived gene order.

samples

Optional character vector to use instead of the derived sample order.

Value

A list with genes and samples character vectors.

Details

Exposed separately so a caller can compute the order once and reuse it for both an interactive oncoplot() and a static rendering, rather than letting two implementations tie-break differently.