pifit: Accuracy computation

View source: R/nempi_main.r

pifitR Documentation

Accuracy computation

Description

Compares the ground truth of a perturbation profile with the inferred profile

Usage

pifit(x, y, D, unknown = "", balanced = FALSE, propagate = TRUE, knowns = NULL)

Arguments

x

object of class nempi

y

object of class mnemsim

D

data matrix

unknown

label for the unlabelled samples

balanced

if TRUE, computes balanced accuracy

propagate

if TRUE, propagates the perturbation through the network

knowns

subset of P-genes that are known to be perturbed (the other are neglegted)

Value

list of different accuracy measures: true/false positives/negatives, correlation, area under the precision recall curve, (balanced) accuracy

Author(s)

Martin Pirkl

Examples

library(mnem)
seed <- 42
Pgenes <- 10
Egenes <- 10
samples <- 100
uninform <- floor((Pgenes*Egenes)*0.1)
Nems <- mw <- 1
noise <- 1
multi <- c(0.2, 0.1)
set.seed(seed)
simmini <- simData(Sgenes = Pgenes, Egenes = Egenes,
Nems = Nems, mw = mw, nCells = samples,
uninform = uninform, multi = multi,
badCells = floor(samples*0.1))
data <- simmini$data
ones <- which(data == 1)
zeros <- which(data == 0)
data[ones] <- rnorm(length(ones), 1, noise)
data[zeros] <- rnorm(length(zeros), -1, noise)
lost <- sample(1:ncol(data), floor(ncol(data)*0.5))
colnames(data)[lost] <- ""
res <- nempi(data)
fit <- pifit(res, simmini, data)

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