Skip to content

Consider adding germline vs somatic facet as a first-class feature #194

@selkamand

Description

@selkamand

We've already produced the following plot types using ggoncoplot:

Image from https://academic.oup.com/neuro-oncology/article/27/7/1849/8071619

But its not easy and a mere hacky extension of pathway functionality.

We should add a 'col_facet' argument that allows us to facet the main oncoplot based on a categorical column of data. This is basically how pathway information is added (internally) but we could generalise, making it easier to split by either mutation level categories (germline/somatic) OR gene-level categories (pathway) - since both are easy to annotate on data.

The real question is how to sort samples across the facets & how to sort the facets. As always, sample order is based on gene order, so we just need to decide gene order. This is nontrivial. Should gene order be based on counts across all facets, or just one of the facets? Should gene rankings be done within each group. Gene X is rank 1 in one facet, but Gene Y is rank 1 in the other - which takes priority? Well whichever facet is higher up - but which should that be? User-specified? Autoselected based on data?

Heres an algorithm I think would work for somatic vs germline & also pathway annotations - based on the above plot:

  1. Identify genes_to_include: if topn=finite value then Rank genes ignoring facets. Gives an objective gene ranking and ability to choose the 'topN' genes.
  2. Rank each facet level using a 2 step sort
    a. count how many distinct 'topN' genes are mutated (e.g. how many rows in the oncoplot would this facet level require).
    b. To deal with facets including the same number of genes - Break ties based on how many unique samples would have mutations in the facets.
  3. Order facet levels based on (2).
  4. Rerank genes based on 1) facet order - all genes in the top facet should rank above those only in lower facets. 2) mutation freq in each facet.
  5. Order samples based on gene order as usual

What if user wants to change facet level order:

  1. Skip 1 & 2. Start by ordering facet levels based on user preference.
  2. Do (4) & (5) above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions