Assemble a figure that plots a graph (or tree) per cluster where each driver is connected to its trajectories. This allows to determine the most frequent trajectories in a cluster.

plot_trajectories_per_cluster(x, min_counts = 5)

Arguments

x

A revolver object with clusters computed.

min_counts

A scalare >= 1 to subset only trajectories observed in min_counts patients. If the value is in (0,1), the cut is interpreted as a percentage and used to determine its actual value from the cluster size (e.g., n * min_counts).

Value

A figure with multiple plots.

Examples

# Data released in the 'evoverse.datasets' data('TRACERx_NEJM_2017_REVOLVER', package = 'evoverse.datasets') # In at least 5 cases plot_trajectories_per_cluster(TRACERx_NEJM_2017_REVOLVER, min_counts = 5)
#> Warning: At structural_properties.c:3346 :graph contains a cycle, partial result is returned
# In 50% of the cluster's cases plot_trajectories_per_cluster(TRACERx_NEJM_2017_REVOLVER, min_counts = .5)
#> → min_counts in [0,1], interpreting that as a proportion.
#> → min_counts in [0,1], interpreting that as a proportion.
#> → min_counts in [0,1], interpreting that as a proportion.
#> Warning: At structural_properties.c:3346 :graph contains a cycle, partial result is returned
#> → min_counts in [0,1], interpreting that as a proportion.
#> → min_counts in [0,1], interpreting that as a proportion.
#> → min_counts in [0,1], interpreting that as a proportion.
#> → min_counts in [0,1], interpreting that as a proportion.
#> → min_counts in [0,1], interpreting that as a proportion.
#> → min_counts in [0,1], interpreting that as a proportion.
#> Warning: At structural_properties.c:3346 :graph contains a cycle, partial result is returned
#> → min_counts in [0,1], interpreting that as a proportion.
#> → min_counts in [0,1], interpreting that as a proportion.