Extract the marginal probabilities from a TRONCO model. The return matrix is indexed with rownames which represent genotype keys - these can be resolved with function keysToNames. It is possible to specify a subset of events to build the matrix, a subset of models if multiple reconstruction have been performed. Also, either the observed or fit probabilities can be extracted.

as.marginal.probs(
  x,
  events = as.events(x),
  models = names(x$model),
  type = "observed"
)

Arguments

x

A TRONCO model.

events

A subset of events as of as.events(x), all by default.

models

A subset of reconstructed models, all by default.

type

observed.

Value

The marginal probabilities in a TRONCO model.

Examples

data(test_model)
as.marginal.probs(test_model)
#> $capri_bic
#>          marginal probability
#> gene 4             0.07416667
#> gene 5             0.02946970
#> gene 7             0.16984848
#> gene 29            0.35257576
#> gene 30            0.07954545
#> gene 31            0.02962121
#> gene 32            0.07318182
#> gene 33            0.14984848
#> gene 34            0.07045455
#> gene 36            0.03295455
#> gene 40            0.02727273
#> gene 44            0.02916667
#> gene 47            0.02984848
#> gene 49            0.02750000
#> gene 50            0.03166667
#> gene 51            0.02954545
#> gene 52            0.03068182
#> gene 53            0.03166667
#> gene 54            0.03060606
#> gene 55            0.10598485
#> gene 56            0.05242424
#> gene 66            0.02886364
#> gene 69            0.02916667
#> gene 77            0.05113636
#> gene 88            0.12439394
#> gene 89            0.02810606
#> gene 91            0.10007576
#> gene 111           0.07856061
#> XOR_EZH2           0.19787879
#> OR_CSF3R           0.15500000
#> 
#> $capri_aic
#>          marginal probability
#> gene 4             0.07416667
#> gene 5             0.02946970
#> gene 7             0.16984848
#> gene 29            0.35257576
#> gene 30            0.07954545
#> gene 31            0.02962121
#> gene 32            0.07318182
#> gene 33            0.14984848
#> gene 34            0.07045455
#> gene 36            0.03295455
#> gene 40            0.02727273
#> gene 44            0.02916667
#> gene 47            0.02984848
#> gene 49            0.02750000
#> gene 50            0.03166667
#> gene 51            0.02954545
#> gene 52            0.03068182
#> gene 53            0.03166667
#> gene 54            0.03060606
#> gene 55            0.10598485
#> gene 56            0.05242424
#> gene 66            0.02886364
#> gene 69            0.02916667
#> gene 77            0.05113636
#> gene 88            0.12439394
#> gene 89            0.02810606
#> gene 91            0.10007576
#> gene 111           0.07856061
#> XOR_EZH2           0.19787879
#> OR_CSF3R           0.15500000
#> 
as.marginal.probs(test_model, events=as.events(test_model)[5:15,])
#> $capri_bic
#>         marginal probability
#> gene 30           0.07954545
#> gene 31           0.02962121
#> gene 32           0.07318182
#> gene 33           0.14984848
#> gene 34           0.07045455
#> gene 36           0.03295455
#> gene 40           0.02727273
#> gene 44           0.02916667
#> gene 47           0.02984848
#> gene 49           0.02750000
#> gene 50           0.03166667
#> 
#> $capri_aic
#>         marginal probability
#> gene 30           0.07954545
#> gene 31           0.02962121
#> gene 32           0.07318182
#> gene 33           0.14984848
#> gene 34           0.07045455
#> gene 36           0.03295455
#> gene 40           0.02727273
#> gene 44           0.02916667
#> gene 47           0.02984848
#> gene 49           0.02750000
#> gene 50           0.03166667
#>