timescape: TimeScape

Description Usage Arguments Details Value Examples

View source: R/timescape.R

Description

timescape is a tool for visualizing temporal clonal evolution data.

Usage

1
2
3
4
5
timescape(clonal_prev, tree_edges, mutations = "NA", clone_colours = "NA",
  xaxis_title = "Time Point", yaxis_title = "Clonal Prevalence",
  phylogeny_title = "Clonal Phylogeny", alpha = 50,
  genotype_position = "stack", perturbations = "NA", sort = FALSE,
  show_warnings = TRUE, width = 900, height = NULL)

Arguments

clonal_prev

data.frame Clonal prevalence. Required columns are:

timepoint:

character() time point. Time points will be alphanumerically sorted in the view.

clone_id:

character() clone id.

clonal_prev:

numeric() clonal prevalence.

tree_edges

data.frame Tree edges of a rooted tree. Required columns are:

source:

character() source node id.

target:

character() target node id.

mutations

data.frame (Optional) Mutations occurring at each clone. Required columns are:

chrom:

character() chromosome number.

coord:

numeric() coordinate of mutation on chromosome.

clone_id:

character() clone id.

timepoint:

character() time point.

VAF:

numeric() variant allele frequency of the mutation in the corresponding timepoint.

Any additional field will be shown in the mutation table.

clone_colours

data.frame Clone ids and their corresponding colours. Required columns are:

clone_id:

character() clone id.

colour:

character() the corresponding Hex colour for each clone id.

xaxis_title

character() (Optional) x-axis title. Default is "Time Point".

yaxis_title

character() (Optional) y-axis title. Default is "Clonal Prevalence".

phylogeny_title

character() (Optional) Legend phylogeny title. Default is "Clonal Phylogeny".

alpha

numeric() (Optional) Alpha value for clonal sweeps, range [0, 100].

genotype_position

character() (Optional) How to position the genotypes from ["centre", "stack", "space"].

  1. centre: genotypes are centred with respect to their ancestors.

  2. stack: genotypes are stacked such that nogenotype is split at any time point.

  3. space: genotypes are stacked but with a bit of spacing at the bottom.

perturbations

data.frame (Optional) Any perturbations that occurred between two time points. Required columns are:

pert_name:

character() the perturbation name.

prev_tp:

character() the time point (as labelled in clonal prevalence data) BEFORE perturbation.

sort

logical() (Optional) Whether (TRUE) or not (FALSE) to vertically sort the genotypes by their emergence values (descending). Default is FALSE. Note that genotype sorting will always retain the phylogenetic hierarchy, and this parameter will only affect the ordering of siblings.

show_warnings

logical() (Optional) Whether or not to show any warnings. Default is TRUE.

width

numeric() (Optional) Width of the plot. Minimum width is 450.

height

numeric() (Optional) Height of the plot. Minimum height with and without mutations is 500 and 260, respectively.

Details

Interactive components:

  1. Mouseover any clone to view its (i) clone ID and (ii) clonal prevalence at each time point.

  2. Click the view switch button to switch from the traditional timescape view to the clonal trajectory view, where each clone changes prevalence on its own track.

  3. Click the download buttons to download a PNG or SVG of the view.

Value

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# EXAMPLE 1 - Acute myeloid leukemia patient, Ding et al., 2012

# genotype tree edges
tree_edges <- read.csv(system.file("extdata", "AML_tree_edges.csv", 
    package = "timescape"))

# clonal prevalences
clonal_prev <- read.csv(system.file("extdata", "AML_clonal_prev.csv",
    package = "timescape"))

# targeted mutations
mutations <- read.csv(system.file("extdata", "AML_mutations.csv", 
    package = "timescape"))

# perturbations
perturbations <- data.frame( pert_name = c("Chemotherapy"), 
                             prev_tp = c("Diagnosis"))

# run timescape
timescape(clonal_prev = clonal_prev, tree_edges = tree_edges, 
    perturbations = perturbations, mutations = mutations)

# EXAMPLE 2 - Patient 7, McPherson and Roth et al., 2016

# genotype tree edges
tree_edges <- read.csv(system.file("extdata", "px7_tree_edges.csv", 
    package = "timescape"))

# clonal prevalences
clonal_prev <- read.csv(system.file("extdata", "px7_clonal_prev.csv", 
    package = "timescape"))

# clone colours
clone_colours <- data.frame(clone_id = c("A","B","C","D","E"), 
                            colour = c("d0ced0", "2CD0AB", "FFD94B", 
                                     "FD8EE5", "F8766D"))

# run timescape
timescape(clonal_prev = clonal_prev, tree_edges = tree_edges, 
    clone_colours = clone_colours, height=260, alpha=15)

timescape documentation built on Nov. 8, 2020, 5:58 p.m.