Create clone tree phylogenies from the package ctree, fitting the input data given to REVOLVER. A set of patient ids can be given as input, by default all are used. A parameter controls if you want to overwrite the trees of the patient, where they already computed. Please refer to the parameters of the ctrees constructor from package ctree for the input parameters that you can use to tune the construction.

compute_clone_trees(
  x,
  patients = Stats_cohort(x) %>% pull(patientID),
  overwrite = FALSE,
  ...
)

Arguments

x

A REVOLVER cohort.

patients

A set of patient ids in the cohort, for which the phylogenies are created.

overwrite

If TRUE, recompute trees even if already available.

...

Additional parameters forwarded to the ctree constructor.

Value

A REVOLVER cohort with clone tree phylogenies for the requested patients.

Examples

# Data released in the 'evoverse.datasets'
data('TRACERx_NEJM_2017_REVOLVER', package = 'evoverse.datasets')

print(TRACERx_NEJM_2017_REVOLVER)
#>  [ REVOLVER - Repeated Evolution in Cancer ] 
#> 
#> Dataset : TRACERx NEJM 2017 
#> Cohort  : 99 patients, 450 variants and 79 driver events. 
#> 
#> Trees per patient    : YES 
#> Fit via TL           : YES 
#> REVOLVER clustering  : YES 
#> Jackknife statistics : YES 
#>  
#> For summary statistics see `?Stats_*(x)` with * = {cohort, drivers, trees, fits, clusters, ...} 
#> 
#> ┌───────────────────────────────────────────────────────────────────────────────────────────┐
#>                                                                                            
#>    WARNING - Some patients have only one clone with drivers; they will just be expanded.   
#>                                                                                            
#> └───────────────────────────────────────────────────────────────────────────────────────────┘
#> # A tibble: 54 × 7
#>    patientID numBiopsies numMutations numDriverMutations numClonesWithDriver
#>    <chr>           <int>        <int>              <int>               <int>
#>  1 CRUK0007            2            3                  3                   1
#>  2 CRUK0010            2            3                  3                   1
#>  3 CRUK0012            2            1                  1                   1
#>  4 CRUK0018            4            4                  4                   1
#>  5 CRUK0019            2            1                  1                   1
#>  6 CRUK0021            2            4                  4                   1
#>  7 CRUK0025            3            3                  3                   1
#>  8 CRUK0026            2            4                  4                   1
#>  9 CRUK0028            2            2                  2                   1
#> 10 CRUK0029            6            4                  4                   1
#> # ℹ 44 more rows
#> # ℹ 2 more variables: numTruncalMutations <int>, numSubclonalMutations <int>

# We use the standard parameters with overwrite = TRUE
# otherwise the computation skips the patient
TRACERx_NEJM_2017_REVOLVER = compute_clone_trees(
   TRACERx_NEJM_2017_REVOLVER,
   patients = "CRUK0002",
   overwrite = TRUE)
#> 
#> ── Constructing Clone Trees [ctree - https://caravagn.github.io/ctree/] ────────
#> 
#> ── PatientID: CRUK0002 ─────────────────────────────────────────────────────────
#> 
#>  [ ctree ~ clone trees generator for CRUK0002 ] 
#> 
#> # A tibble: 4 × 7
#>   cluster nMuts is.driver is.clonal    R1    R2    R3
#>   <chr>   <int> <lgl>     <lgl>     <dbl> <dbl> <dbl>
#> 1 1           3 TRUE      FALSE      0     0.92  0   
#> 2 2           2 TRUE      TRUE       0.99  0.98  0.99
#> 3 5           1 TRUE      FALSE      0.78  0     0   
#> 4 6           1 TRUE      FALSE      0.96  0.03  0.98
#> 
#>  Trees per region 1, 2, 1
#>  Total 2 tree structures - search is exahustive
#> 
#> ── Ranking trees 
#>  2  trees with non-zero score, storing 2

Phylo(TRACERx_NEJM_2017_REVOLVER, 'CRUK0002', rank = 1)
#>  [ ctree - ctree rank 1/2 for CRUK0002 ] 
#> 
#> # A tibble: 4 × 7
#>   cluster nMuts is.driver is.clonal    R1    R2    R3
#>   <chr>   <int> <lgl>     <lgl>     <dbl> <dbl> <dbl>
#> 1 1           3 TRUE      FALSE      0     0.92  0   
#> 2 2           2 TRUE      TRUE       0.99  0.98  0.99
#> 3 5           1 TRUE      FALSE      0.78  0     0   
#> 4 6           1 TRUE      FALSE      0.96  0.03  0.98
#> 
#> Tree shape (drivers annotated)  
#> 
#>   \-GL
#>    \-2 :: MET, TERT
#>     |-6 :: EP300
#>     | \-5 :: NF1
#>     \-1 :: RB1, IKZF1, KRAS
#> 
#> Information transfer  
#> 
#>    MET ---> RB1 
#>    MET ---> IKZF1 
#>    MET ---> KRAS 
#>    TERT ---> RB1 
#>    TERT ---> IKZF1 
#>    TERT ---> KRAS 
#>    GL ---> MET 
#>    GL ---> TERT 
#>    EP300 ---> NF1 
#>    MET ---> EP300 
#>    TERT ---> EP300 
#> 
#> Tree score 0.75 
#>