For a patient it is possible to add a set of precomputed trees, which need to be stored as adjacency matrices, and must be scored and ranked by scoring. The trees must have as nodes all the clusters that are annotated in the data of the patient. If the patient has already some trees, these are overwritten.
input_custom_trees(x, patient, trees, scores)A modififed REVOLVER cohort with available phylogeneis for patient.
Other Cohort creation:
CCF_parser(),
compute_clone_trees(),
compute_mutation_trees(),
revolver_check_cohort(),
revolver_cohort()
# Data released in the 'evoverse.datasets'
data('TRACERx_NEJM_2017_REVOLVER', package = 'evoverse.datasets')
# To make it simple we use some trees that are already available
trees = Phylo(TRACERx_NEJM_2017_REVOLVER, p = "CRUK0001")
# Get matrices from these objects, and remove the GL columns/rows
matrices = lapply(trees, function(x) {
m = x$adj_mat
m[rownames(m) != 'GL', colnames(m) != 'GL']
})
print(matrices)
#> $`1`
#> 1 3 5 2
#> 1 0 0 1 0
#> 3 1 0 0 1
#> 5 0 0 0 0
#> 2 0 0 0 0
#>
#> $`2`
#> 2 3 5 1
#> 2 0 0 1 0
#> 3 1 0 0 1
#> 5 0 0 0 0
#> 1 0 0 0 0
#>
#> $`3`
#> 1 5 3 2
#> 1 0 1 0 0
#> 5 0 0 0 1
#> 3 1 0 0 0
#> 2 0 0 0 0
#>
# Get scores for these matrices - vector format
scores = sapply(trees, function(x) x$score)
print(scores)
#> 1 2 3
#> 0.1111111 0.1111111 0.1111111
# Add these trees - this function overwrites the original ones
TRACERx_NEJM_2017_REVOLVER = input_custom_trees(
TRACERx_NEJM_2017_REVOLVER,
patient = "CRUK0001",
trees = matrices,
scores = scores
)
#>
#> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#> Using custom trees for CRUK0001
#> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#>
#> Combinations of Information Transfer : 3
#>