nempi: Main function for NEM based perturbation imputation.

View source: R/nempi_main.r

nempiR Documentation

Main function for NEM based perturbation imputation.

Description

Infers perturbations profiles based on a sparse perturbation matrix and differential gene expression as log odds

Usage

nempi(
  D,
  unknown = "",
  Gamma = NULL,
  type = "null",
  full = TRUE,
  verbose = FALSE,
  logtype = 2,
  null = TRUE,
  soft = TRUE,
  combi = 1,
  converged = 0.1,
  complete = TRUE,
  mw = NULL,
  max_iter = 100,
  keepphi = TRUE,
  start = NULL,
  phi = NULL,
  ...
)

Arguments

D

either a binary effects matrix or log odds matrix as for Nested Effects Models (see package 'nem')

unknown

colname of samples without mutation data, E.g. ""

Gamma

matrix with expectations of perturbations, e.g. if you have a binary mutation matrix, just normalize the columns to have sum 1

type

"null": does not use the unknown samples for inference at the start, "random" uses them in a random fashion (not recommended)

full

if FALSE, does not change the known profiles

verbose

if TRUE gives more output during inference

logtype

log type for the log odds

null

if FALSE does not use a NULL node for uninformative samples

soft

if FALSE discretizes Gamma during the inference

combi

if combi > 1, uses a more complex algorithm to infer combinatorial perturbations (experimental)

converged

the absolute difference of log likelihood till convergence

complete

if TRUE uses the complete-data logliklihood (recommended for many E-genes)

mw

if NULL infers mixture weights, otherwise keeps them fixed

max_iter

maximum iterations of the EM algorithm

keepphi

if TRUE, uses the previous phi for the next inference, if FALSE always starts with start network (and empty and full)

start

starting network as adjacency matrix

phi

if not NULL uses only this phi and does not infer a new one

...

additional parameters for the nem function (see package mnem, function nem or mnem::nem)

Value

nempi object

Author(s)

Martin Pirkl

Examples

D <- matrix(rnorm(1000*100), 1000, 100)
colnames(D) <- sample(seq_len(5), 100, replace = TRUE)
Gamma <- matrix(sample(c(0,1), 5*100, replace = TRUE, p = c(0.9, 0.1)), 5,
100)
Gamma <- apply(Gamma, 2, function(x) return(x/sum(x)))
Gamma[is.na(Gamma)] <- 0
rownames(Gamma) <- seq_len(5)
result <- nempi(D, Gamma = Gamma)

cbg-ethz/nempi documentation built on Nov. 9, 2023, 3:46 p.m.