calculatePPure: Compute P_pure

Description Usage Arguments Value References See Also Examples

Description

This function stratifies patients into two groups via k-means clustering (k=2) on an nxp matrix consisting of n patients and p genes in the candidate prognostic set. It is normally called by saps.

Usage

1
calculatePPure(geneData, survivalTimes, followup)

Arguments

geneData

An nxp matrix consisting of n patients and p genes in the candidate prognostic geneset.

survivalTimes

A vector of survival times. The length must equal the number of rows n in geneData.

followup

A vector of 0 or 1 values, indicating whether the patient was lost to followup (0) or not (1). The length must equal the number of rows (i.e. patients) in geneData.

Value

A list with the following elements:

p_pure

A log-rank p-value indicating the probability that the two groups show no survival difference.

cluster

Vector of assigned cluster (1 or 2) for each patient using the supplied candidate prognostic geneset.

References

Beck AH, Knoblauch NW, Hefti MM, Kaplan J, Schnitt SJ, et al. (2013) Significance Analysis of Prognostic Signatures. PLoS Comput Biol 9(1): e1002875.doi:10.1371/journal.pcbi.1002875

See Also

saps

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# 25 patients, none lost to followup
followup <- rep(1, 25)

# first 5 patients have good survival (in days)
time <- c(25, 27, 24, 21, 26, sample(1:3, 20, TRUE))*365

# create data for 100 genes, 25 patients
dat <- matrix(rnorm(25*100), nrow=25, ncol=100)
colnames(dat) <- as.character(1:100)

# create random genesets of 5 genes
set1 <- sample(colnames(dat), 5)

# get gene data for set1
set1_data <- dat[, set1]

# shouldn't achieve significance
p_pure <- calculatePPure(set1_data, time, followup)
p_pure$p_pure

# alter expression data for first 5 patients for set1
dat[1:5, set1] <- dat[1:5, set1]+10

set1_data <- dat[, set1]

# now p_pure should be significant
p_pure <- calculatePPure(set1_data, time, followup)
p_pure$p_pure

schmolze/saps-devel documentation built on May 29, 2019, 3:42 p.m.