Before you begin

You should have identified true somatic variants in the mitochondrial (and nuclear) genome. The remaining vignettes of this package document how to get there. Here, we start with count matrices of the alternative and the reference alleles, across a number of sites of interest. Such data is available from two patients (P1, P2) as part of this package.

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(mitoClone)
P1 <- mutationCallsFromMatrix(as.matrix(M_P1), as.matrix(N_P1))
P2 <- mutationCallsFromMatrix(as.matrix(M_P2), as.matrix(N_P2))

A first important step is to decide which mutations to include in the clustering. The default is to use all mutations that are covered in at least 20% of the cells, but this assignment can be changed manually. For P2, we removed two variants that were mutant in a small fraction of cells. Feel free to include them or not, it barely affects the result.

P2@cluster["X9010GC"] <- F
P2@cluster["X2392TC"] <- F

Compute a phylogenetic tree

The next step is to run PhISCS to compute the most likely phylogenetic tree. PhISCS is bundled in this package, but the package needs to be run in an environment where gurobi and the gurobipy python package are available. For example, you could set up a conda environment that contains this package. Please be sure to set the python_env variable appropriately for accessing your installation of gurobipy.

P1 <- muta_cluster(P1, cores=4, tempfolder = paste0(getwd(),"/P342debug"))
P2 <- muta_cluster(P2, cores=4, tempfolder = paste0(getwd(),"/P101debug"))

This step can take a while to run. It computes a likely phylogenetic tree of all the mutations. If you have graphviz (dot) installed, you can create postscript files displaying these plots:

plotTree(P1, file = "P1.ps")
plotTree(P2, file = "P2.ps")

Identify clones and assign cells to clones

In many cases, the order of the leaves on these trees is arbitrary, because mutations systematically co-occur. We therefore cluster the mutations into clones. In detail, we take every every branch on the tree and then shuffle the order of mutations in that branch while re-calculating the likelihood. If swapping nodes leads to small changes in the likelihood, these nodes are then merged into a "clone". The parameter min.lik that controls the merging is set arbitrarily, see below for more information.

P1 <- clusterMetaclones(P1, min.lik =1)
P2 <- clusterMetaclones(P2, min.lik =1)

This step also assigns each cell to the most likely clone, and provides an estimate of the likelihood. The help(mutationCalls) for more info on how these results are stored.

Finally, the clustering can be plotted.

plotClones(P1)
plotClones(P2)

Parameter choice

The parameter min.lik that controls the merging is set arbitrarily. In practice, the goal of these analyses is to group mutations into clones for subsequent analyses (such as differential expression analyses) and it may make sense to overwrite the result of clusterMetaclones manually; for example, if a subclone defned on a mitochondrial mutation only should be treated as part of a more clearly defined upstream clone for differential expression analysis.

To overwrite the result of clusterMetaclones, first retrieve the assignment of mutations to clones:

m2c <- getMut2Clone(P1)
print(m2c)

To e.g. treat the mt:2537G>A and mt:14462:G>A mutations as a subclone distinct from CEBPA, we can assign a new clonal identity to them while respecting the hierarchy:

m2c[c("X2537GA","X14462GA")] <- as.integer(6)
P1.new <- overwriteMetaclones(P1, m2c)
plotClones(P1.new)


veltenlab/mitoClone documentation built on April 18, 2021, 5:19 a.m.