| Title: | Transcriptomic Classification using Mixture of Normal Distributions |
|---|---|
| Description: | The splitTypeR package enables the classification of bulk transcriptomic samples using gene signature lists. For each signature, an enrichment score is first calculated for every sample with Bioconductor GSVA, and the uncertainty around each score is estimated through permutations of the samples. Values drawn from the sample-specific normal distributions are then pooled to fit a mixture of two normal distributions that represents the whole cohort. Each sample is finally tested against the distribution with the lower mean, and samples with a significantly higher score are assigned to the signature. Published gene signatures related to pancreatic ductal adenocarcinoma subtyping are also provided. |
| Authors: | Astrid Deschênes [aut, cre] (ORCID: <https://orcid.org/0000-0001-7846-6749>), Pascal Belleau [aut] (ORCID: <https://orcid.org/0000-0002-0802-1071>), David A. Tuveson [aut] (ORCID: <https://orcid.org/0000-0002-8017-2712>), Lustgarten Foundation [fnd] |
| Maintainer: | Astrid Deschênes <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 0.99.9 |
| Built: | 2026-10-25 06:26:57 UTC |
| Source: | https://github.com/BiocStaging/splitTypeR |
The splitTypeR package provides an automated statistical
framework for classifying heterogeneous biological samples based on
gene signature lists, effectively isolating signature-positive
samples. This classification method is designed for bulk
transcriptomic datasets.
The workflow begins by calculating a Gene Set Variation Analysis (GSVA) score for each sample to quantify the relative pathway activity. A subsequent permutation step extracts sample-specific standard deviations to capture the variance. By combining these metrics, the package establishes a unique normal distribution for each sample. Through an up-scaling step, values are randomly drawn from these individual distributions and pooled to construct a comprehensive mixture of normal distributions that represent the entire sample population.
Within this mixture model, the sub-distribution with the lower mean value is designated as the alternative distribution. The framework applies a hypothesis-testing approach in which the null hypothesis posits that a sample belongs to this alternative distribution. Samples that successfully reject the null hypothesis are assigned to the signature classification. Conversely, samples that fail to reject the null hypothesis remain unclassified.
By automating the classification workflow, the splitTypeR package
provides an objective method to identify patient or sample subgroups in
heterogeneous transcriptomic datasets.
Astrid Deschênes, Pascal Belleau
Maintainer: Astrid Deschênes <[email protected]>
runSubtypingBimodal for the classification of heterogeneous biological samples based on gene signature lists using a mixture of two normal distributions
getGeneSignaturesNames for the names of the available and ready-to-use gene signature lists
getGeneSignatures for the available and ready-to-use gene signature lists
A generic function for getting the classification slot in a
class. The function is implemented for the SplitTypeRdata class.
classification(x)classification(x)
x |
an object. |
an object.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(classification="character")) # Create an instance obj <- new("MyClass", classification="123") # Call the generic (assuming a method is implemented) # classification(obj)# Define a dummy class to show usage setClass("MyClass", slots = list(classification="character")) # Create an instance obj <- new("MyClass", classification="123") # Call the generic (assuming a method is implemented) # classification(obj)
A function for getting the classification slot in a
SplitTypeRdata class.
## S4 method for signature 'SplitTypeRdata' classification(x)## S4 method for signature 'SplitTypeRdata' classification(x)
x |
a |
NULL or a list NULL or a list of the classification
for each signature. The list should have one entry per signature.
Astrid Deschênes
## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the model slot for the object classification(splitData)## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the model slot for the object classification(splitData)
A generic function for replacement of the classification slot in a S4 object.
classification(x) <- valueclassification(x) <- value
x |
a S4 object. |
value |
the new value to assign or update. |
the modified S4 object when the new value is valid.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(classification="character")) # Create an instance obj <- new("MyClass", classification="123") # Call the generic (assuming a method is implemented) # classification(obj) <- "333"# Define a dummy class to show usage setClass("MyClass", slots = list(classification="character")) # Create an instance obj <- new("MyClass", classification="123") # Call the generic (assuming a method is implemented) # classification(obj) <- "333"
SplitTypeRdata objectA function for replacement of the classification slot in a
SplitTypeRdata class.
## S4 replacement method for signature 'SplitTypeRdata' classification(x) <- value## S4 replacement method for signature 'SplitTypeRdata' classification(x) <- value
x |
a |
value |
|
the modified SplitTypeRdata object when the new value is
valid.
Astrid Deschênes
## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Create the classification of 3 samples for each signature ## Each entry contains the GSVA score of each sample and its ## classification (the signature name or "unclassified") demoClass <- list() demoClass[["SignatureA"]] <- data.frame(GSVA_score=c(0.45, -0.32, 0.12), classification=c("SignatureA", "unclassified", "unclassified"), row.names=c("Sample_1", "Sample_2", "Sample_3")) demoClass[["SignatureB"]] <- data.frame(GSVA_score=c(-0.51, 0.38, 0.29), classification=c("unclassified", "SignatureB", "SignatureB"), row.names=c("Sample_1", "Sample_2", "Sample_3")) ## Assign the classification to the object classification(demo) <- demoClass ## Get the classification for the first signature classification(demo)[["SignatureA"]]## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Create the classification of 3 samples for each signature ## Each entry contains the GSVA score of each sample and its ## classification (the signature name or "unclassified") demoClass <- list() demoClass[["SignatureA"]] <- data.frame(GSVA_score=c(0.45, -0.32, 0.12), classification=c("SignatureA", "unclassified", "unclassified"), row.names=c("Sample_1", "Sample_2", "Sample_3")) demoClass[["SignatureB"]] <- data.frame(GSVA_score=c(-0.51, 0.38, 0.29), classification=c("unclassified", "SignatureB", "SignatureB"), row.names=c("Sample_1", "Sample_2", "Sample_3")) ## Assign the classification to the object classification(demo) <- demoClass ## Get the classification for the first signature classification(demo)[["SignatureA"]]
A small normalized expected gene counts matrix for 30 patients generated to be used as a demonstration set in this package.
data(expNormalCountsDemo)data(expNormalCountsDemo)
a matrix containing normalized gene counts for 30 patients
(columns). Only genes related to 2018 Tiriac PDAC PDO classical and
basal-like signatures are present (row).
Simulated values generated for demonstration purposes. The genes correspond to the genes of the PDAC patient-derived organoids (PDO) classical and basal-like signatures published in Tiriac et al. (2018).
runSubtypingBimodal for the classification of heterogeneous biological samples based on gene signature lists using a mixture of two normal distributions
getGeneSignaturesNames for the names of the available and ready-to-use gene signature lists
getGeneSignatures for the available and ready-to-use gene signature lists
## Load the demo normalized expected count matrix data("expNormalCountsDemo") ## Load the demo signatures data("signaturesDemo") ## Fix seed for reproducibility set.seed(221) ## Run classification on the 30 patients using 25 permutations on 70% of ## the cohort, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrix=expNormalCountsDemo, permRatio=0.70, permNbr=25, upscaleNbr=10)## Load the demo normalized expected count matrix data("expNormalCountsDemo") ## Load the demo signatures data("signaturesDemo") ## Fix seed for reproducibility set.seed(221) ## Run classification on the 30 patients using 25 permutations on 70% of ## the cohort, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrix=expNormalCountsDemo, permRatio=0.70, permNbr=25, upscaleNbr=10)
The function returns the selected gene list signatures.
getGeneSignatures(nameList = NULL)getGeneSignatures(nameList = NULL)
nameList |
a |
The PDAC PDO classical and basal-like signatures are associated with this publication:
Tiriac et al. Organoid Profiling Identifies Common Responders to Chemotherapy in Pancreatic Cancer. Cancer Discov. 2018 Sep;8(9):1112-1129. doi: 10.1158/2159-8290.CD-18-0349. Epub 2018 May 31. PMID: 29853643; PMCID: PMC6125219.
a list of selected signatures. Each signature is composed of
a vector of gene names.
Astrid Deschênes
## Extract the basal-like signature from Tiriac et al 2018 getGeneSignatures(nameList=c("Tiriac_PDAC_PDO_Basal_like"))## Extract the basal-like signature from Tiriac et al 2018 getGeneSignatures(nameList=c("Tiriac_PDAC_PDO_Basal_like"))
The function lists the names of all the available signatures.
getGeneSignaturesNames()getGeneSignaturesNames()
The PDAC PDO classical and basal-like signatures are associated with this publication:
Tiriac et al. Organoid Profiling Identifies Common Responders to Chemotherapy in Pancreatic Cancer. Cancer Discov. 2018 Sep;8(9):1112-1129. doi: 10.1158/2159-8290.CD-18-0349. Epub 2018 May 31. PMID: 29853643; PMCID: PMC6125219.
a vector of available signature names
Astrid Deschênes
## Print the names of the available signatures getGeneSignaturesNames()## Print the names of the available signatures getGeneSignaturesNames()
The function returns the genes for the selected signature.
getGenesInSignature(name)getGenesInSignature(name)
name |
a |
The PDAC PDO classical and basal-like signatures are associated with this publication:
Tiriac et al. Organoid Profiling Identifies Common Responders to Chemotherapy in Pancreatic Cancer. Cancer Discov. 2018 Sep;8(9):1112-1129. doi: 10.1158/2159-8290.CD-18-0349. Epub 2018 May 31. PMID: 29853643; PMCID: PMC6125219.
a list of genes associated to a specific signature.
Astrid Deschênes
## Extract the genes for the basal-like signature from Tiriac et al 2018 getGenesInSignature(name="Tiriac_PDAC_PDO_Basal_like")## Extract the genes for the basal-like signature from Tiriac et al 2018 getGenesInSignature(name="Tiriac_PDAC_PDO_Basal_like")
A generic function for getting the gsvaResults slot in a
class. The function is implemented for the SplitTypeRdata class.
gsvaResults(x)gsvaResults(x)
x |
an object. |
an object.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(gsvaResults="character")) # Create an instance obj <- new("MyClass", gsvaResults="123") # Call the generic (assuming a method is implemented) # gsvaResults(obj)# Define a dummy class to show usage setClass("MyClass", slots = list(gsvaResults="character")) # Create an instance obj <- new("MyClass", gsvaResults="123") # Call the generic (assuming a method is implemented) # gsvaResults(obj)
A function for getting the gsvaResults slot in a
SplitTypeRdata class.
## S4 method for signature 'SplitTypeRdata' gsvaResults(x)## S4 method for signature 'SplitTypeRdata' gsvaResults(x)
x |
a |
NULL or a matrix of the GSVA results for each
signature. The matrix should have one entry per signature.
Astrid Deschênes
## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the gsvaResults slot for the object gsvaResults(splitData)## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the gsvaResults slot for the object gsvaResults(splitData)
A generic function for replacement of gsvaResults slot in a S4 object.
gsvaResults(x) <- valuegsvaResults(x) <- value
x |
a S4 object. |
value |
the new value to assign or update. |
the modified S4 object when the new value is valid.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(gsvaResults="character")) # Create an instance obj <- new("MyClass", gsvaResults="123") # Call the generic (assuming a method is implemented) # gsvaResults(obj) <- "333"# Define a dummy class to show usage setClass("MyClass", slots = list(gsvaResults="character")) # Create an instance obj <- new("MyClass", gsvaResults="123") # Call the generic (assuming a method is implemented) # gsvaResults(obj) <- "333"
SplitTypeRdata objectA function for replacement of the gsvaResults slot in a
SplitTypeRdata class.
## S4 replacement method for signature 'SplitTypeRdata' gsvaResults(x) <- value## S4 replacement method for signature 'SplitTypeRdata' gsvaResults(x) <- value
x |
a |
value |
|
the modified SplitTypeRdata object when the new value is
valid.
Astrid Deschênes
## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Demo study data frame signaDemo <- matrix(data=c(0.23772165, -0.71262458, 0.42328775, -0.65149268, 0.18324268, 0.007158662), nrow=2, ncol=3, byrow=FALSE) colnames(signaDemo) <- paste0("Patient_", 1:3) rownames(signaDemo) <- c("SignatureA", "SignatureB") gsvaResults(demo) <- signaDemo## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Demo study data frame signaDemo <- matrix(data=c(0.23772165, -0.71262458, 0.42328775, -0.65149268, 0.18324268, 0.007158662), nrow=2, ncol=3, byrow=FALSE) colnames(signaDemo) <- paste0("Patient_", 1:3) rownames(signaDemo) <- c("SignatureA", "SignatureB") gsvaResults(demo) <- signaDemo
A virtual class that groups list and NULL
together.
Astrid Deschênes
A virtual class that groups matrix and NULL
together.
Astrid Deschênes
A generic function for getting the model slot in a
class. The function is implemented for the SplitTypeRdata class.
model(x)model(x)
x |
an object. |
an object.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(model="character")) # Create an instance obj <- new("MyClass", model="123") # Call the generic (assuming a method is implemented) # model(obj)# Define a dummy class to show usage setClass("MyClass", slots = list(model="character")) # Create an instance obj <- new("MyClass", model="123") # Call the generic (assuming a method is implemented) # model(obj)
A function for getting the model slot in a
SplitTypeRdata class.
## S4 method for signature 'SplitTypeRdata' model(x)## S4 method for signature 'SplitTypeRdata' model(x)
x |
a |
NULL or a list of the mixture models calculated
for each signature. The list should have one entry per signature.
Astrid Deschênes
## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the model slot for the object model(splitData)## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the model slot for the object model(splitData)
A generic function for replacement of model slot in a S4 object.
model(x) <- valuemodel(x) <- value
x |
a S4 object. |
value |
the new value to assign or update. |
the modified S4 object when the new value is valid.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(model="character")) # Create an instance obj <- new("MyClass", model="123") # Call the generic (assuming a method is implemented) # model(obj) <- "333"# Define a dummy class to show usage setClass("MyClass", slots = list(model="character")) # Create an instance obj <- new("MyClass", model="123") # Call the generic (assuming a method is implemented) # model(obj) <- "333"
SplitTypeRdata objectA function for replacement of the model slot in a
SplitTypeRdata class.
## S4 replacement method for signature 'SplitTypeRdata' model(x) <- value## S4 replacement method for signature 'SplitTypeRdata' model(x) <- value
x |
a |
value |
|
the modified SplitTypeRdata object when the new value is
valid.
Astrid Deschênes
## Load required library library(mixtools) ## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Create demo model set.seed(121) modelExp <- normalmixEM(c(sample(1:25, size=12, replace=TRUE), sample(23:45, size=12, replace=TRUE)), k=2, verb=FALSE) ## Create demo models demoModels <- list() demoModels[[names(sign)[1]]] <- modelExp demoModels[[names(sign)[2]]] <- modelExp model(demo) <- demoModels## Load required library library(mixtools) ## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Create demo model set.seed(121) modelExp <- normalmixEM(c(sample(1:25, size=12, replace=TRUE), sample(23:45, size=12, replace=TRUE)), k=2, verb=FALSE) ## Create demo models demoModels <- list() demoModels[[names(sign)[1]]] <- modelExp demoModels[[names(sign)[2]]] <- modelExp model(demo) <- demoModels
A generic function for getting the permutations slot in a
class. The function is implemented for the SplitTypeRdata class.
permutations(x)permutations(x)
x |
an object. |
an object.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(permutations="character")) # Create an instance obj <- new("MyClass", permutations="123") # Call the generic (assuming a method is implemented) # permutations(obj)# Define a dummy class to show usage setClass("MyClass", slots = list(permutations="character")) # Create an instance obj <- new("MyClass", permutations="123") # Call the generic (assuming a method is implemented) # permutations(obj)
A function for getting the permutations slot in a
SplitTypeRdata class.
## S4 method for signature 'SplitTypeRdata' permutations(x)## S4 method for signature 'SplitTypeRdata' permutations(x)
x |
a |
a list.
Astrid Deschênes
## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the permutations slot for the object permutations(splitData)## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the permutations slot for the object permutations(splitData)
A generic function for replacement of permutations slot in a S4 object.
permutations(x) <- valuepermutations(x) <- value
x |
a S4 object. |
value |
the new value to assign or update. |
the modified S4 object when the new value is valid.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(permutations="character")) # Create an instance obj <- new("MyClass", permutations="123") # Call the generic (assuming a method is implemented) # permutations(obj) <- "333"# Define a dummy class to show usage setClass("MyClass", slots = list(permutations="character")) # Create an instance obj <- new("MyClass", permutations="123") # Call the generic (assuming a method is implemented) # permutations(obj) <- "333"
SplitTypeRdata objectA function for replacement of the permutations slot in a
SplitTypeRdata class.
## S4 replacement method for signature 'SplitTypeRdata' permutations(x) <- value## S4 replacement method for signature 'SplitTypeRdata' permutations(x) <- value
x |
a |
value |
|
the modified SplitTypeRdata object when the new value is
valid.
Astrid Deschênes
## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Demo study data frame demoPerm1 <- matrix(data=c(0.23772165, -0.71262458, 0.42328775, -0.65149268, 0.18324268, 0.007158662), nrow=2, ncol=3, byrow=FALSE) rownames(demoPerm1) <- paste0("Patient_", 1:2) demoPerm2 <- matrix(data=c(0.29772165, 0.21262458, 0.42218775, 0.65133268, 0.18324268, -0.017158662), nrow=2, ncol=4, byrow=FALSE) rownames(demoPerm2) <- paste0("Patient_", 1:2) demoPerm <- list() demoPerm[[names(sign)[1]]] <- demoPerm1 demoPerm[[names(sign)[2]]] <- demoPerm2 permutations(demo) <- demoPerm## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Demo study data frame demoPerm1 <- matrix(data=c(0.23772165, -0.71262458, 0.42328775, -0.65149268, 0.18324268, 0.007158662), nrow=2, ncol=3, byrow=FALSE) rownames(demoPerm1) <- paste0("Patient_", 1:2) demoPerm2 <- matrix(data=c(0.29772165, 0.21262458, 0.42218775, 0.65133268, 0.18324268, -0.017158662), nrow=2, ncol=4, byrow=FALSE) rownames(demoPerm2) <- paste0("Patient_", 1:2) demoPerm <- list() demoPerm[[names(sign)[1]]] <- demoPerm1 demoPerm[[names(sign)[2]]] <- demoPerm2 permutations(demo) <- demoPerm
The function generates a graph showing the signature and alternative distributions obtained from the upscaling step followed by the extraction of the mixture of two normal distributions for each selected signature. The graph also contains the histogram of the enriched scores for the upscaled dataset (not the original dataset).
plotDensityWithUpscalingSamplesBimodal( x, signature, breaks = 22L, colorSignature = "black", colorAlternative = "#A9A9AD", colorBorderSamples = "azure4", colorFillingSamples = "azure3" )plotDensityWithUpscalingSamplesBimodal( x, signature, breaks = 22L, colorSignature = "black", colorAlternative = "#A9A9AD", colorBorderSamples = "azure4", colorFillingSamples = "azure3" )
x |
a "SplitTypeRdata" object, the output object
from |
signature |
a |
breaks |
a single |
colorSignature |
a |
colorAlternative |
a |
colorBorderSamples |
a |
colorFillingSamples |
a |
NULL, invisibly. The function is called for its side
effect: a histogram of the values generated during the upscaling step,
with the two normal distributions of the mixture model, is drawn on the
current graphics device.
Astrid Deschênes
## Loading signatures data("signaturesDemo") ## Load demo normalized expected counts for 30 patients data("expNormalCountsDemo") ## Fix seed for reproducibility set.seed(1221) ## Run classification on the 30 patients using 20 permutations on 75% of ## the dataset, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrix=expNormalCountsDemo, permRatio=0.75, permNbr=20, upscaleNbr=5) ## Graph result plotDensityWithUpscalingSamplesBimodal(x=results, signature="Classical")## Loading signatures data("signaturesDemo") ## Load demo normalized expected counts for 30 patients data("expNormalCountsDemo") ## Fix seed for reproducibility set.seed(1221) ## Run classification on the 30 patients using 20 permutations on 75% of ## the dataset, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrix=expNormalCountsDemo, permRatio=0.75, permNbr=20, upscaleNbr=5) ## Graph result plotDensityWithUpscalingSamplesBimodal(x=results, signature="Classical")
The function generates a graph of all the enrichment results obtained during the permutation step for the selected signature and the specified samples. The graph also includes a compact display of the continuous distribution of the values for each sample.
plotPermutationSamplesDistribution( x, signature, samples, violinColor = "black", pointColor = "black", positionJitter = 0.2, alpha = 0.25, size = 0.95, seed = NA )plotPermutationSamplesDistribution( x, signature, samples, violinColor = "black", pointColor = "black", positionJitter = 0.2, alpha = 0.25, size = 0.95, seed = NA )
x |
a |
signature |
a |
samples |
a |
violinColor |
a |
pointColor |
a |
positionJitter |
a |
alpha |
a |
size |
a |
seed |
a |
a ggplot object that contains all the enrichment scores
obtained through the permutation step with the kernel desntiy distributions
for the selected samples and the selected signature.
Astrid Deschênes
## Loading signatures data("signaturesDemo") ## Load demo normalized expected counts for 30 patients data("expNormalCountsDemo") ## Fix seed for reproducibility set.seed(1221) ## Run classification on the 30 patients using 20 permutations on 75% of ## the dataset, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrix=expNormalCountsDemo, permRatio=0.75, permNbr=30, upscaleNbr=5) ## Graph the enrichment results from the permutation for 3 samples plotPermutationSamplesDistribution(x=results, signature="Basal-like", samples=c("Patient_9", "Patient_25", "Patient_29"), violinColor="darkred", pointColor="darkviolet", positionJitter=0.20, size=1.2, seed=121)## Loading signatures data("signaturesDemo") ## Load demo normalized expected counts for 30 patients data("expNormalCountsDemo") ## Fix seed for reproducibility set.seed(1221) ## Run classification on the 30 patients using 20 permutations on 75% of ## the dataset, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrix=expNormalCountsDemo, permRatio=0.75, permNbr=30, upscaleNbr=5) ## Graph the enrichment results from the permutation for 3 samples plotPermutationSamplesDistribution(x=results, signature="Basal-like", samples=c("Patient_9", "Patient_25", "Patient_29"), violinColor="darkred", pointColor="darkviolet", positionJitter=0.20, size=1.2, seed=121)
This function generates a graph showing the enrichment results, as violin plots, as obtained from the permutation step, for the selected samples.
plotPermutationSamplesNormal(x, signature, samples, pointColor = "darkred")plotPermutationSamplesNormal(x, signature, samples, pointColor = "darkred")
x |
a |
signature |
a |
samples |
a |
pointColor |
a |
a ggplot object that contains the density distribution of the
enrichment score (shown as dashed lines) from the normal distribution
calculated for each selected sample. The mean of the distribution is
the enrichment score for the selected sample (shown as a vertical dotted
line in the graph) while the standard deviation is obtained from the
permutation step. The enrichment scores values sampled at the upscaling
step are shown as dots in the graph.
Astrid Deschênes
## Loading signatures data("signaturesDemo") ## Load demo normalized expected counts for 30 patients data("expNormalCountsDemo") ## Fix seed for reproducibility set.seed(1221) ## Run classification on the 30 patients using 20 permutations on 75% of ## the dataset, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrix=log2(expNormalCountsDemo + 1), permRatio=0.75, permNbr=30, upscaleNbr=5) ## Graph the enrichment results from the permutation for 3 samples plotPermutationSamplesNormal(x=results, signature="Basal-like", samples=c("Patient_9", "Patient_25", "Patient_29"))## Loading signatures data("signaturesDemo") ## Load demo normalized expected counts for 30 patients data("expNormalCountsDemo") ## Fix seed for reproducibility set.seed(1221) ## Run classification on the 30 patients using 20 permutations on 75% of ## the dataset, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrix=log2(expNormalCountsDemo + 1), permRatio=0.75, permNbr=30, upscaleNbr=5) ## Graph the enrichment results from the permutation for 3 samples plotPermutationSamplesNormal(x=results, signature="Basal-like", samples=c("Patient_9", "Patient_25", "Patient_29"))
This function classifies heterogeneous biological samples based on gene signature lists, effectively isolating signature-positive samples through an automated statistical framework.
The workflow begins by calculating a Gene Set Variation Analysis (GSVA) score for each sample to quantify the relative pathway activity. A subsequent permutation step extracts sample-specific standard deviations to capture the variance. By combining these metrics, a unique normal distribution is established for each sample. Through an up-scaling step, values are randomly drawn from these individual distributions and pooled to construct a comprehensive mixture of normal distributions that represent the entire sample population. A hypothesis-testing approach in which the null hypothesis posits that a sample belongs to this alternative distribution with the lower mean is applied. Samples that successfully reject the null hypothesis are assigned to the signature classification.
runSubtypingBimodal( geneLists, expectedCountsMatrixLog, permRatio = 0.75, permNbr = 20, upscaleNbr = 10 )runSubtypingBimodal( geneLists, expectedCountsMatrixLog, permRatio = 0.75, permNbr = 20, upscaleNbr = 10 )
geneLists |
a |
expectedCountsMatrixLog |
a log2-normalized gene expression data
|
permRatio |
a |
permNbr |
a |
upscaleNbr |
a |
a list of class splitTypeResults containing the
signature-specific classification for each sample as well as all the
results generated at each step of the statistical workflow.
Astrid Deschênes
## Loading signatures data("signaturesDemo") ## Load demo normalized expected counts for 30 patients data("expNormalCountsDemo") ## Fix seed for reproducibility set.seed(121) ## Run classification on the 30 patients using 20 permutations on 75% of ## the dataset, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrixLog=expNormalCountsDemo, permRatio=0.75, permNbr=20, upscaleNbr=10)## Loading signatures data("signaturesDemo") ## Load demo normalized expected counts for 30 patients data("expNormalCountsDemo") ## Fix seed for reproducibility set.seed(121) ## Run classification on the 30 patients using 20 permutations on 75% of ## the dataset, and 10 points per patient for the up-scaling step results <- runSubtypingBimodal(geneLists=signaturesDemo, expectedCountsMatrixLog=expNormalCountsDemo, permRatio=0.75, permNbr=20, upscaleNbr=10)
A function that displays a summary of a
SplitTypeRdata object: the signatures with their number of genes,
the number of samples, the steps of the method that have been run and,
for each signature, the number of samples assigned to the signature. The
function is called when the object is printed at the console.
## S4 method for signature 'SplitTypeRdata' show(object)## S4 method for signature 'SplitTypeRdata' show(object)
object |
a |
NULL, invisibly. The function is called for its side
effect: the summary of the object is displayed at the console.
Astrid Deschênes
## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- SplitTypeRdata(signatures=sign) ## Show the summary of the object demo## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- SplitTypeRdata(signatures=sign) ## Show the summary of the object demo
A generic function for getting the signatures slot in a
class. The function is implemented for the SplitTypeRdata class.
signatures(x)signatures(x)
x |
an object. |
an object.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(signatures="character")) # Create an instance obj <- new("MyClass", signatures="123") # Call the generic (assuming a method is implemented) # signatures(obj)# Define a dummy class to show usage setClass("MyClass", slots = list(signatures="character")) # Create an instance obj <- new("MyClass", signatures="123") # Call the generic (assuming a method is implemented) # signatures(obj)
A function for getting the signatures slot in a
SplitTypeRdata class.
## S4 method for signature 'SplitTypeRdata' signatures(x)## S4 method for signature 'SplitTypeRdata' signatures(x)
x |
a |
a list.
Astrid Deschênes
## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the signature slot for the object signatures(splitData)## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the signature slot for the object signatures(splitData)
A generic function for replacement of signatures slot in a S4 object.
signatures(x) <- valuesignatures(x) <- value
x |
a S4 object. |
value |
the new value to assign or update. |
the modified S4 object when the new value is valid.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(signatures="character")) # Create an instance obj <- new("MyClass", signatures="123") # Call the generic (assuming a method is implemented) # signatures(obj) <- "333"# Define a dummy class to show usage setClass("MyClass", slots = list(signatures="character")) # Create an instance obj <- new("MyClass", signatures="123") # Call the generic (assuming a method is implemented) # signatures(obj) <- "333"
SplitTypeRdata objectA function for replacement of the signatures slot in a
SplitTypeRdata class.
## S4 replacement method for signature 'SplitTypeRdata' signatures(x) <- value## S4 replacement method for signature 'SplitTypeRdata' signatures(x) <- value
x |
a |
value |
|
the modified SplitTypeRdata object when the new value is
valid.
Astrid Deschênes
## Create a SplitTypeRdata object paramDemo <- new("SplitTypeRdata") ## Demo study data frame signaDemo <- list("SignatureA"=c("KRAS", "AKT1", "MTOR"), "SignatureB"=c("PIK3CB", "CTTN")) ## Assign the new list to the signatures slot in the object signatures(paramDemo) <- signaDemo## Create a SplitTypeRdata object paramDemo <- new("SplitTypeRdata") ## Demo study data frame signaDemo <- list("SignatureA"=c("KRAS", "AKT1", "MTOR"), "SignatureB"=c("PIK3CB", "CTTN")) ## Assign the new list to the signatures slot in the object signatures(paramDemo) <- signaDemo
A short collection of published gene signatures that primarily focuses on PDAC classification for patient-derived organoids (PDO). While the signatures are accurate, this list is mainly compiled for demonstration purposes.
data(signaturesDemo)data(signaturesDemo)
a list containing one entry per signature:
"Classical": a
vector of gene names associated to the PDAC Patient-derived
Organoid (PDO) Classical signature as published in Tiriac et al 2018
"Basal-like": a
vector of gene names associated to the PDAC Patient-derived
Organoid (PDO) Basal-like signature as published in Tiriac et al 2018
The PDAC patient-derived organoids (PDO) classical and basal-like signatures are associated with this publication:
Tiriac et al. Organoid Profiling Identifies Common Responders to Chemotherapy in Pancreatic Cancer. Cancer Discov. 2018 Sep;8(9):1112-1129. doi: 10.1158/2159-8290.CD-18-0349. Epub 2018 May 31. PMID: 29853643; PMCID: PMC6125219.
Tiriac H, Belleau P, Engle DD, et al. Organoid Profiling Identifies Common Responders to Chemotherapy in Pancreatic Cancer. Cancer Discov. 2018;8(9):1112-1129. doi:10.1158/2159-8290.CD-18-0349
runSubtypingBimodal for the classification of heterogeneous biological samples based on gene signature lists using a mixture of two normal distributions
getGeneSignaturesNames for the names of the available and ready-to-use gene signature lists
getGeneSignatures for the available and ready-to-use gene signature lists
## Load the published signature gene list data(signaturesDemo)## Load the published signature gene list data(signaturesDemo)
This function creates a SplitTypeRdata object using the values present in the parameters.
SplitTypeRdata( signatures = NULL, gsvaResults = NULL, permutations = NULL, standardDeviation = NULL, upscaling = NULL, model = NULL, threshold = NULL, classification = NULL )SplitTypeRdata( signatures = NULL, gsvaResults = NULL, permutations = NULL, standardDeviation = NULL, upscaling = NULL, model = NULL, threshold = NULL, classification = NULL )
signatures |
|
gsvaResults |
|
permutations |
|
standardDeviation |
|
upscaling |
|
model |
|
threshold |
|
classification |
|
an object of class SplitTypeRdata that contains all the
required parameters needed by the RAIDS workflow.
Astrid Deschênes
## New object of class "SplitTypeRdata" with default parameters newSplitData1 <- SplitTypeRdata() ## New object of class "SplitTypeRdata" with non-default parameters newSplitData2 <- SplitTypeRdata(signatures=list("Signature1"=c("ABL1", "BLM", "BRCA1"), "Signature2"=c("COP1", "RAD50", "FANCD2", "TERF2")), gsvaResults=NULL, permutations=NULL, standardDeviation=NULL, upscaling=NULL, model=NULL, threshold=NULL, classification=NULL)## New object of class "SplitTypeRdata" with default parameters newSplitData1 <- SplitTypeRdata() ## New object of class "SplitTypeRdata" with non-default parameters newSplitData2 <- SplitTypeRdata(signatures=list("Signature1"=c("ABL1", "BLM", "BRCA1"), "Signature2"=c("COP1", "RAD50", "FANCD2", "TERF2")), gsvaResults=NULL, permutations=NULL, standardDeviation=NULL, upscaling=NULL, model=NULL, threshold=NULL, classification=NULL)
An S4 class to represent the splitTypeR data
signaturesNULL or a list of the genes
for each signature. The list should have one entry per signature.
Default: NULL.
gsvaResultsNULL or a numeric matrix with
the sample GSVA results for each signature. The matrix should be
have one row per signature.
Default: NULL.
permutationsNULL or a list of the permutations results
for each signature. The list should have one entry per signature.
Default: NULL.
standardDeviationNULL or a list of the sample standard
deviation for each signature. The list should have one entry
per signature.
Default: NULL.
upscalingNULL or a list of the upscaling data
for each signature. The list should have one entry per signature.
Default: NULL.
modelNULL or a list of the mixture models calculated
for each signature. The list should have one entry per signature.
Default: NULL.
thresholdNULL or a list of the classification
thresholds for each signature. The threshold corresponds to the 95th
percentile of the "low-mean" distribution of the mixture model. The
list should have one entry per signature.
Default: NULL.
classificationNULL or a list of the classification for
each signature. The list should have one entry per signature.
Default: NULL.
Astrid Deschênes
A generic function for getting the standardDeviation slot in a
class. The function is implemented for the SplitTypeRdata class.
standardDeviation(x)standardDeviation(x)
x |
an object. |
an object.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(standardDeviation="character")) # Create an instance obj <- new("MyClass", standardDeviation="123")# Define a dummy class to show usage setClass("MyClass", slots = list(standardDeviation="character")) # Create an instance obj <- new("MyClass", standardDeviation="123")
A function for getting the standardDeviation slot in a
SplitTypeRdata class.
## S4 method for signature 'SplitTypeRdata' standardDeviation(x)## S4 method for signature 'SplitTypeRdata' standardDeviation(x)
x |
a |
NULL or a list of the sample standard deviation
for each signature. The list should have one entry per signature.
Astrid Deschênes
## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the sd slot for the object standardDeviation(splitData)## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the sd slot for the object standardDeviation(splitData)
A generic function for replacement of standardDeviation slot in a S4 object.
standardDeviation(x) <- valuestandardDeviation(x) <- value
x |
a S4 object. |
value |
the new value to assign or update. |
the modified S4 object when the new value is valid.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(standardDeviation="character")) # Create an instance obj <- new("MyClass", standardDeviation="123") # Call the generic (assuming a method is implemented) # standardDeviation(obj) <- "333"# Define a dummy class to show usage setClass("MyClass", slots = list(standardDeviation="character")) # Create an instance obj <- new("MyClass", standardDeviation="123") # Call the generic (assuming a method is implemented) # standardDeviation(obj) <- "333"
SplitTypeRdata objectA function for replacement of the standardDeviation slot in a
SplitTypeRdata class.
## S4 replacement method for signature 'SplitTypeRdata' standardDeviation(x) <- value## S4 replacement method for signature 'SplitTypeRdata' standardDeviation(x) <- value
x |
a |
value |
|
the modified SplitTypeRdata object when the new value is
valid.
Astrid Deschênes
## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Create standard deviations demoSD <- list() demoSD[[names(sign)[1]]] <- c(0.01748988, 0.08992500, 0.11781061, 0.0747440) demoSD[[names(sign)[2]]] <- c(0.02058364, 0.08476766, 0.14783058, 0.1009961) standardDeviation(demo) <- demoSD## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Create standard deviations demoSD <- list() demoSD[[names(sign)[1]]] <- c(0.01748988, 0.08992500, 0.11781061, 0.0747440) demoSD[[names(sign)[2]]] <- c(0.02058364, 0.08476766, 0.14783058, 0.1009961) standardDeviation(demo) <- demoSD
A generic function for getting the threshold slot in a
class. The function is implemented for the SplitTypeRdata class.
threshold(x)threshold(x)
x |
an object. |
an object.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(threshold="character")) # Create an instance obj <- new("MyClass", threshold="123") # Call the generic (assuming a method is implemented) # threshold(obj)# Define a dummy class to show usage setClass("MyClass", slots = list(threshold="character")) # Create an instance obj <- new("MyClass", threshold="123") # Call the generic (assuming a method is implemented) # threshold(obj)
A function for getting the threshold slot in a
SplitTypeRdata class.
## S4 method for signature 'SplitTypeRdata' threshold(x)## S4 method for signature 'SplitTypeRdata' threshold(x)
x |
a |
NULL or a list of the classification thresholds
for each signature. The threshold corresponds to the 95th percentile of
the "low-mean" distribution of the mixture model. The list should
be have one entry per signature.
Astrid Deschênes
## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the threshold slot for the object threshold(splitData)## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the threshold slot for the object threshold(splitData)
A generic function for replacement of threshold slot in a S4 object.
threshold(x) <- valuethreshold(x) <- value
x |
a S4 object. |
value |
the new value to assign or update. |
the modified S4 object when the new value is valid.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(threshold="character")) # Create an instance obj <- new("MyClass", threshold="123") # Call the generic (assuming a method is implemented) # threshold(obj) <- "333"# Define a dummy class to show usage setClass("MyClass", slots = list(threshold="character")) # Create an instance obj <- new("MyClass", threshold="123") # Call the generic (assuming a method is implemented) # threshold(obj) <- "333"
SplitTypeRdata objectA function for replacement of the threshold slot in a
SplitTypeRdata class.
## S4 replacement method for signature 'SplitTypeRdata' threshold(x) <- value## S4 replacement method for signature 'SplitTypeRdata' threshold(x) <- value
x |
a |
value |
|
the modified SplitTypeRdata object when the new value is
valid.
Astrid Deschênes
## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Assign a classification threshold to each signature threshold(demo) <- list("SignatureA"=0.12, "SignatureB"=-0.05)## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Assign a classification threshold to each signature threshold(demo) <- list("SignatureA"=0.12, "SignatureB"=-0.05)
A generic function for getting the upscaling slot in a
class. The function is implemented for the SplitTypeRdata class.
upscaling(x)upscaling(x)
x |
an object. |
an object.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(upscaling="character")) # Create an instance obj <- new("MyClass", upscaling="123") # Call the generic (assuming a method is implemented) # upscaling(obj)# Define a dummy class to show usage setClass("MyClass", slots = list(upscaling="character")) # Create an instance obj <- new("MyClass", upscaling="123") # Call the generic (assuming a method is implemented) # upscaling(obj)
A function for getting the upscaling slot in a
SplitTypeRdata class.
## S4 method for signature 'SplitTypeRdata' upscaling(x)## S4 method for signature 'SplitTypeRdata' upscaling(x)
x |
a |
NULL or a list of the upscaling data for each
signature. The list should have one entry per signature.
Astrid Deschênes
## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the upscaling slot for the object upscaling(splitData)## Create a SplitTypeRdata object splitData <- SplitTypeRdata() ## Extract the upscaling slot for the object upscaling(splitData)
A generic function for replacement of the upscaling slot in a S4 object.
upscaling(x) <- valueupscaling(x) <- value
x |
a S4 object. |
value |
the new value to assign or update. |
the modified S4 object when the new value is valid.
Astrid Deschênes
# Define a dummy class to show usage setClass("MyClass", slots = list(upscaling="character")) # Create an instance obj <- new("MyClass", upscaling="123") # Call the generic (assuming a method is implemented) # upscaling(obj) <- "333"# Define a dummy class to show usage setClass("MyClass", slots = list(upscaling="character")) # Create an instance obj <- new("MyClass", upscaling="123") # Call the generic (assuming a method is implemented) # upscaling(obj) <- "333"
SplitTypeRdata objectA function for replacement of the upscaling slot in a
SplitTypeRdata class.
## S4 replacement method for signature 'SplitTypeRdata' upscaling(x) <- value## S4 replacement method for signature 'SplitTypeRdata' upscaling(x) <- value
x |
a |
value |
|
the modified SplitTypeRdata object when the new value is
valid.
Astrid Deschênes
## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Create demo upscaling data demoUp <- list() demoUp[[names(sign)[1]]] <- matrix(data=c(0.0174988, 0.0892500, 0.1178101, 0.0744401, 0.0654692, 0.2546492), nrow=2, ncol=3, byrow=FALSE) demoUp[[names(sign)[2]]] <- matrix(data=c(0.3749488, 0.4894500, 0.2118101, 0.4444401, 0.4154692, 0.8543392), nrow=2, ncol=3, byrow=FALSE) upscaling(demo) <- demoUp## Two demo signatures sign <- list("SignatureA"=c("EGFR", "CTTN", "ACTB"), "SignatureB"=c("ACTR2", "AKT1")) ## Create a SplitTypeRdata object with the signatures demo <- new("SplitTypeRdata", signatures=sign) ## Create demo upscaling data demoUp <- list() demoUp[[names(sign)[1]]] <- matrix(data=c(0.0174988, 0.0892500, 0.1178101, 0.0744401, 0.0654692, 0.2546492), nrow=2, ncol=3, byrow=FALSE) demoUp[[names(sign)[2]]] <- matrix(data=c(0.3749488, 0.4894500, 0.2118101, 0.4444401, 0.4154692, 0.8543392), nrow=2, ncol=3, byrow=FALSE) upscaling(demo) <- demoUp