knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Implementation of Purity Independent Subtyping of Tumors (PurIST) that was published in the Clinical Cancer Research (Rashid and Peng et al, 2020; DOI: 10.1158/1078-0432.CCR-19-1467).
intall.packages("devtools") library(devtools) devtools::install_github("lootpiz/PurIST")
library(PurIST)
prob = PurIST(dat)
```r library(PurIST) library(MetaGxPancreas) library(data.table)
esets <- MetaGxPancreas::loadPancreasEsets()[[1]]
esetExprs <- lapply(esets, FUN=exprs) esetNames <- names(esetExprs) esetSamples <- lapply(esetExprs, FUN=colnames)
.tryPurIST <- function(col, names) { tryCatch({PurIST(structure(col, .Names=names))}, error=function(e) { return(NA) }) }
.PurISTExprColumns <- function(expr) apply(expr, 2, FUN=.tryPurIST, names=row.names(expr))
objList <- lapply(esetExprs, FUN=.PurISTExprColumns)
resultsDtL <- mapply(data.table, 'study'=esetNames, 'sample'=esetSamples, 'prob'=objList, SIMPLIFY=FALSE) resultsDT <- rbindlist(resultsDtL) resultsDT[, subtype := ifelse(prob > 0.5, "Basal-like", "Classical")]
table(resultsDT$subtype)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.