Tool based on oncoprint to explore and plot mutual exclusion patterns of gene alterations.
Install it from local source:
install.packages("/path/find.me", repos = NULL, type="source")
Or install it directly from GitHub:
devtools::install_github("hclimente/find.me")
This package can be used to create beautiful oncoprints in R.
library(find.me)
data(tcga_brca)
# vertical x-labels
vert_x <- theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust=.5))
oncoprint(tcga_brca) + coord_fixed() + vert_x
The main function (oncoprint(M)
) works on a matrix of strings on on this form:
gene sample alteration
1 BRCA2 TCGA-BH-A1EV-01 AMP;
2 BRCA2 TCGA-A2-A1FW-01 AMP;
3 BRCA2 TCGA-AO-A1KS-01 AMP;
4 BRCA2 TCGA-D8-A1JB-01 HOMDEL;
5 BRCA2 TCGA-D8-A1JD-01 HOMDEL;
6 BRCA2 TCGA-D8-A1JP-01 MUT;
The following alterations are allowed by default:
AMP
), red fillHOMDEL
), blue fillMUT
), black boxSPLICING
), green boxGERMLINE
), purple boxUP
), red outlineDOWN
), blue outlineEach element is modifiable by passing (defaults listed below)
keys=list(somatic="MUT", germline="GERMLINE", amp="AMP",
del="HOMDEL", upreg="UP", downreg="DOWN", splicing="SPLICING")
to the function call. Also, the genes can be sorted by most altered gene by passing sortGenes = TRUE
(default FALSE
, which keeps order from matrix). Samples are always sorted using an adaptation of the algorithm used in cBioPortal.
I implemented some methods to test the mutual exclusion in your data. Please, take into account that these tests will only make sense if you include all the analyzed samples, not only those with an alteration in the studied genes.
This test is described in Babur et al. as a scoring input for their algorithm to find mutual exclusion modules. It performs a Fisher's test to find unbalances between each of the genes and the aggregation of the rest. After correcting for multiple testing, returns the higher p-value as representative of the gene set.
library(find.me)
data(tcga_brca)
mutmat <- getSortedMatrix(tcga_brca)$mutmat
me.test.fisher(mutmat)
# [1] 6.495643e-17
I implemented the weight function W described in Dendrix paper as a statistic to measure the mutual exclusion. By permuting the mutation matrix keeping the number of alterations per gene constant, it calculates a distribution of W from which an empirical p-value is inferred. The minimum p-value is 1/(# permutations).
library(find.me)
data(tcga_brca)
mutmat <- getSortedMatrix(tcga_brca)$mutmat
# 10000 permutations
me.test.permutateSamples(mutmat, n=10000)
# [1] 1e-04
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.