Skip to contents

Calculate the Sum Deviance for Inclusion and Exclusion Matrices

Usage

find_variable_events(
  m1_matrix,
  m2_matrix = NULL,
  min_row_sum = 50,
  n_threads = 1,
  verbose = TRUE,
  ...
)

Arguments

m1_matrix

A matrix representing the inclusion matrix. Rows are events, columns are barcodes.

m2_matrix

A matrix representing the exclusion matrix. Rows are events, columns are barcodes.

min_row_sum

A numeric value specifying the minimum row sum threshold for filtering events. Defaults to 50.

n_threads

If the module OpenPM is available for your device, the function suggests using multi-thread processing for even faster computation.

verbose

Logical. If TRUE (default), prints progress and informational messages.

...

Additional arguments to be passed.

Value

A data.table containing the events and their corresponding sum deviance values.

Examples

# loading the toy dataset
toy_obj <- load_toy_M1_M2_object()

# getting HVE (high variable events)
 HVE <- find_variable_events(toy_obj$m1, toy_obj$m2)
#> There are 11 libraries detected...
#> Calculating the deviances for sample A08 has been completed!
#> Calculating the deviances for sample E01 has been completed!
#> Calculating the deviances for sample F08 has been completed!
#> Calculating the deviances for sample B08 has been completed!
#> Calculating the deviances for sample A01 has been completed!
#> Calculating the deviances for sample B01 has been completed!
#> Calculating the deviances for sample H12 has been completed!
#> Calculating the deviances for sample G08 has been completed!
#> Calculating the deviances for sample C01 has been completed!
#> Calculating the deviances for sample G12 has been completed!
#> Calculating the deviances for sample F01 has been completed!

 # printing the results
 print(HVE[order(-sum_deviance)])
#>                        events sum_deviance
#>                        <char>        <num>
#>   1: 11:114559453-114559606_E   1824.26664
#>   2: 11:114559436-114559606_E   1812.71731
#>   3:    Y:90804950-90827617_E   1290.42257
#>   4:    Y:90804687-90827617_E   1290.31443
#>   5:     11:4652221-4654156_S   1181.77079
#>  ---                                      
#> 289:    8:61428942-61435809_E    132.34660
#> 290:    8:61394449-61435809_E    132.34660
#> 291:   17:47997988-47998112_E    131.84761
#> 292:   17:47997934-47998112_E    131.84761
#> 293:   17:25116115-25116187_E     77.68732