Learn R Programming

SITH (version 1.1.0)

spatialDistribution: Quantify the spatial distribution of mutants

Description

Provides a summary the spatial distribution of mutants within the simulated tumor.

Usage

spatialDistribution(tumor, N = 500, cutoff = 0.01, make.plot = TRUE)

Arguments

tumor

A list which is the output of simulateTumor().

N

The number of pairs to sample.

cutoff

For a plot of clone sizes, all mutations with a MAF below cutoff are ignored.

make.plot

Whether or not to make plots.

Value

A list with the following components

  • mean_mutant - A data frame with 2 columns giving the mean number of mutants as a function of Euclidean distance from the lattice origin (Euclid. distance rounded to nearest integer).

  • mean_driver - The same as mean_mutant except for driver mutations only. Will be NULL if no drivers are present in the simulated tumor.

  • jaccard A data frame with two columns giving mean jaccard index as a function of Euclidean distance between pairs of cells (rounded to nearest integer).

Details

The genotype of a cell can be interpreted as a binary vector where the \(i\)-th component is 1 if mutation \(i\) is present in the cell and is 0 otherwise. Then a natural comparison of the similarity between two cells is the Jaccard index \(J(A,B) = |I(A,B)|/|U(A,B)|\), where \(I(A,B)\) is the intersection of \(A\) and \(B\) and \(U(A,B)\) is the union. This function estimates the Jaccard index as a function of Euclidean distance between the cells by randomly sampling \(N\) pairs of cells.

Examples

Run this code
# NOT RUN {
set.seed(1126490984)
out <- simulateTumor(max_pop = 1000, driver_prob = 0.1)
sp <- spatialDistribution(tumor = out, make.plot = FALSE)

# }

Run the code above in your browser using DataLab