revolver_fit: Fit a REVOLVER model.

View source: R/revolver_fit.R

revolver_fitR Documentation

Fit a REVOLVER model.

Description

This function implements the main fitting function for REVOLVER, which is a 2-steps algorithm described in the REVOLVER paper (Caravagna et al., Nature Methods volume 15, pages 707–714, 2018; https://www.nature.com/articles/s41592-018-0108-x).

To run the fit the cohort needs not to throw any error when function revolver_check_cohort is run with parameter stopOnError = TRUE. The trees of the patients need to be computed as well.

The output object contains a new field '$fit' which contains the fit results, and is of a new S3 class called 'rev_cohort_fit' which has its own S3 methods.

Usage

revolver_fit(x, initial.solution = 1, max.iterations = 10, n = 10, ...)

Arguments

x

A REVOLVER cohort where trees per patient have been already computed.

initial.solution

Either a scalar to fix one initial condition (rank id), or NA to sample it randomly across all possivle solutions. Notice that if the inital conditin is fixed the other parameter 'n' should be 1.

max.iterations

Maximum number of EM steps before forcing stop.

n

Number of initial conditions sampled to compute optimal fit.

...

Parameters forwarded to a run call of package easypar, which can be customised for parallel fit, caching or other parameters.

Value

A new object of class "rev_cohort_fit" which represents a REVOLVER cohort object with fits available.

References

Caravagna et al., Nature Methods volume 15, pages 707–714, 2018; https://www.nature.com/articles/s41592-018-0108-x

See Also

Other Analysis functions: revolver_cluster()

Examples

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

revolver_fit(TRACERx_NEJM_2017_REVOLVER)

caravagn/revolver documentation built on May 21, 2022, 5:48 p.m.