From a cohort object, this function extracts the tree objects that are available for a patient. Parameters can be set to retrieve a particular tree, or the fit tree which is however availble only after fitting the cohort data. This function can either return a phylogenetic clone tree (R object ctree), or mutation trees (R object btree). Besides, it can return the information transfer as the ordering of the annotated drivers, or in terms o the ordering of the clones these map to.

ITransfer(x, p, rank = 1, type = "drivers", data = "trees")

Arguments

x

A REVOLVER cohort.

p

The id of a patient in the cohort.

rank

The rank of the tree to extract.

type

Either `drivers` or `clones`.

data

Either `trees` or `fit`, which requires to have already computed the fit of the input cohort.

Value

The information transfer for the tree of a patient

Examples

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

# Get the transfer among drivers, top-ranking tree
ITransfer(TRACERx_NEJM_2017_REVOLVER, 'CRUK0002', rank = 1, type = 'drivers')
#> # A tibble: 11 × 2
#>    from  to   
#>    <chr> <chr>
#>  1 MET   RB1  
#>  2 MET   IKZF1
#>  3 MET   KRAS 
#>  4 TERT  RB1  
#>  5 TERT  IKZF1
#>  6 TERT  KRAS 
#>  7 GL    MET  
#>  8 GL    TERT 
#>  9 EP300 NF1  
#> 10 MET   EP300
#> 11 TERT  EP300

# Get the transfer among clones, top-ranking tree
ITransfer(TRACERx_NEJM_2017_REVOLVER, 'CRUK0002', rank = 1, type = 'clones')
#> # A tibble: 4 × 2
#>   from  to   
#>   <chr> <chr>
#> 1 2     1    
#> 2 GL    2    
#> 3 6     5    
#> 4 2     6    

# Get the transfer from the fit
ITransfer(TRACERx_NEJM_2017_REVOLVER, 'CRUK0002', rank = 1, type = 'clones', data = 'fits')
#> # A tibble: 4 × 2
#>   from  to   
#>   <chr> <chr>
#> 1 2     1    
#> 2 GL    2    
#> 3 6     5    
#> 4 2     6    
ITransfer(TRACERx_NEJM_2017_REVOLVER, 'CRUK0002', rank = 1, type = 'drivers', data = 'fits')
#> # A tibble: 7 × 2
#>   from  to   
#>   <chr> <chr>
#> 1 GL    MET  
#> 2 MET   TERT 
#> 3 TERT  EP300
#> 4 TERT  RB1  
#> 5 TERT  IKZF1
#> 6 TERT  KRAS 
#> 7 EP300 NF1