Title: | Pancreatic Ductal Adenocarcinoma Tool-Kit |
---|---|
Description: | Pancreatic ductal adenocarcinoma (PDA) has a relatively poor prognosis and is one of the most lethal cancers. Molecular classification of gene expression profiles holds the potential to identify meaningful subtypes which can inform therapeutic strategy in the clinical setting. The Pancreatic Cancer Adenocarcinoma Tool-Kit (PDATK) provides an S4 class-based interface for performing unsupervised subtype discovery, cross-cohort meta-clustering, gene-expression-based classification, and subsequent survival analysis to identify prognostically useful subtypes in pancreatic cancer and beyond. Two novel methods, Consensus Subtypes in Pancreatic Cancer (CSPC) and Pancreatic Cancer Overall Survival Predictor (PCOSP) are included for consensus-based meta-clustering and overall-survival prediction, respectively. Additionally, four published subtype classifiers and three published prognostic gene signatures are included to allow users to easily recreate published results, apply existing classifiers to new data, and benchmark the relative performance of new methods. The use of existing Bioconductor classes as input to all PDATK classes and methods enables integration with existing Bioconductor datasets, including the 21 pancreatic cancer patient cohorts available in the MetaGxPancreas data package. PDATK has been used to replicate results from Sandhu et al (2019) [https://doi.org/10.1200/cci.18.00102] and an additional paper is in the works using CSPC to validate subtypes from the included published classifiers, both of which use the data available in MetaGxPancreas. The inclusion of subtype centroids and prognostic gene signatures from these and other publications will enable researchers and clinicians to classify novel patient gene expression data, allowing the direct clinical application of the classifiers included in PDATK. Overall, PDATK provides a rich set of tools to identify and validate useful prognostic and molecular subtypes based on gene-expression data, benchmark new classifiers against existing ones, and apply discovered classifiers on novel patient data to inform clinical decision making. |
Authors: | Vandana Sandhu [aut], Heewon Seo [aut], Christopher Eeles [aut], Neha Rohatgi [ctb], Benjamin Haibe-Kains [aut, cre] |
Maintainer: | Benjamin Haibe-Kains <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.15.0 |
Built: | 2024-10-30 09:27:43 UTC |
Source: | https://github.com/bioc/PDATK |
assignColDataColumn
Assign a new column directly to the colData slot of a SummarizedExperiment.
assignColDataColumn(SE, colname, values)
assignColDataColumn(SE, colname, values)
SE |
A |
colname |
The name of the column to assign |
values |
The values to assign to the col |
The SE
object with the new column in the objects colData
slot.
SE <- SummarizedExperiment(matrix(rnorm(100), 10, 10)) updatedSE <- assignColDataColumn(SE, 'test', rep(1, 10))
SE <- SummarizedExperiment(matrix(rnorm(100), 10, 10)) updatedSE <- assignColDataColumn(SE, 'test', rep(1, 10))
Assign Sample Subtypes to an S4 Object
assignSubtypes(object, subtypes, ...)
assignSubtypes(object, subtypes, ...)
object |
An |
subtypes |
A mapping to assign subtypes to the samples or patients in the object. |
... |
Allow new parameters to be defined for this generic. |
object with subtypes assigned to the sample metadata and the isSubtyped metadata item set to TRUE.
data(sampleICGCmicro) data(cohortSubtypeDFs) cohortList <- assignSubtypes(sampleICGCmicro, subtypes=cohortSubtypeDFs$ICGCMICRO, sampleCol='sample_name', subtypeCol='subtype')
data(sampleICGCmicro) data(cohortSubtypeDFs) cohortList <- assignSubtypes(sampleICGCmicro, subtypes=cohortSubtypeDFs$ICGCMICRO, sampleCol='sample_name', subtypeCol='subtype')
Assign Subtype Annotations to a SurvivalExperiment Object
## S4 method for signature 'CohortList,list' assignSubtypes( object, subtypes, ..., sampleCol = "sample_name", subtypeCol = "subtype" )
## S4 method for signature 'CohortList,list' assignSubtypes( object, subtypes, ..., sampleCol = "sample_name", subtypeCol = "subtype" )
object |
A |
subtypes |
A |
... |
Catch unnamed parameters. Not used. |
sampleCol |
A |
subtypeCol |
A |
The CohortList
with the subtypes in the subtypes
column
of the colData slot and a metadata item, hasSubtypes
, set to TRUE for
each SurvivalExperiment
.
data(sampleCohortList) data(cohortSubtypeDFs) cohortList <- assignSubtypes(sampleCohortList, subtypes=cohortSubtypeDFs[names(sampleCohortList)], sampleCol='sample_name', subtypeCol='subtype')
data(sampleCohortList) data(cohortSubtypeDFs) cohortList <- assignSubtypes(sampleCohortList, subtypes=cohortSubtypeDFs[names(sampleCohortList)], sampleCol='sample_name', subtypeCol='subtype')
Assign Subtype Annotations to a SurvivalExperiment Object
## S4 method for signature 'SurvivalExperiment,data.frame' assignSubtypes( object, subtypes, ..., sampleCol = "sample_name", subtypeCol = "subtype" )
## S4 method for signature 'SurvivalExperiment,data.frame' assignSubtypes( object, subtypes, ..., sampleCol = "sample_name", subtypeCol = "subtype" )
object |
A |
subtypes |
A |
... |
Force subsequent arguments to be named. Not used. |
sampleCol |
A |
subtypeCol |
A |
The SurvivalExperiment
with the subtypes in the subtypes
column
of the colData slot and a metadata item, hasSubtypes
, set to TRUE.
data(sampleICGCmicro) data(cohortSubtypeDFs) cohortList <- assignSubtypes(sampleICGCmicro, subtypes=cohortSubtypeDFs$ICGCMICRO, sampleCol='sample_name', subtypeCol='subtype')
data(sampleICGCmicro) data(cohortSubtypeDFs) cohortList <- assignSubtypes(sampleICGCmicro, subtypes=cohortSubtypeDFs$ICGCMICRO, sampleCol='sample_name', subtypeCol='subtype')
S4
Objects Representing
Mathematical Models.Make A Bar Plot Comparing Performance Between Two S4
Objects Representing
Mathematical Models.
barPlotModelComparison(model1, model2, ...)
barPlotModelComparison(model1, model2, ...)
model1 |
An |
model2 |
An |
... |
Allow new parameters to be defined for this generic. |
A bar plot comparing some aspect of model1 and model2
data(sampleCohortList) data(sampleValPCOSPmodel) data(sampleICGCmicro) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Setup the models set.seed(1987) clinicalModel <- ClinicalModel(sampleICGCmicro, formula='prognosis ~ sex + age + T + N + M + grade', randomSeed=1987) # Train the models trainedClinicalModel <- trainModel(clinicalModel) # Make predctions clinicalPredCohortList <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortList) # Plot the comparison modelCompBarPlot <- barPlotModelComparison(validatedClinicalModel, sampleValPCOSPmodel, stat='AUC')
data(sampleCohortList) data(sampleValPCOSPmodel) data(sampleICGCmicro) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Setup the models set.seed(1987) clinicalModel <- ClinicalModel(sampleICGCmicro, formula='prognosis ~ sex + age + T + N + M + grade', randomSeed=1987) # Train the models trainedClinicalModel <- trainModel(clinicalModel) # Make predctions clinicalPredCohortList <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortList) # Plot the comparison modelCompBarPlot <- barPlotModelComparison(validatedClinicalModel, sampleValPCOSPmodel, stat='AUC')
Make a Bar Plot Comparison Model Performance Between a ClinicalModel and a PCOSP, RLSModel or RGAModel object.
## S4 method for signature 'ClinicalModel,PCOSP_or_RLS_or_RGA' barPlotModelComparison(model1, model2, stat, ...)
## S4 method for signature 'ClinicalModel,PCOSP_or_RLS_or_RGA' barPlotModelComparison(model1, model2, stat, ...)
model1 |
A |
model2 |
A |
stat |
A |
... |
Not used. |
A ggplot2
object showing a barplot coloured by the model and
comparing the stat between all cohorts that both models were validated
with.
data(sampleValPCOSPmodel) data(sampleCohortList) data(sampleICGCmicro) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Setup the models clinicalModel <- ClinicalModel(sampleICGCmicro, formula='prognosis ~ sex + age + T + N + M + grade', randomSeed=1987) # Train the models trainedClinicalModel <- trainModel(clinicalModel) # Make predctions clinicalPredCohortList <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortList) # Plot the comparison modelCompBarPlot <- barPlotModelComparison(validatedClinicalModel, sampleValPCOSPmodel, stat='AUC')
data(sampleValPCOSPmodel) data(sampleCohortList) data(sampleICGCmicro) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Setup the models clinicalModel <- ClinicalModel(sampleICGCmicro, formula='prognosis ~ sex + age + T + N + M + grade', randomSeed=1987) # Train the models trainedClinicalModel <- trainModel(clinicalModel) # Make predctions clinicalPredCohortList <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortList) # Plot the comparison modelCompBarPlot <- barPlotModelComparison(validatedClinicalModel, sampleValPCOSPmodel, stat='AUC')
The genes and coefficients for the gene signature from Birnbaum et al. (2017)
# Loads chen, birnbaum and haiderSigScores objects data(existingClassifierData)
# Loads chen, birnbaum and haiderSigScores objects data(existingClassifierData)
The genes and coefficients for the gene signature from Chen et al. (2015)
# Loads chen, birnbaum and haiderSigScores objects data(existingClassifierData)
# Loads chen, birnbaum and haiderSigScores objects data(existingClassifierData)
Constructor for the ClinicalModel Class
ClinicalModel(trainData, formula, minDaysSurvived = 365, ..., randomSeed)
ClinicalModel(trainData, formula, minDaysSurvived = 365, ..., randomSeed)
trainData |
A |
formula |
A |
minDaysSurvived |
An |
... |
Force all subsequent parameters to be named. Not used. |
randomSeed |
An |
A ClinicalModel
object.
data(sampleICGCmicro) set.seed(1987) clinicalModel <- ClinicalModel(sampleICGCmicro, formula='prognosis ~ sex + age + T + N + M + grade', randomSeed=1987)
data(sampleICGCmicro) set.seed(1987) clinicalModel <- ClinicalModel(sampleICGCmicro, formula='prognosis ~ sex + age + T + N + M + grade', randomSeed=1987)
An S4 class with a number of predefined methods for accessing slots relavant to a surival model. More specific model types will inherit from this class for their accessor methods and constructor.
data(sampleICGCmicro) set.seed(1987) survModel <- SurvivalModel(sampleICGCmicro, minDaysSurvived=385, randomSeed=1987)
data(sampleICGCmicro) set.seed(1987) survModel <- SurvivalModel(sampleICGCmicro, minDaysSurvived=385, randomSeed=1987)
Constructor for the CohortList class, a specialized list for storing SurvivalExperiment objects.
CohortList(..., mDataTypes)
CohortList(..., mDataTypes)
... |
One or more |
mDataTypes |
A |
A CohortList
object containing one or more SurvivalExperiment
objects.
data(sampleICGCmicro) set.seed(1987) cohortList <- CohortList(list(survExp1=sampleICGCmicro, survExp2=sampleICGCmicro), mDataTypes=c('rna_micro', 'rna_micro'))
data(sampleICGCmicro) set.seed(1987) cohortList <- CohortList(list(survExp1=sampleICGCmicro, survExp2=sampleICGCmicro), mDataTypes=c('rna_micro', 'rna_micro'))
A list
of data.frames
containing clinical subtypes for the data
in the cohortSubtypeDFs
object.
data(cohortSubtypeDFs)
data(cohortSubtypeDFs)
S4
ObjectsCompare Two Mathematical Models Represented as S4
Objects
compareModels(model1, model2, ...)
compareModels(model1, model2, ...)
model1 |
A |
model2 |
A |
... |
Allow new parameters to be defined for this generic. |
A S4
object with statistics about the performance of each model.
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the model trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class ClinicalPredPCSI <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=ClinicalPredPCSI) # Compare the models modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel) head(modelComp)
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the model trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class ClinicalPredPCSI <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=ClinicalPredPCSI) # Compare the models modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel) head(modelComp)
SurivalModel
Objects, Returing A ModelComparison
Object
With Statistics Comparing the Performance of Each Model.Compare Two SurivalModel
Objects, Returing A ModelComparison
Object
With Statistics Comparing the Performance of Each Model.
## S4 method for signature 'ModelComparison,SurvivalModel' compareModels(model1, model2, model2Name)
## S4 method for signature 'ModelComparison,SurvivalModel' compareModels(model1, model2, model2Name)
model1 |
An object inherting from the |
model2 |
Another object inherting from the |
model2Name |
A |
A ModelComparison
object with statistics comparing the two models.
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the models trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class clinicalPredCohortL <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortL) # Compare the models modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel) head(modelComp) # Compare model comparison to another model modelCompComp <- compareModels(modelComp, sampleValPCOSPmodel)
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the models trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class clinicalPredCohortL <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortL) # Compare the models modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel) head(modelComp) # Compare model comparison to another model modelCompComp <- compareModels(modelComp, sampleValPCOSPmodel)
SurivalModel
Objects, Returing A ModelComparison
Object
With Statistics Comparing the Performance of Each Model.Compare Two SurivalModel
Objects, Returing A ModelComparison
Object
With Statistics Comparing the Performance of Each Model.
## S4 method for signature 'SurvivalModel,SurvivalModel' compareModels(model1, model2, modelNames)
## S4 method for signature 'SurvivalModel,SurvivalModel' compareModels(model1, model2, modelNames)
model1 |
An object inherting from the |
model2 |
Another object inherting from the |
modelNames |
Optional character vector with a name for each model. Defaults to the class of the model plus 1 and 2 if missing. |
A ModelComparison
object with statistics comparing the two models.
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the model trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class ClinicalPredPCSI <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=ClinicalPredPCSI) # Compare the models modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel) head(modelComp)
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the model trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class ClinicalPredPCSI <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=ClinicalPredPCSI) # Compare the models modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel) head(modelComp)
ConsensusClusterModel
Object.Constructor for a ConsensusClusterModel
Object.
ConsensusMetaclusteringModel(trainData, ..., randomSeed)
ConsensusMetaclusteringModel(trainData, ..., randomSeed)
trainData |
A |
... |
Force subsequent parameters to be named. Not used. |
randomSeed |
An |
A ConsensusMetaclusteringModel
object containing the training
data and ready to be trained.
ConsensusClusterPlus::ConsensusClusterPlus
data(CSPC_MAE) set.seed(1987) conMetaclustModel <- ConsensusMetaclusteringModel(CSPC_MAE, randomSeed=1987)
data(CSPC_MAE) set.seed(1987) conMetaclustModel <- ConsensusMetaclusteringModel(CSPC_MAE, randomSeed=1987)
S4Model
Containing Molecular Data to be Consensus ClusteredAn S4
wrapper class providing an interface to the ConsensusClusterPlus
function from the package with the same name.
Build a CoxModel
object from a MultiAssayExperiment
of
SurvivalExperiment
s. Allows easy application of the
survival::coxph
function to many SurvivalExperiment
at once,
assuming they share the survivalPredictor
column.
CoxModel(object, survivalPredictor = "metacluster_labels")
CoxModel(object, survivalPredictor = "metacluster_labels")
object |
A |
survivalPredictor |
A |
A CoxModel
object, with object
in the trainData slot.
library(MultiAssayExperiment) data(CSPC_MAE) experiments(CSPC_MAE) <- endoapply(experiments(CSPC_MAE), SurvivalExperiment, event_occurred='vital_status', survival_time='days_to_death') coxModel <- CoxModel(CSPC_MAE, survivalPredictor='sample_type')
library(MultiAssayExperiment) data(CSPC_MAE) experiments(CSPC_MAE) <- endoapply(experiments(CSPC_MAE), SurvivalExperiment, event_occurred='vital_status', survival_time='days_to_death') coxModel <- CoxModel(CSPC_MAE, survivalPredictor='sample_type')
MultiAssayExperiment
containing cohorts of pancreatic cancer
patients, for use in package examples.A MultiAssayExperiment
containing cohorts of pancreatic cancer
patients, for use in package examples.
data(CSPC_MAE)
data(CSPC_MAE)
S4
ObjectRender A Density Plot of Model Performance for an S4
Object
densityPlotModelComparison(object, refModel, ...)
densityPlotModelComparison(object, refModel, ...)
object |
An |
refModel |
An |
... |
Allow additional parameters to be defined for this generic. |
A ggplot
object containing the plot.
PCOSP
,
RLSModel
or RGAModel
object.Render a Density Plot Comparing Model Performance Between Two PCOSP
,
RLSModel
or RGAModel
object.
## S4 method for signature 'PCOSP_or_RLS_or_RGA,PCOSP_or_RLS_or_RGA' densityPlotModelComparison( object, refModel, ..., title, xlab, ylab, mDataTypeLabels )
## S4 method for signature 'PCOSP_or_RLS_or_RGA,PCOSP_or_RLS_or_RGA' densityPlotModelComparison( object, refModel, ..., title, xlab, ylab, mDataTypeLabels )
object |
A |
refModel |
A |
... |
Catch unnamed parameters. Not used. |
title |
Optional |
xlab |
Optional |
ylab |
Optional |
mDataTypeLabels |
Optional |
A ggplot
object with a density plot of model AUCs for object
and a vertical line for the average AUC of refModel
, faceted by
mDataType.
S4
Object.Remove Censored Patient Samples from An S4
Object.
dropNotCensored(object, ...)
dropNotCensored(object, ...)
object |
An |
... |
Allow new parmeters to be defined for this generic. |
S4
The object subset to only those patients which pass the
censoring criteria.
data(sampleICGCmicro) ICGCmicro <- dropNotCensored(sampleICGCmicro)
data(sampleICGCmicro) ICGCmicro <- dropNotCensored(sampleICGCmicro)
SurvivalExperiemnt
in a CohortList
Remove Censored Patients from Each SurvivalExperiemnt
in a CohortList
## S4 method for signature 'CohortList' dropNotCensored(object, minDaysSurvived = 365)
## S4 method for signature 'CohortList' dropNotCensored(object, minDaysSurvived = 365)
object |
A |
minDaysSurvived |
An |
The CohortList
with censored samples removed.
data(sampleCohortList) valCohortList <- dropNotCensored(sampleCohortList)
data(sampleCohortList) valCohortList <- dropNotCensored(sampleCohortList)
SurvivalExperiment
ObjectRemove Censored Patients from A SurvivalExperiment
Object
## S4 method for signature 'SurvivalExperiment' dropNotCensored(object, minDaysSurvived = 365)
## S4 method for signature 'SurvivalExperiment' dropNotCensored(object, minDaysSurvived = 365)
object |
A |
minDaysSurvived |
An |
Censored means no event before end of measurement. Since we want not
censored, we keep patients who had an event before minDaysSurvived.
Therefore we keep individuals surviving > minDaysSurvived
, or who had an
event (died) before minDaysSurvived.
The SurvivalExperiment
with censored samples removed.
data(sampleICGCmicro) ICGCmicro <- dropNotCensored(sampleICGCmicro)
data(sampleICGCmicro) ICGCmicro <- dropNotCensored(sampleICGCmicro)
existingClassifierData
Three objects:
chen
: The genes and coefficients for the gene signature from
Chen et al. (2015)
birnbaum
: The genes and coefficients for the gene signature from
Birnbaum et al. (2017)
haiderSigScores
: The classifier risk scores from Haider et al. (2014)
# Loads chen, birnbaum and haiderSigScores objects data(existingClassifierData)
# Loads chen, birnbaum and haiderSigScores objects data(existingClassifierData)
S4
object.Find the common genes in an S4
object.
findCommonGenes(object, ...)
findCommonGenes(object, ...)
object |
An |
... |
Allow new parameters to be defined for this generic. |
A character
vector of common gene names.
data(sampleCohortList) commonGenes <- findCommonGenes(sampleCohortList) head(commonGenes)
data(sampleCohortList) commonGenes <- findCommonGenes(sampleCohortList) head(commonGenes)
SurvivalExperiments
in a CohortList
Intersect Gene Names for All SurvivalExperiments
in a CohortList
## S4 method for signature 'CohortList' findCommonGenes(object)
## S4 method for signature 'CohortList' findCommonGenes(object)
object |
A |
A character
vector of genes common to all SurvivalExperiment
s
in the CohortList
.
data(sampleCohortList) commonGenes <- findCommonGenes(sampleCohortList) head(commonGenes)
data(sampleCohortList) commonGenes <- findCommonGenes(sampleCohortList) head(commonGenes)
experiments
in a MultiAssayExperiment
Intersect Gene Names for All experiments
in a MultiAssayExperiment
## S4 method for signature 'MultiAssayExperiment' findCommonGenes(object)
## S4 method for signature 'MultiAssayExperiment' findCommonGenes(object)
object |
A |
A character
vector of genes common to all experiments
in the MutliAssayExperiment
.
Find Common Samples in a List-like S4 Object where The Columns of Each Item Represent Samples
findCommonSamples(object, ...)
findCommonSamples(object, ...)
object |
A |
... |
Allow new parameters to be defined for this generic. |
A character
vector of common sample names.
data(sampleCohortList) commonSamples <- findCommonSamples(sampleCohortList) head(commonSamples)
data(sampleCohortList) commonSamples <- findCommonSamples(sampleCohortList) head(commonSamples)
Find Common Samples in a CohortList Object where The Columns of Each Item Represent Samples
## S4 method for signature 'CohortList' findCommonSamples(object)
## S4 method for signature 'CohortList' findCommonSamples(object)
object |
A |
A character
vector of common sample names.
data(sampleCohortList) commonSamples <- findCommonSamples(sampleCohortList) head(commonSamples)
data(sampleCohortList) commonSamples <- findCommonSamples(sampleCohortList) head(commonSamples)
S4
objectGenerate a forest plot from an S4
object
forestPlot(object, ...)
forestPlot(object, ...)
object |
An |
... |
Allow new parameters to this generic. |
None, draws a forest plot.
data(sampleValPCOSPmodel) # Plot dIndexForestPlot <- forestPlot(sampleValPCOSPmodel, stat='log_D_index')
data(sampleValPCOSPmodel) # Plot dIndexForestPlot <- forestPlot(sampleValPCOSPmodel, stat='log_D_index')
validationStats
slot of a PCOSP
model object.Render a forest plot from the validationStats
slot of a PCOSP
model object.
## S4 method for signature 'ModelComparison' forestPlot( object, stat, groupBy = "cohort", colourBy = "model", vline, ..., xlab, ylab, transform, colours, title )
## S4 method for signature 'ModelComparison' forestPlot( object, stat, groupBy = "cohort", colourBy = "model", vline, ..., xlab, ylab, transform, colours, title )
object |
A |
stat |
A |
groupBy |
A |
colourBy |
A |
vline |
An |
... |
Force subsequent parameters to be named, not used. |
xlab |
A |
ylab |
A |
transform |
The name of a numeric function to transform the statistic before making the forest plot. |
colours |
A |
title |
A |
A ggplot2
object.
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the models trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class ClinicalPredCohortL <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=ClinicalPredCohortL) # Compare the models modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel) # Make the forest plot modelComp <- modelComp[modelComp$isSummary == TRUE, ] modelCindexCompForestPlot <- forestPlot(modelComp, stat='concordance_index')
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the models trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class ClinicalPredCohortL <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=ClinicalPredCohortL) # Compare the models modelComp <- compareModels(sampleValPCOSPmodel, validatedClinicalModel) # Make the forest plot modelComp <- modelComp[modelComp$isSummary == TRUE, ] modelCindexCompForestPlot <- forestPlot(modelComp, stat='concordance_index')
validationStats
slot of a PCOSP
model object.Render a forest plot from the validationStats
slot of a PCOSP
model object.
## S4 method for signature 'PCOSP_or_ClinicalModel' forestPlot( object, stat, groupBy = "mDataType", colourBy = "isSummary", vline, ..., xlab, ylab, transform, colours, title )
## S4 method for signature 'PCOSP_or_ClinicalModel' forestPlot( object, stat, groupBy = "mDataType", colourBy = "isSummary", vline, ..., xlab, ylab, transform, colours, title )
object |
A |
stat |
A |
groupBy |
A |
colourBy |
A |
vline |
An |
... |
Force subsequent parameters to be named, not used. |
xlab |
A |
ylab |
A |
transform |
The name of a numeric function to transform the statistic before making the forest plot. |
colours |
A |
title |
A |
A ggplot2
object.
data(sampleValPCOSPmodel) # Plot dIndexForestPlot <- forestPlot(sampleValPCOSPmodel, stat='log_D_index')
data(sampleValPCOSPmodel) # Plot dIndexForestPlot <- forestPlot(sampleValPCOSPmodel, stat='log_D_index')
GeneFuModel
Constructor MethodGeneFuModel
Constructor Method
GeneFuModel( trainCohorts = SurvivalExperiment(), minDaysSurvived = 365, ..., randomSeed )
GeneFuModel( trainCohorts = SurvivalExperiment(), minDaysSurvived = 365, ..., randomSeed )
trainCohorts |
A |
minDaysSurvived |
An |
... |
Fall through paramater to |
randomSeed |
An |
A GeneFuModel
object, with model parameters in the
set.seed(1987) geneFuModel <- GeneFuModel(randomSeed=1987)
set.seed(1987) geneFuModel <- GeneFuModel(randomSeed=1987)
SurvivalModel
Sub-class Designed to Hold A Survival Model Generated
Using the genefu
R package.A SurvivalModel
Sub-class Designed to Hold A Survival Model Generated
Using the genefu
R package.
SurvivalModel
object.This should be used to set the seed before model training to ensure reproducible results.
getModelSeed(object)
getModelSeed(object)
object |
An |
An integer
seed to be used when training the a SurivvalModel
.
data(samplePCOSPmodel) getModelSeed(samplePCOSPmodel)
data(samplePCOSPmodel) getModelSeed(samplePCOSPmodel)
This should be used to set the seed before model training to ensure reproducible results.
## S4 method for signature 'SurvivalModel' getModelSeed(object)
## S4 method for signature 'SurvivalModel' getModelSeed(object)
object |
A |
An integer
seed to be used when training the a SurivalModel
.
data(samplePCOSPmodel) getModelSeed(samplePCOSPmodel)
data(samplePCOSPmodel) getModelSeed(samplePCOSPmodel)
Get the Top Predictive Features from an S4 Object
getTopFeatures(object, ...)
getTopFeatures(object, ...)
object |
An |
... |
Allow additional parameters to be defined for this generic. |
A character
vector of top predictive features.
data(sampleTrainedPCOSPmodel) # Get the top features topFeatures <- getTopFeatures(sampleTrainedPCOSPmodel, numModels=2)
data(sampleTrainedPCOSPmodel) # Get the top features topFeatures <- getTopFeatures(sampleTrainedPCOSPmodel, numModels=2)
MultiAssayExperiment
objectGet the Top Ranked Features in a MultiAssayExperiment
object
## S4 method for signature 'MultiAssayExperiment' getTopFeatures(object, numFeats, ...)
## S4 method for signature 'MultiAssayExperiment' getTopFeatures(object, numFeats, ...)
object |
A |
numFeats |
An |
... |
Fall through arguments to |
A character
vector of top ranked features, with the features in
order of rank ascending.
rankFeatures,MultiAssayExperiment-method
Get the top features for classification using a PCOSP model object.
## S4 method for signature 'PCOSP' getTopFeatures(object, numModels)
## S4 method for signature 'PCOSP' getTopFeatures(object, numModels)
object |
A |
numModels |
An |
A character
vector of gene names representing the unique genes
from the top numModels
KTSPs models in the model object
.
data(sampleTrainedPCOSPmodel) # Get the top features topFeatures <- getTopFeatures(sampleTrainedPCOSPmodel, numModels=5)
data(sampleTrainedPCOSPmodel) # Get the top features topFeatures <- getTopFeatures(sampleTrainedPCOSPmodel, numModels=5)
SummarizedExperiment
objectGet the Top Ranked Features in a SummarizedExperiment
object
## S4 method for signature 'SummarizedExperiment' getTopFeatures(object, numFeats, ..., rankCol = "feature_rank")
## S4 method for signature 'SummarizedExperiment' getTopFeatures(object, numFeats, ..., rankCol = "feature_rank")
object |
A |
numFeats |
An |
... |
Fall through arguments to |
rankCol |
The name of the column containing the integer feature ranks.
Defaults to |
A character
vector of top ranked features, with the features in
order of rank ascending.
data(sampleICGCmicro) getTopFeatures(sampleICGCmicro, numFeats=20)
data(sampleICGCmicro) getTopFeatures(sampleICGCmicro, numFeats=20)
The classifier risk scores from Haider et al. (2014)
# Loads chen, birnbaum and haiderSigScores objects data(existingClassifierData)
# Loads chen, birnbaum and haiderSigScores objects data(existingClassifierData)
Check for Column Names in the colData Slot of a SummarizedExperiment
hasColDataColumns(SE, values)
hasColDataColumns(SE, values)
SE |
A |
values |
A |
logical
True if all of values are column names in the
SummarizedExperiment
object, FALSE otherwise.
SE <- SummarizedExperiment(matrix(rnorm(100), 10, 10), colData=data.frame(test=rep(1, 10))) hasColDataColumns(SE, 'test')
SE <- SummarizedExperiment(matrix(rnorm(100), 10, 10), colData=data.frame(test=rep(1, 10))) hasColDataColumns(SE, 'test')
SurvivalExperiments
, subsetting to shared rows and columnsMerge two SurvivalExperiments
, subsetting to shared rows and columns
## S4 method for signature 'SurvivalExperiment,SurvivalExperiment' merge(x, y, cohortNames)
## S4 method for signature 'SurvivalExperiment,SurvivalExperiment' merge(x, y, cohortNames)
x |
A |
y |
A |
cohortNames |
An optional |
A SurvivalExperiment
object with merge data from x and y, and
the assay from each in the assays
slot.
data(sampleICGCmicro) survExp2 <- sampleICGCmicro mergedSurvExp <- merge(survExp2, sampleICGCmicro, cohortNames=c('copyICGCmicro', 'ICGCmicro')) mergedSurvExp
data(sampleICGCmicro) survExp2 <- sampleICGCmicro mergedSurvExp <- merge(survExp2, sampleICGCmicro, cohortNames=c('copyICGCmicro', 'ICGCmicro')) mergedSurvExp
ModelComparison Constructor
ModelComparison(model1, model2, ...)
ModelComparison(model1, model2, ...)
model1 |
An object with a |
model2 |
An object with a |
... |
Not used. |
A ModelComparison
object, which is a wrapper for DataFrame
which is used for method dispatch.
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the models trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class clinicalPredCohortL <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortL) # Compare the models modelComp <- ModelComparison(sampleValPCOSPmodel, validatedClinicalModel) head(modelComp)
data(sampleValPCOSPmodel) data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train the models trainedClinicalModel <- trainModel(sampleClinicalModel) # Predict risk/risk-class clinicalPredCohortL <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate the models validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortL) # Compare the models modelComp <- ModelComparison(sampleValPCOSPmodel, validatedClinicalModel) head(modelComp)
S4
ObjectGeneric for Accessing the Model Parameters of an S4
Object
modelParams(object, ...)
modelParams(object, ...)
object |
A |
... |
Allow additional arguments to be defined for this generic. |
A List
- or list
-like object containing all the parameters needed
to reproduce a specific model training run, including environmental
settings like the random seed and RNGkind.
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) modelParams(metaclustModel)
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) modelParams(metaclustModel)
S4Model
ObjectAccessor for the Model Parameters of an S4Model
Object
## S4 method for signature 'S4Model' modelParams(object)
## S4 method for signature 'S4Model' modelParams(object)
object |
A |
A List
- or list
-like object containing all the parameters needed
to reproduce a specific model training run, including environmental
settings like the random seed and RNGkind.
S4
objectAccessor for the models slot of an S4
object
models(object, ...)
models(object, ...)
object |
An |
... |
Allow new parameters to be defined for this generic. |
An S4
object representing a model.
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) models(metaclustModel)
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) models(metaclustModel)
S4Model
ObjectGetter for the models slot of an S4Model
Object
## S4 method for signature 'S4Model' models(object)
## S4 method for signature 'S4Model' models(object)
object |
An |
An List
- or list
-like object representing a model.
SurvivalModel
objectGetter for the models slot of a SurvivalModel
object
## S4 method for signature 'SurvivalModel' models(object)
## S4 method for signature 'SurvivalModel' models(object)
object |
A |
A SimpleList
of top scoring KTSPmodels
data(samplePCOSPmodel) models(samplePCOSPmodel)
data(samplePCOSPmodel) models(samplePCOSPmodel)
SurvivalModel
objectSetter for the models slot of a SurvivalModel
object
## S4 replacement method for signature 'SurvivalModel,SimpleList' models(object) <- value
## S4 replacement method for signature 'SurvivalModel,SimpleList' models(object) <- value
object |
A |
value |
A |
None, updates the object.
data(samplePCOSPmodel) models(samplePCOSPmodel) <- SimpleList(model1=NA)
data(samplePCOSPmodel) models(samplePCOSPmodel) <- SimpleList(model1=NA)
S4Model Class for Metaclustering Using Network Community Search
Use igraph::fastgreedy.community
cross-cohort metaclusters for
a ConsensusMetaclusteringModel
which has been validated with
validateModel
.
NetworkCommunitySearchModel(model)
NetworkCommunitySearchModel(model)
model |
A validated |
An NCSModel
object containing the relevant data from the
ConsensusMetaclusteringModel
.
data.frame
ObjectNormalize a data.frame
Object
## S4 method for signature 'data.frame_or_matrix' normalize(object, MARGIN = 2, FUN = "proprocessCaret", ...)
## S4 method for signature 'data.frame_or_matrix' normalize(object, MARGIN = 2, FUN = "proprocessCaret", ...)
object |
A |
MARGIN |
An |
FUN |
A function to normalize your data with. Should accept a
rectangular object such as a |
... |
Fall through parameters to FUN. For the default FUN, these are
passed to |
The data.frame
normalized.
DFrame
ObjectNormalize a S4 DFrame
Object
## S4 method for signature 'DFrame' normalize(object, MARGIN = 2, FUN = "preprocessCaret", ...)
## S4 method for signature 'DFrame' normalize(object, MARGIN = 2, FUN = "preprocessCaret", ...)
object |
A |
MARGIN |
An |
FUN |
A function to normalize your data with. Should accept a
rectangular object such as a |
... |
Fall through parameters to FUN. For the default FUN, these are
passed to |
A normalized DFrame
object.
assays
of a MutliAssayExperiment
ObjectFor this method to work, there must be a normalize
method defined
for all classes of experiments in the MultiAssayExperiment
## S4 method for signature 'MultiAssayExperiment' normalize( object, MARGIN = 2, FUN = "preprocessCaret", ..., whichAssays = seq_along(assays(object)) )
## S4 method for signature 'MultiAssayExperiment' normalize( object, MARGIN = 2, FUN = "preprocessCaret", ..., whichAssays = seq_along(assays(object)) )
object |
A |
MARGIN |
An |
FUN |
A function to normalize your data with. Should accept a
rectangular object such as a |
... |
Fall through parameters to FUN. For the default FUN, these are
passed to |
whichAssays |
A |
When using the default FUN, it is also possible to impute missing values.
See ?caret::preProcess
for information on available methods.
The MultiAssayExperiment
with one or more of the assays normalized
and information about the normalization method in the normalization
item
of the object metadata
.
preprocessCaret
, caret::preProcess
assays
in a SummarizedExperiment
ObjectNormalize the assays
in a SummarizedExperiment
Object
## S4 method for signature 'SummarizedExperiment' normalize( object, MARGIN = 2, FUN = "preprocessCaret", ..., whichAssays = seq_along(assays(object)) )
## S4 method for signature 'SummarizedExperiment' normalize( object, MARGIN = 2, FUN = "preprocessCaret", ..., whichAssays = seq_along(assays(object)) )
object |
A |
MARGIN |
An |
FUN |
A function to normalize your data with. The function should accept a matrix, normalize the columns then return a matrix. The data will be transposed before applyying FUN if MARGIN=1. |
... |
Fall through parameters to FUN. When using the default FUN, the data is scaled and centered when no additional arguments are specified. |
whichAssays |
A |
When using the default FUN, it is also possible to impute missing values.
See ?caret::preProcess
for information on available methods.
The SummarizedExperiment
with one or more of the matrices in
assays
normalized and the normalization details in the normalization
item of the object metadata
.
preprocessCaret
, caret::preProcess
MultiAssayExperiment
containing cohorts of normal patients, for
package examples.A MultiAssayExperiment
containing cohorts of normal patients, for
package examples.
data(normalsMAE)
data(normalsMAE)
Predict optimal K values by minimizing the difference between the ECDF of clustering consensus at two points in a subinterval.
optimalKMinimizeAmbiguity(assayClusters, subinterval = c(0.1, 0.9))
optimalKMinimizeAmbiguity(assayClusters, subinterval = c(0.1, 0.9))
assayClusters |
A |
subinterval |
A |
A numeric
vector the same length as assayClusters
, with
an optimal K prediction for each assay in the rawdata
slot of
the trained ConsensusMetaclusteringModel
object which assayClusters
came from.
Pancreatic Cancer Overall Survival Predictor (PCOSP) Constructor
PCOSP(trainCohorts, minDaysSurvived = 365, ..., randomSeed)
PCOSP(trainCohorts, minDaysSurvived = 365, ..., randomSeed)
trainCohorts |
A |
minDaysSurvived |
An |
... |
Force subsequent parameters to be named. This parameter is not used. |
randomSeed |
An |
This function assumes there is only 1 assay per
SurvivalExperiment
.
A PCOSP
object with training data in the assays slot, concatenating
together the molecular data types and labelling the genes with the data
type to ensure the results are easily interpretable.
data(sampleICGCmicro) set.seed(1987) PCOSPmodel <- PCOSP(sampleICGCmicro, minDaysSurvived=365, randomSeed=1987)
data(sampleICGCmicro) set.seed(1987) PCOSPmodel <- PCOSP(sampleICGCmicro, minDaysSurvived=365, randomSeed=1987)
Class union used for method dispatch without inheritance
Class union used for method dispatch without inheritance
Pancreatic Cancer Overall Survival Predictor (PCOSP) Class
A Generic for Plotting a Network Graph From an S4 Object
plotNetworkGraph(object, ...)
plotNetworkGraph(object, ...)
object |
An |
... |
Allow additional arguments to be defined for this generic. |
A network plot, either as an object or via side effects.
Visualize metaclusters predicted using network community search on the consensus clustering results for a MultiAssayExperiment of patient cohorts.
## S4 method for signature 'NCSModel' plotNetworkGraph(object, ..., palette = "Set1", clusterLabels)
## S4 method for signature 'NCSModel' plotNetworkGraph(object, ..., palette = "Set1", clusterLabels)
object |
A classified |
... |
Not used, force subsequent arguments to be named. |
palette |
|
clusterLabels |
A |
A ggplot
object containing the network graph, showing the
relative edge distances between each cluster in each cohort along with
the predicted metacluster label.
S4
objectPlot ROC curves for an S4
object
plotROC(object, ...)
plotROC(object, ...)
object |
An |
... |
Allow new parameters to be added to this generic. |
A ggplot
object containing the ROC curves.
PCOSP
model object.Plot ROC curves for a PCOSP
model object.
## S4 method for signature 'PCOSP' plotROC(object, alpha = 0.05, ..., xlabel, ylabel, title)
## S4 method for signature 'PCOSP' plotROC(object, alpha = 0.05, ..., xlabel, ylabel, title)
object |
A |
alpha |
A |
... |
Catch unnamed parameters. Not used. |
xlabel |
A |
ylabel |
A |
title |
A |
A ggplot
object containing the ROC curves.
data(sampleValPCOSPmodel) # Plot ROC curves AUROCplot <- plotROC(sampleValPCOSPmodel)
data(sampleValPCOSPmodel) # Plot ROC curves AUROCplot <- plotROC(sampleValPCOSPmodel)
S4
ObjectGeneric for Plotting Survival Curves from an S4
Object
plotSurvivalCurves(object, ...)
plotSurvivalCurves(object, ...)
object |
An |
... |
Allow new parameters to be defined on this generic. |
A plot, either via side-effects or as the return value.
CoxModel
ObjectPlot Survival Curves from a Fit CoxModel
Object
## S4 method for signature 'CoxModel' plotSurvivalCurves(object, byCohort = TRUE, ..., facet.by = "cohort")
## S4 method for signature 'CoxModel' plotSurvivalCurves(object, byCohort = TRUE, ..., facet.by = "cohort")
object |
A |
byCohort |
|
... |
Fall through parameters to |
facet.by |
What column of the object |
A ggplot
or list
of ggplot objects containing the survival
curves for each cohort in the trainData
slot of the CoxModel
.
Predict Classes for New Data Based on a Train Classifier Model
predictClasses(object, model, ...)
predictClasses(object, model, ...)
object |
An |
model |
An |
... |
Allow further parameters to be defined on this generic. |
The S4
object with class predictions added to the metadata.
data(sampleTrainedPCOSPmodel) data(samplePCSIsurvExp) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Make predictions PCOSPpredSurvExp <- predictClasses(samplePCSIsurvExp, model=sampleTrainedPCOSPmodel) head(colData(PCOSPpredSurvExp))
data(sampleTrainedPCOSPmodel) data(samplePCSIsurvExp) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Make predictions PCOSPpredSurvExp <- predictClasses(samplePCSIsurvExp, model=sampleTrainedPCOSPmodel) head(colData(PCOSPpredSurvExp))
CohortList
of
SurvivalExperment
Objects.Use a Clinical GLM to Predict Classes for a CohortList
of
SurvivalExperment
Objects.
## S4 method for signature 'CohortList,ClinicalModel' predictClasses(object, model, ..., na.action = "na.exclude", type = "response")
## S4 method for signature 'CohortList,ClinicalModel' predictClasses(object, model, ..., na.action = "na.exclude", type = "response")
object |
A |
model |
A trained |
... |
Fall through parameters to |
na.action |
The |
type |
The |
A CohortList
with the model predictions in the colData
slot as clinical_prob_good for each SurvivalExperiment
, and the
model in the metadata as predictionModel.
data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train Model trainedClinicalModel <- trainModel(sampleClinicalModel) # Make predictions ClinicalPredCohortList <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) head(colData(ClinicalPredCohortList[[1]]))
data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train Model trainedClinicalModel <- trainModel(sampleClinicalModel) # Make predictions ClinicalPredCohortList <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) head(colData(ClinicalPredCohortList[[1]]))
genefu
Package
to Predict Signature Scores for Each SampleUse a Gene Signature Based Prediciton Model from the genefu
Package
to Predict Signature Scores for Each Sample
## S4 method for signature 'CohortList,GeneFuModel' predictClasses(object, model, ..., annot = NA)
## S4 method for signature 'CohortList,GeneFuModel' predictClasses(object, model, ..., annot = NA)
object |
A |
model |
A trained |
... |
Fall through parameters to |
annot |
The |
A CohortList
with the model predictions in the colData
slot as genefu_score for each SurvivalExperiment
, and the
model in the metadata as predictionModel.
CohortList
Using
a PCOSP
, RLSModel
or RGAModel
object.Predict Survival Prognosis Classes and Risk Scores for A CohortList
Using
a PCOSP
, RLSModel
or RGAModel
object.
## S4 method for signature 'CohortList,PCOSP_or_RLS_or_RGA' predictClasses(object, model, ...)
## S4 method for signature 'CohortList,PCOSP_or_RLS_or_RGA' predictClasses(object, model, ...)
object |
A |
model |
A trained |
... |
Fall through arguments to |
A CohortList
with the model predictions attached to each
SurvivalExperiment
in the metadata slot and the prob_good_survival
column added to the colData slot.
data(sampleTrainedPCOSPmodel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Make predictions PCOSPpredCohortList <- predictClasses(sampleCohortList[seq_len(2)], model=sampleTrainedPCOSPmodel) head(colData(PCOSPpredCohortList[[1]]))
data(sampleTrainedPCOSPmodel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Make predictions PCOSPpredCohortList <- predictClasses(sampleCohortList[seq_len(2)], model=sampleTrainedPCOSPmodel) head(colData(PCOSPpredCohortList[[1]]))
Compute the optimal clustering solution out of possibilities generated
with trainModel. Assigns the cluster labels to the MultiAssayExperiment
object.
## S4 method for signature 'ConsensusMetaclusteringModel,ANY' predictClasses(object, ..., optimal_k_function = optimalKMinimizeAmbiguity)
## S4 method for signature 'ConsensusMetaclusteringModel,ANY' predictClasses(object, ..., optimal_k_function = optimalKMinimizeAmbiguity)
object |
A |
... |
Fall through arguments to |
optimal_k_function |
A function which accepts as its input |
A object
ConsensusMetaclusteringModel
, with class predictions
assigned to the colData of trianData
Predict Metacluster Labels for a NetworkCommunitySearchModel
## S4 method for signature 'NCSModel,ANY' predictClasses(object)
## S4 method for signature 'NCSModel,ANY' predictClasses(object)
object |
A |
The object
model with
SurvivalModel
Using
a ClinicalModel
Object.Predict Survival Prognosis Classes and Risk Scores for A SurvivalModel
Using
a ClinicalModel
Object.
## S4 method for signature 'SurvivalExperiment,ClinicalModel' predictClasses(object, model, ..., na.action = "na.exclude", type = "response")
## S4 method for signature 'SurvivalExperiment,ClinicalModel' predictClasses(object, model, ..., na.action = "na.exclude", type = "response")
object |
A |
model |
A trained |
... |
Fall through parameters to |
na.action |
The |
type |
The |
A SurvivalExperiment
with the model predictions in the colData
slot as clinical_prob_good.
data(sampleClinicalModel) data(samplePCSIsurvExp) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train Model trainedClinicalModel <- trainModel(sampleClinicalModel) # Make predictions ClinicalPredSurvExp <- predictClasses(samplePCSIsurvExp, model=trainedClinicalModel) head(colData(ClinicalPredSurvExp))
data(sampleClinicalModel) data(samplePCSIsurvExp) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train Model trainedClinicalModel <- trainModel(sampleClinicalModel) # Make predictions ClinicalPredSurvExp <- predictClasses(samplePCSIsurvExp, model=trainedClinicalModel) head(colData(ClinicalPredSurvExp))
genefu
Package
to Predict Signature Scores for Each Sample.Use a Gene Signature Based Prediciton Model from the genefu
Package
to Predict Signature Scores for Each Sample.
## S4 method for signature 'SurvivalExperiment,GeneFuModel' predictClasses(object, model, ..., annot = NA)
## S4 method for signature 'SurvivalExperiment,GeneFuModel' predictClasses(object, model, ..., annot = NA)
object |
A |
model |
A |
... |
Fall through parameters to |
annot |
A named parameter with annotations mapping from the gene identifiers in the genefu model. |
A signature score should be interpreted as unit-less continuous risk predictor.
The SurvivalExperiment
passed to the object
argument with
the genefu_score
column added to the objects colData
slot.
CohortList
Using
a PCOSP
, RLSModel
or RGAModel
object.Predict Survival Prognosis Classes and Risk Scores for A CohortList
Using
a PCOSP
, RLSModel
or RGAModel
object.
## S4 method for signature 'SurvivalExperiment,PCOSP_or_RLS_or_RGA' predictClasses(object, model, ...)
## S4 method for signature 'SurvivalExperiment,PCOSP_or_RLS_or_RGA' predictClasses(object, model, ...)
object |
A |
model |
A trained |
... |
Fall through arguments to |
A SurvivalExperiment
with the predictions in its metadata and
a column in colData, prob_good_survival
, which contains the proportion
of models which predicted good prognosis for each sample.
BiocParallel::bplapply
, switchBox::SWAP.KTSP.Classify
data(sampleTrainedPCOSPmodel) data(samplePCSIsurvExp) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Make predictions PCOSPpredSurvExp <- predictClasses(samplePCSIsurvExp, model=sampleTrainedPCOSPmodel) head(colData(PCOSPpredSurvExp))
data(sampleTrainedPCOSPmodel) data(samplePCSIsurvExp) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Make predictions PCOSPpredSurvExp <- predictClasses(samplePCSIsurvExp, model=sampleTrainedPCOSPmodel) head(colData(PCOSPpredSurvExp))
caret::preProcess
method, then return the
normalized data using predict
.Preprocess Data Using the caret::preProcess
method, then return the
normalized data using predict
.
preprocessCaret(x, ...)
preprocessCaret(x, ...)
x |
The data to be normalized with |
... |
Fall through parameters to |
x
preprocessed according to the arguments in ...
.
caret::preProcess
, stats::predict
RandomGeneAssignmentModel Constructor
RandomGeneAssignmentModel(trainCohorts, minDaysSurvived = 365, ..., randomSeed)
RandomGeneAssignmentModel(trainCohorts, minDaysSurvived = 365, ..., randomSeed)
trainCohorts |
A 'SurvivelExperiment' containing training data for
the |
minDaysSurvived |
An |
... |
Force subsequent parameters to be named. Not used. |
randomSeed |
An |
A SurvivalModel
object.
data(sampleICGCmicro) set.seed(1987) RGAmodel <- RGAModel(sampleICGCmicro, minDaysSurvived=365, randomSeed=1987)
data(sampleICGCmicro) set.seed(1987) RGAmodel <- RGAModel(sampleICGCmicro, minDaysSurvived=365, randomSeed=1987)
RandomLabelShufflingModel Constructor
RandomLabelShufflingModel(trainCohorts, minDaysSurvived = 365, ..., randomSeed)
RandomLabelShufflingModel(trainCohorts, minDaysSurvived = 365, ..., randomSeed)
trainCohorts |
A 'SurvivelExperiment' containing training data for
the |
minDaysSurvived |
An |
... |
Force subsequent parameters to be named. Not used. |
randomSeed |
An |
A SurvivalModel
object.
data(sampleICGCmicro) set.seed(1987) RLSmodel <- RLSModel(sampleICGCmicro, minDaysSurvived=365, randomSeed=1987)
data(sampleICGCmicro) set.seed(1987) RLSmodel <- RLSModel(sampleICGCmicro, minDaysSurvived=365, randomSeed=1987)
S4
ObjectRank the Features in a S4
Object
rankFeatures(object, ...)
rankFeatures(object, ...)
object |
An |
... |
Allow new parameters to be defined for this generic. |
The object
with the features per value and ranking of the features
in the rowData
slow of the object.
data(sampleICGCmicro) rankFeatures(sampleICGCmicro)
data(sampleICGCmicro) rankFeatures(sampleICGCmicro)
MultiAssayExperiment
ObjectRank the Features in a MultiAssayExperiment
Object
## S4 method for signature 'MultiAssayExperiment' rankFeatures( object, FUN = "mad", RANK_FUN = "dense_rank", ..., descending = TRUE, weights )
## S4 method for signature 'MultiAssayExperiment' rankFeatures( object, FUN = "mad", RANK_FUN = "dense_rank", ..., descending = TRUE, weights )
object |
A |
FUN |
A vectorized feature scoring function, such as |
RANK_FUN |
A ranking function, such as |
... |
Fall through arguments to |
descending |
Should your rank function be called with |
weights |
A named |
The MultiAssayExperiment
with the item featureRanks
in the object
metadata, which stores a DataFrame
containing ranks accross all assays for
each unique feature and the additional columns feature_score
and feature_rank
,
as calculated with FUN
and RANK_FUN
, respectively. Information
about which functions were used for each column can be found in the object
mcols
in the calculated_with
column.
BiocGenerics::mad
, dplyr::dense_rank
,
matrixStats::weightedMedian
SummarizedExperiment
ObjectRank the Features in a SummarizedExperiment
Object
## S4 method for signature 'SummarizedExperiment' rankFeatures( object, FUN = "rowMads", RANK_FUN = "dense_rank", ..., descending = TRUE, assay = 1 )
## S4 method for signature 'SummarizedExperiment' rankFeatures( object, FUN = "rowMads", RANK_FUN = "dense_rank", ..., descending = TRUE, assay = 1 )
object |
A |
FUN |
A row-wise summary function, such as |
RANK_FUN |
A ranking function, such as |
... |
Fall through arguments to |
descending |
Should your rank function be called with |
assay |
|
The SummarizedExperiment
with the column feature_score
and
feature_rank
in the rowData
slot. Information about which functions
where used for each column can be found in the object mcols
in the
calculated_with
column.
data(sampleICGCmicro) rankFeatures(sampleICGCmicro, FUN='rowMads', RANK_FUN='dense_rank')
data(sampleICGCmicro) rankFeatures(sampleICGCmicro, FUN='rowMads', RANK_FUN='dense_rank')
colData
of an S4
objectRemave any factor columns from the colData
of an S4
object
removeColDataFactorColumns(x)
removeColDataFactorColumns(x)
x |
An |
x
with colData factor columsn converted to either integer or
character, as appropriate.
data(sampleICGCmicro) removeColDataFactorColumns(sampleICGCmicro)
data(sampleICGCmicro) removeColDataFactorColumns(sampleICGCmicro)
Convert factor columns in a rectangular object
removeFactorColumns(x)
removeFactorColumns(x)
x |
A list-like rectangular object such as a |
x
with factor columns converted to either integer or character,
as appropriate.
x <- data.frame(a=factor(LETTERS[1:5]), b=factor(runif(5, 0, 1))) removeFactorColumns(x)
x <- data.frame(a=factor(LETTERS[1:5]), b=factor(runif(5, 0, 1))) removeFactorColumns(x)
colData
slot, or do nothing if they don't matchRename the columns in the colData
slot, or do nothing if they don't match
renameColDataColumns(x, values)
renameColDataColumns(x, values)
x |
An |
values |
A character vector where names are the existing column names and values are the new column names. |
x
with updated column names, if they match any existing columns.
data(sampleICGCmicro) renameColDataColumns(sampleICGCmicro, c(event_occurred='days_survived'))
data(sampleICGCmicro) renameColDataColumns(sampleICGCmicro, c(event_occurred='days_survived'))
Rename columns or do nothing if the names don't match
renameColumns(x, values)
renameColumns(x, values)
x |
An object for which |
values |
A character vector where names are the old column names
and values are the new column names. Uses |
x
with the updated column names if they are present. Does not
fail if the column names are missing.
x <- data.frame(a=factor(LETTERS[1:5]), b=factor(runif(5, 0, 1))) renameColumns(x, c(a='c'))
x <- data.frame(a=factor(LETTERS[1:5]), b=factor(runif(5, 0, 1))) renameColumns(x, c(a='c'))
Run Gene Set Enrichment Analysis
runGSEA(object, geneSet, ...)
runGSEA(object, geneSet, ...)
object |
An |
geneSet |
An object representing a gene set, such as a |
... |
Allow additional parameters to be defined for this generic. |
A data.frame
containing the significantly enriched gene sets.
PCOSP
Model Object.Run Gene Set Enrichment Analysis On A PCOSP
Model Object.
## S4 method for signature 'PCOSP,data.frame' runGSEA(object, geneSet, numModels, ..., adjMethod = "fdr", allResults = FALSE)
## S4 method for signature 'PCOSP,data.frame' runGSEA(object, geneSet, numModels, ..., adjMethod = "fdr", allResults = FALSE)
object |
A |
geneSet |
A |
numModels |
The number of models to use when selecting the top features
from the PCOSP model in |
... |
Force subsequent parameters to be named. Not used. |
adjMethod |
An optional parameter specifying the multiple testing
correction to use in |
allResults |
Return the full results from |
A data.table
containing the significantly enriched gene sets.
S4
Virtual Class For the Concept of a Statistical or ML ModelAn S4
Virtual Class For the Concept of a Statistical or ML Model
trainData
An object inheriting from List
or list
representing
the training data for the model.
modelParams
An object inherting from List
or list
representing
the parameters needed to train the model.
models
An object inheriting from List
or list
representing the
trained models.
validationStats
An object inheriting from DFrame
or data.frame
and storing statistics assessing model performance.
validationData
An object inheriting List
or list
representing
the data used to validate or evaluate the performance of a model.
elementMetadata
A DataFrame
or 'data.frame' of item metadata for
the models
slot.
metadata
A List
or list
of model level metadata.
MetaGxPancreas
as training data.Sample ClinicalModel Containing the ICGC micro-array cohort from
MetaGxPancreas
as training data.
MetaGxPancreas::loadPancreasDatasets
data(sampleClinicalModel)
data(sampleClinicalModel)
A CohortList
object containing sample data for the PCOSP vignette. This
data is a subset of the the Pancreas datasets available in MetaGxPancreas
.
MetaGxPancreas::loadPancreasDatasets
data(sampleCohortList)
data(sampleCohortList)
MetaGxPancreas
A Sample SurvivalExperiment Containing Data from the ICGC micro-array
cohort from MetaGxPancreas
MetaGxPancreas::loadPancreasDatasets
data(sampleICGCmicro)
data(sampleICGCmicro)
MetaGxPancreas
as training data.A Sample PCOSP Model Containing the ICGC micro-array cohort from
MetaGxPancreas
as training data.
MetaGxPancreas::loadPancreasDatasets
data(samplePCOSPmodel)
data(samplePCOSPmodel)
Sample CohortList with PCOSP Risk Predictions
MetaGxPancreas::loadPancreasDatasets
data(samplePCOSPpredList)
data(samplePCOSPpredList)
MetaGxPancreas
.Used as validation data for modelling examples
MetaGxPancreas::loadPancreasDatasets
data(samplePCSIsurvExp)
data(samplePCSIsurvExp)
MetaGxPancreas
as training data.Sample RGA Model Containing the ICGC micro-array cohort from
MetaGxPancreas
as training data.
MetaGxPancreas::loadPancreasDatasets
data(sampleRGAmodel)
data(sampleRGAmodel)
MetaGxPancreas
as training data.Sample RLS Model Containing the ICGC micro-array cohort from
MetaGxPancreas
as training data.
MetaGxPancreas::loadPancreasDatasets
data(sampleRLSmodel)
data(sampleRLSmodel)
MetaGxPancreas
as training data.A Sample Trained PCOSP Model Containing the ICGC micro-array cohort from
MetaGxPancreas
as training data.
MetaGxPancreas::loadPancreasDatasets
data(sampleTrainedPCOSPmodel)
data(sampleTrainedPCOSPmodel)
Sample Validated PCOSP Model for Plotting Examples
MetaGxPancreas::loadPancreasDatasets
data(sampleValPCOSPmodel)
data(sampleValPCOSPmodel)
S4Model
Show method for Classes Inheriting from S4Model
## S4 method for signature 'S4Model' show(object)
## S4 method for signature 'S4Model' show(object)
object |
A |
None, prints to console.
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) metaclustModel
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) metaclustModel
CohortList
Works using endoapply of [
over the list SurvivalExperiment
s
## S4 method for signature 'CohortList' subset(x, subset = TRUE, select = TRUE, invert = FALSE)
## S4 method for signature 'CohortList' subset(x, subset = TRUE, select = TRUE, invert = FALSE)
x |
A |
subset |
The row query. Defaults to TRUE, i.e., select all. |
select |
The column query. Defaults to TRUE, i.e., select all. |
invert |
A |
A CohortList
containing only the rows and columns selected in i
and j, respectively.
data(sampleCohortList) commonGenes <- findCommonGenes(sampleCohortList) commonGenesCohortList <- subset(sampleCohortList, subset=commonGenes)
data(sampleCohortList) commonGenes <- findCommonGenes(sampleCohortList) commonGenesCohortList <- subset(sampleCohortList, subset=commonGenes)
SurvivalExperiment
Class
Builds a SurvivalExperiment
object, which is just a wrapper for a
SummarizedExperiment
with mandatory survival metadata numeric columns
survival_time
and event_occurred
.Constructor for SurvivalExperiment
Class
Builds a SurvivalExperiment
object, which is just a wrapper for a
SummarizedExperiment
with mandatory survival metadata numeric columns
survival_time
and event_occurred
.
SurvivalExperiment( ..., survival_time = "survival_time", event_occurred = "event_occurred" )
SurvivalExperiment( ..., survival_time = "survival_time", event_occurred = "event_occurred" )
... |
|
survival_time |
A |
event_occurred |
A |
A SurvivalExperiment
object.
data(sampleICGCmicro) # build a SurvivalExperiment from raw data ICGCmicro <- SurvivalExperiment(assays=assays(sampleICGCmicro), rowData=rowData(sampleICGCmicro), colData=colData(sampleICGCmicro), metadata=metadata(sampleICGCmicro), survival_time='survival_time', event_occurred='event_occurred') # build a SurvivalExperiment from an existig SummarizedExperment ICGCmicroSumExp <- as(sampleICGCmicro, 'SummarizedExperiment') ICGCmicro <- SurvivalExperiment(ICGCmicroSumExp, survival_time='survival_time', event_occurred='event_occurred')
data(sampleICGCmicro) # build a SurvivalExperiment from raw data ICGCmicro <- SurvivalExperiment(assays=assays(sampleICGCmicro), rowData=rowData(sampleICGCmicro), colData=colData(sampleICGCmicro), metadata=metadata(sampleICGCmicro), survival_time='survival_time', event_occurred='event_occurred') # build a SurvivalExperiment from an existig SummarizedExperment ICGCmicroSumExp <- as(sampleICGCmicro, 'SummarizedExperiment') ICGCmicro <- SurvivalExperiment(ICGCmicroSumExp, survival_time='survival_time', event_occurred='event_occurred')
A SummarizedExperiment with mandatory numeric survival metadata columns
survival_time
and event_occurred
.
Constructor for a SurvivalModel Object.
SurvivalModel(trainCohorts, minDaysSurvived = 365, ..., randomSeed)
SurvivalModel(trainCohorts, minDaysSurvived = 365, ..., randomSeed)
trainCohorts |
A 'SurvivelExperiment' containing training data for
the |
minDaysSurvived |
An |
... |
Force subsequent parameters to be named. Not used. |
randomSeed |
An |
A SurvivalModel
object.
data(sampleICGCmicro) set.seed(1987) survModel <- SurvivalModel(sampleICGCmicro, minDaysSurvived=365, randomSeed=1987)
data(sampleICGCmicro) set.seed(1987) survModel <- SurvivalModel(sampleICGCmicro, minDaysSurvived=365, randomSeed=1987)
An S4 class with a number of predefined methods for accessing slots relavant to a surival model. More specific model types will inherit from this class for their accessor methods and constructor.
models
A SimpleList
containing one or more model object.
validationData
A CohortList
containing one or more SurvivalExperiment
objects used to validate the model. This slot is populated by the when the
validateModel
method is called on a SurvivalModel
object.
validationStats
A data.frame
object containing validation statistics
calculated by the validateModel
method.
data(sampleICGCmicro) set.seed(1987) survModel <- SurvivalModel(sampleICGCmicro, minDaysSurvived=385, randomSeed=1987)
data(sampleICGCmicro) set.seed(1987) survModel <- SurvivalModel(sampleICGCmicro, minDaysSurvived=385, randomSeed=1987)
S4
ObjectGeneric for Accessing the Training Data of an S4
Object
trainData(object, ...)
trainData(object, ...)
object |
An |
... |
Allow new parameters to be defined for this generic. |
The training data for an S4 object.
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987)
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987)
S4Model
ObjectAccessor for the Training Data in a S4Model
Object
## S4 method for signature 'S4Model' trainData(object)
## S4 method for signature 'S4Model' trainData(object)
object |
An |
The training data for an S4Model
Object.
S4
ObjectGeneric for Accessing the Training Data of an S4
Object
trainData(object, ...) <- value
trainData(object, ...) <- value
object |
An |
... |
Allow new parameters to be defined for this generic. |
value |
An object to place in the objects training data slot. |
None, updates the object.
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) trainData(metaclustModel) <- CSPC_MAE
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) trainData(metaclustModel) <- CSPC_MAE
Train a Model Based on the Data in an S4 Object
trainModel(object, ...)
trainModel(object, ...)
object |
An |
... |
Allow new method to be defined for this generic. |
The same object with the @model slot populated with the fit model
data(samplePCOSPmodel) set.seed(getModelSeed(samplePCOSPmodel)) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) trainModel(samplePCOSPmodel, numModels=5, minAccuracy=0.6)
data(samplePCOSPmodel) set.seed(getModelSeed(samplePCOSPmodel)) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) trainModel(samplePCOSPmodel, numModels=5, minAccuracy=0.6)
ClinicalModel
Object.Fit a GLM Using Clinical Predictors Specified in a ClinicalModel
Object.
## S4 method for signature 'ClinicalModel' trainModel( object, ..., family = binomial(link = "logit"), na.action = na.exclude )
## S4 method for signature 'ClinicalModel' trainModel( object, ..., family = binomial(link = "logit"), na.action = na.exclude )
object |
A |
... |
Fall through parameters to the |
family |
Argument to the family parameter of |
na.action |
Argument to the na.action paramater of |
A ClinicalModel
object with a glm
object in the models slot.
data(sampleClinicalModel) set.seed(getModelSeed(sampleClinicalModel)) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) trainedClinicalModel <- trainModel(sampleClinicalModel)
data(sampleClinicalModel) set.seed(getModelSeed(sampleClinicalModel)) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) trainedClinicalModel <- trainModel(sampleClinicalModel)
Since consensus clustering is an unsuperived learning method, there isn't
really a 'training step' per se. Instead this method computes the consensus
clusters and stores the results in the models
slot.
## S4 method for signature 'ConsensusMetaclusteringModel' trainModel( object, maxK = 5, reps = 10, distance = "pearson", clusterAlg = "hc", plot = NULL, ... )
## S4 method for signature 'ConsensusMetaclusteringModel' trainModel( object, maxK = 5, reps = 10, distance = "pearson", clusterAlg = "hc", plot = NULL, ... )
object |
A |
maxK |
The maximum number of clusters to test. Defaults to 5. |
reps |
How many random samples should clustering be repeated on? Default is 10, but 1000+ is recommended for real world use. |
distance |
The distance method to use. Defaults to 'pearson'. See
|
clusterAlg |
The clustering algorithm to use. Defaults to 'hc'. See
|
plot |
An optional path to output the plots generated by each
call to |
... |
Fall through parameters to |
The ConsensusMetaclusteringModel
with the clustering results in the
models
slot.
Computes models with the survival
package for coxph
, survfit
,
survdiff
as well as computes the fit p-values using pchisq
with the
chisq values from survdiff
. Modelling data is stored in modelData
,
as well as a data.table
with all model data merged in modelDT
. These
items are all assigned to the models
slot.
## S4 method for signature 'CoxModel' trainModel(object)
## S4 method for signature 'CoxModel' trainModel(object)
object |
A |
A CoxModel
object with the results of coxph
, survfit
and
survdiff
in the models slot as lists where each item corresponds to
the data in modelData
. For convenience, all the model data has also
been merged into a single data.table
in the modelDT
item of models
.
Train a GeneFuModel Object
## S4 method for signature 'GeneFuModel' trainModel(object)
## S4 method for signature 'GeneFuModel' trainModel(object)
object |
A |
An error message, since we have not finished implementing this functionality yet.
Train a NetworkCommunitySearchModel
## S4 method for signature 'NCSModel' trainModel(object, alpha = 0.05, minRepro = 0.5, minCor = 0)
## S4 method for signature 'NCSModel' trainModel(object, alpha = 0.05, minRepro = 0.5, minCor = 0)
object |
An |
alpha |
A |
minRepro |
A |
minCor |
A |
The NCSModel
from object
with the networkEdges
item of the
models
slot fitlered based on the specified criteria. The criteria are
also stored in the modelParam
slots to ensure reproducibility.
trainMatrix
.Uses the switchBox SWAP.Train.KTSP function to fit a number of k top scoring pair models to the data, filtering the results to the best models based on the specified paramters.
## S4 method for signature 'PCOSP' trainModel(object, numModels = 10, minAccuracy = 0.6, ...)
## S4 method for signature 'PCOSP' trainModel(object, numModels = 10, minAccuracy = 0.6, ...)
object |
A |
numModels |
An |
minAccuracy |
A |
... |
Fall through arguments to |
This function is parallelized with BiocParallel, thus if you wish to change the back-end for parallelization, number of threads, or any other parallelization configuration please pass BPPARAM to bplapply.
A PCOSP
object with the trained model in the model
slot.
switchBox::SWAP.KTSP.Train BiocParallel::bplapply
data(samplePCOSPmodel) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) set.seed(getModelSeed(samplePCOSPmodel)) trainModel(samplePCOSPmodel, numModels=2, minAccuracy=0.6)
data(samplePCOSPmodel) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) set.seed(getModelSeed(samplePCOSPmodel)) trainModel(samplePCOSPmodel, numModels=2, minAccuracy=0.6)
Uses the switchBox SWAP.Train.KTSP function to fit a number of k top scoring pair models to the data, filtering the results to the best models based on the specified paramters.
## S4 method for signature 'RGAModel' trainModel(object, numModels = 10, minAccuracy = 0, ...)
## S4 method for signature 'RGAModel' trainModel(object, numModels = 10, minAccuracy = 0, ...)
object |
A |
numModels |
An |
minAccuracy |
A |
... |
Fall through arguments to |
This function is parallelized with BiocParallel, thus if you wish to change the back-end for parallelization, number of threads, or any other parallelization configuration please pass BPPARAM to bplapply.
A RGAModel
object with the trained model in the model
slot.
switchBox::SWAP.KTSP.Train
BiocParallel::bplapply
data(sampleRGAmodel) set.seed(getModelSeed(sampleRGAmodel)) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) trainedRGAmodel <- trainModel(sampleRGAmodel, numModels=2, minAccuracy=0)
data(sampleRGAmodel) set.seed(getModelSeed(sampleRGAmodel)) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) trainedRGAmodel <- trainModel(sampleRGAmodel, numModels=2, minAccuracy=0)
trainMatrix
.Uses the switchBox SWAP.Train.KTSP function to fit a number of k top scoring pair models to the data, filtering the results to the best models based on the specified paramters.
## S4 method for signature 'RLSModel' trainModel(object, numModels = 10, minAccuracy = 0, ...)
## S4 method for signature 'RLSModel' trainModel(object, numModels = 10, minAccuracy = 0, ...)
object |
A |
numModels |
An |
minAccuracy |
This parameter should be set to zero, since we do not expect the permuted models to perform well. Setting this higher will result in an ensemble with very few models included. |
... |
Fall through arguments to |
This function is parallelized with BiocParallel, thus if you wish to change the back-end for parallelization, number of threads, or any other parallelization configuration please pass BPPARAM to bplapply.
A PCOSP
object with the trained model in the model
slot.
switchBox::SWAP.KTSP.Train BiocParallel::bplapply
data(sampleRLSmodel) set.seed(getModelSeed(sampleRLSmodel)) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) trainedRLSmodel <- trainModel(sampleRLSmodel, numModels=2)
data(sampleRLSmodel) set.seed(getModelSeed(sampleRLSmodel)) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) trainedRLSmodel <- trainModel(sampleRLSmodel, numModels=2)
S4
Object Representing a Trained ModelPerform Validation on an S4
Object Representing a Trained Model
validateModel(model, valData, ...)
validateModel(model, valData, ...)
model |
An |
valData |
|
... |
Allow new parameters to be defined for this generic. |
The S4
object with added model performance metadata.
data(sampleTrainedPCOSPmodel) data(samplePCOSPpredList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Validate model validatedPCOSPmodel <- validateModel(sampleTrainedPCOSPmodel, valData=samplePCOSPpredList[[1]])
data(sampleTrainedPCOSPmodel) data(samplePCOSPpredList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Validate model validatedPCOSPmodel <- validateModel(sampleTrainedPCOSPmodel, valData=samplePCOSPpredList[[1]])
Evaluate the Performance of a List of Trained KTSP Models from a PCOSP Model
## S4 method for signature 'ClinicalModel,CohortList' validateModel(model, valData, ...)
## S4 method for signature 'ClinicalModel,CohortList' validateModel(model, valData, ...)
model |
A trained |
valData |
A |
... |
Fallthrough arguments to |
The model
object with the validationStats and validationData
slots occupied.
BiocParallel::bplapply
, switchBox::SWAP.KTSP.Classify
data(sampleClinicalModel) data(samplePCSIsurvExp) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train Model trainedClinicalModel <- trainModel(sampleClinicalModel) # Make predictions clinicalPredSurvExp <- predictClasses(samplePCSIsurvExp, model=trainedClinicalModel) # Validate model validatedClincalModel <- validateModel(trainedClinicalModel, valData=clinicalPredSurvExp)
data(sampleClinicalModel) data(samplePCSIsurvExp) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train Model trainedClinicalModel <- trainModel(sampleClinicalModel) # Make predictions clinicalPredSurvExp <- predictClasses(samplePCSIsurvExp, model=trainedClinicalModel) # Validate model validatedClincalModel <- validateModel(trainedClinicalModel, valData=clinicalPredSurvExp)
Validate a ClinicalModel object with a single SurvivalExperiment object.
## S4 method for signature 'ClinicalModel,SurvivalExperiment' validateModel(model, valData)
## S4 method for signature 'ClinicalModel,SurvivalExperiment' validateModel(model, valData)
model |
A |
valData |
A |
The ClinicalModel
with the validation statistics in the
validationStats
slot and the validation data in the validationData
slot.
data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train Model trainedClinicalModel <- trainModel(sampleClinicalModel) # Make predictions clinicalPredCohortList <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate model validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortList)
data(sampleClinicalModel) data(sampleCohortList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Train Model trainedClinicalModel <- trainModel(sampleClinicalModel) # Make predictions clinicalPredCohortList <- predictClasses(sampleCohortList[c('PCSI', 'TCGA')], model=trainedClinicalModel) # Validate model validatedClinicalModel <- validateModel(trainedClinicalModel, valData=clinicalPredCohortList)
Compute the Inter-Cohort Cluster Correlation and Clustering Reproducibility of All Clusters in Each Cohort.
## S4 method for signature ## 'ConsensusMetaclusteringModel,ConsensusMetaclusteringModel' validateModel(model, valData, ...)
## S4 method for signature ## 'ConsensusMetaclusteringModel,ConsensusMetaclusteringModel' validateModel(model, valData, ...)
model |
A |
valData |
A |
... |
Fallthrough parameters to |
The ConsensusMetaclusteringModel
from object, with the training
data from valData
in the validationData
slot, the models from the
valData
object appended to the models
of object, and the
validationStats
slot populated with pair-wise comparisons between
all experiments in both model
and valData
.
Evaluate the Performance of a List of Trained KTSP Models from a PCOSP Model
## S4 method for signature 'GeneFuModel,CohortList' validateModel(model, valData, ...)
## S4 method for signature 'GeneFuModel,CohortList' validateModel(model, valData, ...)
model |
A |
valData |
A |
... |
Fallthrough arguments to |
The model
object with the validationStats and validationData
slots occupied.
BiocParallel::bplapply
, switchBox::SWAP.KTSP.Classify
data(sampleTrainedPCOSPmodel) data(samplePCOSPpredList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Validate model validatedPCOSPmodel <- validateModel(sampleTrainedPCOSPmodel, valData=samplePCOSPpredList)
data(sampleTrainedPCOSPmodel) data(samplePCOSPpredList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Validate model validatedPCOSPmodel <- validateModel(sampleTrainedPCOSPmodel, valData=samplePCOSPpredList)
GenefuModel
object with a single SurvivalExperiment
object.Validate a GenefuModel
object with a single SurvivalExperiment
object.
## S4 method for signature 'GeneFuModel,SurvivalExperiment' validateModel(model, valData)
## S4 method for signature 'GeneFuModel,SurvivalExperiment' validateModel(model, valData)
model |
A |
valData |
A |
The GeneModel
with the validation statistics in the
validationStats
slot and the validation data in the validationData
slot.
Evaluate the Performance of a List of Trained KTSP Models from a PCOSP Model
## S4 method for signature 'PCOSP_or_RLS_or_RGA,CohortList' validateModel(model, valData, ...)
## S4 method for signature 'PCOSP_or_RLS_or_RGA,CohortList' validateModel(model, valData, ...)
model |
A |
valData |
A |
... |
Fallthrough arguments to |
The model
object with the validationStats and validationData
slots occupied.
BiocParallel::bplapply
, switchBox::SWAP.KTSP.Classify
data(sampleTrainedPCOSPmodel) data(samplePCOSPpredList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Validate model validatedPCOSPmodel <- validateModel(sampleTrainedPCOSPmodel, valData=samplePCOSPpredList)
data(sampleTrainedPCOSPmodel) data(samplePCOSPpredList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Validate model validatedPCOSPmodel <- validateModel(sampleTrainedPCOSPmodel, valData=samplePCOSPpredList)
Validate a PCOSP model with a single SurvivalExperiment object.
## S4 method for signature 'PCOSP_or_RLS_or_RGA,SurvivalExperiment' validateModel(model, valData)
## S4 method for signature 'PCOSP_or_RLS_or_RGA,SurvivalExperiment' validateModel(model, valData)
model |
A |
valData |
A |
The PCOSPmodel
with the validation statistics in the validationStats
slot and the validation data in the validationData
slot.
data(sampleTrainedPCOSPmodel) data(samplePCOSPpredList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Validate model validatedPCOSPmodel <- validateModel(sampleTrainedPCOSPmodel, valData=samplePCOSPpredList)
data(sampleTrainedPCOSPmodel) data(samplePCOSPpredList) # Set parallelization settings BiocParallel::register(BiocParallel::SerialParam()) # Validate model validatedPCOSPmodel <- validateModel(sampleTrainedPCOSPmodel, valData=samplePCOSPpredList)
validationData
slot of an S4
objectAccessor for the validationData
slot of an S4
object
validationData(object, ...)
validationData(object, ...)
object |
An |
... |
Allow definition of new arguments to this generic. |
A List
- or list
-like object containing one or more
sets of validation data.
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) validationData(metaclustModel)
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) validationData(metaclustModel)
validationData
slot of an S4Model
objectAccessor for the validationData
slot of an S4Model
object
## S4 method for signature 'S4Model' validationData(object)
## S4 method for signature 'S4Model' validationData(object)
object |
An |
A List
- or list
-like object containing one or more
sets of validation data.
validationData
slot of a SurvivalModel
object.Accessor for the validationData
slot of a SurvivalModel
object.
## S4 method for signature 'SurvivalModel' validationData(object)
## S4 method for signature 'SurvivalModel' validationData(object)
object |
A |
A CohortList
object containing the datasets used to compute
validation statistics for this model.
data(samplePCOSPmodel) validationData(samplePCOSPmodel)
data(samplePCOSPmodel) validationData(samplePCOSPmodel)
validationData
slot on an S4
objectGeneric for setting the validationData
slot on an S4
object
validationData(object, ...) <- value
validationData(object, ...) <- value
object |
An |
... |
Allow definition of additional parameters to this generic. |
value |
A |
None, updates the object
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) validationData(metaclustModel) <- list(cohort1='This should be cohort data')
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) validationData(metaclustModel) <- list(cohort1='This should be cohort data')
validationData
slot of a SurvivalModel
object with a
CohortList
.Setter for the validationData
slot of a SurvivalModel
object with a
CohortList
.
## S4 replacement method for signature 'SurvivalModel,CohortList' validationData(object) <- value
## S4 replacement method for signature 'SurvivalModel,CohortList' validationData(object) <- value
object |
A |
value |
A |
None, updates the object.
data(samplePCOSPmodel) validationData(samplePCOSPmodel) <- validationData(samplePCOSPmodel)
data(samplePCOSPmodel) validationData(samplePCOSPmodel) <- validationData(samplePCOSPmodel)
validationStats
slot of an S4
objectAccessor for the validationStats
slot of an S4
object
validationStats(object, ...)
validationStats(object, ...)
object |
An |
... |
Allow definition of new arguments to this generic. |
A data.frame
of validation statistics for the validation data
provided to validateModel
function for a given S4
object.
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) validationStats(metaclustModel)
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) validationStats(metaclustModel)
validationStats
slot of an S4Model
ObjectAcessor for the validationStats
slot of an S4Model
Object
## S4 method for signature 'S4Model' validationStats(object)
## S4 method for signature 'S4Model' validationStats(object)
object |
An |
A data.frame
of validation statistics for the validation data
provided to validateModel
function for a given S4Model
object.
validationStats
slot of a SurvivalModel
object.Accessor for the validationStats
slot of a SurvivalModel
object.
## S4 method for signature 'SurvivalModel' validationStats(object)
## S4 method for signature 'SurvivalModel' validationStats(object)
object |
A |
A data.table
of validation statistics for the SurvivalModel
object.
data(samplePCOSPmodel) validationStats(samplePCOSPmodel)
data(samplePCOSPmodel) validationStats(samplePCOSPmodel)
validationStats
slot on an S4
objectSetter for the validationStats
slot on an S4
object
validationStats(object, ...) <- value
validationStats(object, ...) <- value
object |
An |
... |
Allow definition of additional parameters to this generic. |
value |
A |
None, updates the object
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) validationStats(metaclustModel) <- data.frame()
data(CSPC_MAE) set.seed(1987) metaclustModel <- ConMetaclustModel(CSPC_MAE, randomSeed=1987) validationStats(metaclustModel) <- data.frame()
validationStats
slot on an S4Model
objectSetter for the validationStats
slot on an S4Model
object
## S4 replacement method for signature 'S4Model,DFrame_or_data.frame_data.table_or_NULL' validationStats(object) <- value
## S4 replacement method for signature 'S4Model,DFrame_or_data.frame_data.table_or_NULL' validationStats(object) <- value
object |
An |
value |
A |
None, updates the object
SurvivalModel
object with a
data.frame
Setter for the validationStats slot of a SurvivalModel
object with a
data.frame
## S4 replacement method for signature 'SurvivalModel,data.frame' validationStats(object) <- value
## S4 replacement method for signature 'SurvivalModel,data.frame' validationStats(object) <- value
object |
A |
value |
A |
None, updated the object.
data(samplePCOSPmodel) validationStats(samplePCOSPmodel) <- data.frame()
data(samplePCOSPmodel) validationStats(samplePCOSPmodel) <- data.frame()