calculateNres2: Number of mutated residual genes

View source: R/Nres.R

calculateNres2R Documentation

Number of mutated residual genes

Description

Performs the generalized calculation for the number of mutated residual genes per patient, with a cap at 2 in accordance to observed saturation, and adjusting for missing information.

Usage

calculateNres2(
  patientRes,
  genesRes = c("BCOR", "BCORL1", "CEBPA", "ETNK1", "GATA2", "GNB1", "IDH1", "NF1",
    "PHF6", "PPM1D", "PRPF8", "PTPN11", "SETBP1", "STAG2", "WT1"),
  Nref = 0.388
)

Arguments

patientRes

a patient data.frame (with one row and residual genes in columns), or a vector with residual genes as names attributes. Expected entries are 0 (not mutated), 1 (mutated), or NA (missing).

genesRes

a vector containing the names of the residual genes.

Nref

the average reference value.

Value

A vector with the calculated number under the mean, best, and worst scenarios. If no missing data, all scenarios are equal.

Examples

vec <- rep(0, 15)
vec[1] <- 1 # 1 mutated genes and no missing data
names(vec) <- c("BCOR", "BCORL1", "CEBPA", "ETNK1", "GATA2", "GNB1", "IDH1", "NF1", "PHF6", "PPM1D", "PRPF8", "PTPN11", "SETBP1", "STAG2", "WT1")
calculateNres2(patientRes = vec)

vec1 <- vec
vec1[2:3] <- NA # 1 mutated genes and 2 missing
calculateNres2(patientRes = vec1) # scenarios are now different

vec2 <- vec1
vec2[4] <- 1 # 2 mutated genes and 2 missing
calculateNres2(patientRes = vec2) # scenarios are equal, because the number is capped at 2 mutated genes


papaemmelab/ipssm documentation built on Feb. 8, 2023, 3:09 p.m.