Construct a REVOLVER cohort.

revolver_cohort(
  dataset,
  CCF_parser = revolver::CCF_parser,
  ONLY.DRIVER = FALSE,
  MIN.CLUSTER.SIZE = 10,
  annotation = "My REVOLVER dataset"
)

Arguments

dataset

A dataframe in the specified format (see the package vignettes).

CCF_parser

A function to parse the format for the encoding of CCF or binary values for each sequenced region. A possible function is available inside REVOLVER; CCF_parser (the default of this parameter).

ONLY.DRIVER

If true, uses only annotated driver events.

MIN.CLUSTER.SIZE

Discard clusters that have less than this number of entries.

annotation

Brief cohort description.

Value

An object of the S3 class "rev_cohort" that represents a REVOLVER cohort.

Examples

# Example cohort creation with the TRACERx data
data('TRACERx_NEJM_2017', package = 'evoverse.datasets')

# To speed up the process we use only 2 patients
TRACERx_NEJM_2017 = TRACERx_NEJM_2017[TRACERx_NEJM_2017$patientID %in% c('CRUK0001', 'CRUK0002'), ]

cohort = revolver_cohort(TRACERx_NEJM_2017, annotation = 'A toy REVOLVER dataset')
#>  [ REVOLVER ~ Cohort constructor ] 
#> 
#>  Using only driver mutations. 
#>  Rejecting clusters with less than 10 mutations. 
#> 
#> ── Filtering small clusters (starting with 2380 entries) ───────────────────────
#> Removing
#> 
#> # A tibble: 0 × 9
#> # ℹ 9 variables: Misc <chr>, patientID <chr>, variantID <chr>, cluster <chr>,
#> #   is.driver <lgl>, is.clonal <lgl>, CCF <chr>, id <chr>, cluster_size <int>
#>  After filtering: 2380 entries
#> 
#> ── REVOLVER input data ─────────────────────────────────────────────────────────
#> 
#> # A tibble: 2,380 × 9
#>    Misc              patientID variantID cluster is.driver is.clonal CCF   id   
#>    <chr>             <chr>     <chr>     <chr>   <lgl>     <lgl>     <chr> <chr>
#>  1 CRUK0001:7:47971… CRUK0001  PKD1L1    1       FALSE     FALSE     R1:0… __mu…
#>  2 CRUK0001:21:4775… CRUK0001  PCNT      1       FALSE     FALSE     R1:0… __mu…
#>  3 CRUK0001:22:3733… CRUK0001  CSF2RB    1       FALSE     FALSE     R1:0… __mu…
#>  4 CRUK0001:10:1028… CRUK0001  KAZALD1   1       FALSE     FALSE     R1:0… __mu…
#>  5 CRUK0001:7:81978… CRUK0001  CACNA2D1  1       FALSE     FALSE     R1:0… __mu…
#>  6 CRUK0001:1:20184… CRUK0001  IPO9      1       FALSE     FALSE     R1:0… __mu…
#>  7 CRUK0001:3:16740… CRUK0001  PDCD10    1       FALSE     FALSE     R1:0… __mu…
#>  8 CRUK0001:7:13465… CRUK0001  CALD1     1       FALSE     FALSE     R1:0… __mu…
#>  9 CRUK0001:17:7698… CRUK0001  CANT1     1       FALSE     FALSE     R1:0… __mu…
#> 10 CRUK0001:16:1662… CRUK0001  IFT140    1       FALSE     FALSE     R1:0… __mu…
#> # ℹ 2,370 more rows
#> # ℹ 1 more variable: cluster_size <int>
#> 
#> ── Preprocessing data (this may take some time) 
#> 
#> ..
#> 
#> ── Extracting clones table ─────────────────────────────────────────────────────
#> 
#>CRUK0001 : 2100 entries, 11 clone(s).
#>CRUK0002 : 280 entries, 7 clone(s).

# The S3 print method for this cohort
print(cohort)
#>  [ REVOLVER - Repeated Evolution in Cancer ] 
#> 
#> Dataset : A toy REVOLVER dataset 
#> Cohort  : 2 patients, 2380 variants and 13 driver events. 
#> 
#> Trees per patient    : NO 
#> Fit via TL           : NO 
#> REVOLVER clustering  : NO 
#> Jackknife statistics : NO 
#>  
#> For summary statistics see `?Stats_*(x)` with * = {cohort, drivers, trees, fits, clusters, ...} 
#> 
#>      ┌──────────────────────────────────────────────────────────────────────┐
#>                                                                            
#>         WARNING - Driver variantIDs occuring only once could be removed.   
#>                                                                            
#>      └──────────────────────────────────────────────────────────────────────┘
#> # A tibble: 12 × 7
#>    variantID numClonal p_clonal numSubclonal p_subclonal N_tot p_tot
#>    <chr>         <dbl>    <dbl>        <dbl>       <dbl> <dbl> <dbl>
#>  1 TP53              1      0.5            0         0       1   0.5
#>  2 MGA               1      0.5            0         0       1   0.5
#>  3 WRN               1      0.5            0         0       1   0.5
#>  4 EGFR              1      0.5            0         0       1   0.5
#>  5 MET               1      0.5            0         0       1   0.5
#>  6 TERT              1      0.5            0         0       1   0.5
#>  7 ARHGAP35          0      0              1         0.5     1   0.5
#>  8 PASK              0      0              1         0.5     1   0.5
#>  9 RB1               0      0              1         0.5     1   0.5
#> 10 IKZF1             0      0              1         0.5     1   0.5
#> 11 KRAS              0      0              1         0.5     1   0.5
#> 12 EP300             0      0              1         0.5     1   0.5