Learn R Programming

Rediscover (version 0.3.3)

getMutexAB: getMutexAB function

Description

Given two binary matrices and its corresponding probability matrices PAij and PBij, compute the Poisson Binomial method to estimate mutual exclusive events between A and B

Usage

getMutexAB(
  A,
  PMA = getPM(A),
  B,
  PMB = getPM(B),
  lower.tail = TRUE,
  method = "ShiftedBinomial",
  mixed = TRUE,
  th = 0.05,
  verbose = FALSE,
  parallel = FALSE,
  no_cores = NULL
)

Value

A matrix with the p-values of the corresponding test.

Arguments

A

The binary matrix of events A

PMA

The corresponding probability matrix of A. It can be computed using function getPM. By default equal to getPM(A)

B

The binary matrix of events B

PMB

The corresponding probability matrix of B. It can be computed using function getPM. By default equal to getPM(B)

lower.tail

True if mutually exclusive test. False for co-ocurrence. By default is TRUE.

method

one of the following: "ShiftedBinomial" (default),"Exact", "RefinedNormal", and "Binomial".

mixed

option to compute lower p-values with an exact method. By default TRUE

th

upper threshold of p-value to apply the exact method.

verbose

The verbosity of the output

parallel

If the exact method is executed with a parallel process.

no_cores

number of cores. If not stated number of cores of the CPU - 1

Details

we implemented three different approximations of the Poison-Binomial distribution function:

  • "ShiftedBinomial" (by default) that correspond to a shifted Binomial with three parameters (Peköz, Shwartz, Christiansen, & Berlowitz, 2010).

  • "Exact" that use the exact formula using the `PoissonBinomial` Rpackage based on the work from (Biscarri, Zhao, & Brunner, 2018).

  • "Binomial" with two parameters (Cam, 1960).

  • "RefinedNormal" that is based on the work from (Volkova, 1996).

If `mixed` option is selected (by default is FALSE), the "Exact" method is computed for p-values lower than a threshold (`th` parameter, that by default is 0.05). When the exact method is computed, it is possible to parallelize the process by selecting the option `parallel` (by default FALSE) and setting the number of cores (`no_cores` parameter)

Examples

Run this code

  # \donttest{   
  
  #The next example, is the same as the first
  # one but, using a matrix of class Matrix. 
  
  data("A_Matrix")
  data("B_Matrix")
  PMA <- getPM(A_Matrix)
  PMB <- getPM(B_Matrix)
  mismutex <- getMutexAB(A=A_Matrix, PM=PMA, B=B_Matrix, PMB = PMB)
  
  #Finally, the last example, shows a 
  #real example of how to perform this function
  # when using data from TCGA, Colon Adenocarcinoma in this case. 
  
  if (FALSE) {
  data("TCGA_COAD_AMP")
  data("AMP_COAD")
  data("PM_TCGA_COAD_AMP")
  data("PM_AMP_COAD")
  
  mismutex <- getMutexAB(A=TCGA_COAD_AMP, 
                         PMA=PM_TCGA_COAD_AMP,
                         B=AMP_COAD,
                         PMB = PM_AMP_COAD)
   }
 # }

Run the code above in your browser using DataLab