Title: | Framework for cell size scale factor normalized bulk transcriptomics deconvolution experiments |
---|---|
Description: | Provides a framework for adjustment on cell type size when performing bulk transcripomics deconvolution. The main framework function provides a means of reference normalization using cell size scale factors. It allows for marker selection and deconvolution using non-negative least squares (NNLS) by default. The framework is extensible for other marker selection and deconvolution algorithms, and users may reuse the generics, methods, and classes for these when developing new algorithms. |
Authors: | Sean K Maden [cre, aut] , Stephanie Hicks [aut] |
Maintainer: | Sean K Maden <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.3.0 |
Built: | 2024-11-24 06:28:39 UTC |
Source: | https://github.com/bioc/lute |
Inspect slot in deconvolutionParam object
## S4 method for signature 'deconvolutionParam,ANY,ANY' x[[i]]
## S4 method for signature 'deconvolutionParam,ANY,ANY' x[[i]]
x |
Object to access. |
i |
Slot to access. |
Inspect slot in deconvolutionParam object
Contents of specified slot.
Object slot contents.
param <- new("deconvolutionParam") deconvolution(param)
param <- new("deconvolutionParam") deconvolution(param)
Inspect slot in typemarkersParam object
## S4 method for signature 'typemarkersParam,ANY,ANY' x[[i]]
## S4 method for signature 'typemarkersParam,ANY,ANY' x[[i]]
x |
Object to access. |
i |
Slot to access. |
Inspect slot in typemarkersParam object
Contents of specified slot.
example.data <- getDeconvolutionExampleData()
example.data <- getDeconvolutionExampleData()
Main constructor for class bisqueParam.
bisqueParam( bulkExpression = NULL, bulkExpressionSet = NULL, bulkExpressionIndependent = NULL, referenceExpression = NULL, cellScaleFactors = NULL, scData = NULL, assayName = "counts", batchVariable = "batch.id", cellTypeVariable = "celltype", useOverlap = FALSE, returnInfo = FALSE )
bisqueParam( bulkExpression = NULL, bulkExpressionSet = NULL, bulkExpressionIndependent = NULL, referenceExpression = NULL, cellScaleFactors = NULL, scData = NULL, assayName = "counts", batchVariable = "batch.id", cellTypeVariable = "celltype", useOverlap = FALSE, returnInfo = FALSE )
bulkExpression |
Bulk expression matrix. |
bulkExpressionSet |
ExpressionSet of bulk mixed signals. |
bulkExpressionIndependent |
Bulk expression matrix of independent samples. |
referenceExpression |
Signature matrix of cell type-specific signals. If not provided, can be computed from a provided ExpressionSet containing single-cell data. |
cellScaleFactors |
size factor transformations of length equal to the K cell types to deconvolve. |
scData |
SummarizedExperiment-type object of single-cell transcriptomics data. Accepts ExpressionSet, SummarizedExperiment, and SingleCellExperiment object types. |
assayName |
Expression data type (e.g. counts, logcounts, tpm, etc.). |
batchVariable |
Name of variable identifying the batches in scData pData/coldata. |
cellTypeVariable |
Name of cell type labels variable in scData pData/coldata. |
useOverlap |
Whether to deconvolve samples overlapping bulk and sc esets (logical, FALSE). |
returnInfo |
Whether to return metadata and original method outputs with predicted proportions. |
Takes standard inputs for the Bisque method. If user provides matrices, will convert these into ExpressionSet objects compatible with the main bisque method.
New object of class bisqueParam.
## get data exampleList <- getDeconvolutionExampleDataBisque() bulkExpressionSet <- exampleList[["bulkExpressionSet"]][,seq(10)] bulkExpression <- exprs(exampleList[["bulkExpressionSet"]]) bulkExpression <- bulkExpression[,c(11:ncol(bulkExpression))] ## get param object newBisqueParameter <- bisqueParam(bulkExpressionSet=bulkExpressionSet, bulkExpressionIndependent=bulkExpression, scData=exampleList[["singleCellExpressionSet"]], batchVariable="SubjectName", cellTypeVariable="cellType", useOverlap=FALSE) ## get predicted proportions deconvolutionResult <- deconvolution(newBisqueParameter)
## get data exampleList <- getDeconvolutionExampleDataBisque() bulkExpressionSet <- exampleList[["bulkExpressionSet"]][,seq(10)] bulkExpression <- exprs(exampleList[["bulkExpressionSet"]]) bulkExpression <- bulkExpression[,c(11:ncol(bulkExpression))] ## get param object newBisqueParameter <- bisqueParam(bulkExpressionSet=bulkExpressionSet, bulkExpressionIndependent=bulkExpression, scData=exampleList[["singleCellExpressionSet"]], batchVariable="SubjectName", cellTypeVariable="cellType", useOverlap=FALSE) ## get predicted proportions deconvolutionResult <- deconvolution(newBisqueParameter)
Applies the BisqueRNA::ReferenceBasedDecomposition() implementation of the Bisque deconvolution algorithm.
Main constructor for class bisqueParam.
New object of class bisqueParam.
Brandon Jew and Marcus Alvarez (2021). BisqueRNA: Decomposition of Bulk Expression with Single-Cell Sequencing. CRAN, R package version 1.0.5. URL: https://CRAN.R-project.org/package=BisqueRNA
Brandon Jew et al. Accurate estimation of cell composition in bulk expression through robust integration of single-cell information. Nat Commun 11, 1971 (2020). https://doi.org/10.1038/s41467-020-15816-6
deconvolutionParam, referencebasedParam, independentbulkParam
## get data exampleList <- getDeconvolutionExampleDataBisque() bulkExpressionSet <- exampleList[["bulkExpressionSet"]][,seq(10)] bulkExpression <- exprs(exampleList[["bulkExpressionSet"]]) bulkExpression <- bulkExpression[,c(11:ncol(bulkExpression))] ## get param object newBisqueParameter <- bisqueParam(bulkExpressionSet=bulkExpressionSet, bulkExpressionIndependent=bulkExpression, scData=exampleList[["singleCellExpressionSet"]], batchVariable="SubjectName", cellTypeVariable="cellType", useOverlap=FALSE) ## get predicted proportions res <- deconvolution(newBisqueParameter)
## get data exampleList <- getDeconvolutionExampleDataBisque() bulkExpressionSet <- exampleList[["bulkExpressionSet"]][,seq(10)] bulkExpression <- exprs(exampleList[["bulkExpressionSet"]]) bulkExpression <- bulkExpression[,c(11:ncol(bulkExpression))] ## get param object newBisqueParameter <- bisqueParam(bulkExpressionSet=bulkExpressionSet, bulkExpressionIndependent=bulkExpression, scData=exampleList[["singleCellExpressionSet"]], batchVariable="SubjectName", cellTypeVariable="cellType", useOverlap=FALSE) ## get predicted proportions res <- deconvolution(newBisqueParameter)
Make new cellProportionsPredictions object.
cellProportionsPredictions( predictionsTable, cellTypeVector = NULL, sampleIdVector = NULL )
cellProportionsPredictions( predictionsTable, cellTypeVector = NULL, sampleIdVector = NULL )
predictionsTable |
Table of cell type predictions. |
cellTypeVector |
Character vector of cell type labels. |
sampleIdVector |
Character vector of sample id labels. |
New cellProportionsPredictions object.
New cellProportionsPredictions object.
exampleData <- getDeconvolutionExampleData()
exampleData <- getDeconvolutionExampleData()
Class for cell type predictions.
predictionsTable |
Table containing cell type predictions. |
cellTypeVector |
Character vector of cell type labels. |
sampleIdVector |
Character vector of sample id labels. |
Main constructor for class cellProportionsPredictions.
New cellProportionsPredictions object.
new("cellProportionsPredictions") predictionsTable <- matrix(sample(100,50),nrow=10) colnames(predictionsTable) <- paste0("cell_type",seq(ncol(predictionsTable))) rownames(predictionsTable) <- paste0("sample", seq(nrow(predictionsTable))) cellProportionsPredictions(predictionsTable)
new("cellProportionsPredictions") predictionsTable <- matrix(sample(100,50),nrow=10) colnames(predictionsTable) <- paste0("cell_type",seq(ncol(predictionsTable))) rownames(predictionsTable) <- paste0("sample", seq(nrow(predictionsTable))) cellProportionsPredictions(predictionsTable)
Get predicted cell type proportions using a deconvolution method.
deconvolution(object)
deconvolution(object)
object |
A deconvolutionParam-type object (see
|
This generic maps standard deconvolution inputs to the parameters of the
specified deconvolution method for which a subclass of type
deconvolutionParam exists. This generic uses a similar approach to
the bluster
R/Bioconductor package.
By default, return named numeric vector of predicted proportions for each cell type.
If returnInfo == TRUE
, instead returns a list including proportions,
results object returned from specified method, and additional metadata.
Sean Maden
Aaron Lun. bluster: Clustering Algorithms for Bioconductor. (2022) Bioconductor, R package version 1.6.0.
deconvolutionParam, referencebasedParam, independentbulkParam, nnlsParam, musicParam,bisqueParam
## get param object exampleList <- getDeconvolutionExampleData() param <- nnlsParam(cellScaleFactors=exampleList[["cellScaleFactors"]], bulkExpression=exampleList[["bulkExpression"]], referenceExpression=exampleList[["referenceExpression"]]) ## run deconvolution deconvolution(param)
## get param object exampleList <- getDeconvolutionExampleData() param <- nnlsParam(cellScaleFactors=exampleList[["cellScaleFactors"]], bulkExpression=exampleList[["bulkExpression"]], referenceExpression=exampleList[["referenceExpression"]]) ## run deconvolution deconvolution(param)
Main method to access the Bisque deconvolution method from the main lute
deconvolution
generic.
## S4 method for signature 'bisqueParam' deconvolution(object)
## S4 method for signature 'bisqueParam' deconvolution(object)
object |
Object of type bisqueParam (see
|
Takes an object of class bisqueParam as input, returning a list.
Either a vector of predicted proportions, or a list containing predictions, metadata, and original outputs.
Brandon Jew and Marcus Alvarez (2021). BisqueRNA: Decomposition of Bulk Expression with Single-Cell Sequencing. CRAN, R package version 1.0.5. URL: https://CRAN.R-project.org/package=BisqueRNA
Brandon Jew et al. Accurate estimation of cell composition in bulk expression through robust integration of single-cell information. Nat Commun 11, 1971 (2020). https://doi.org/10.1038/s41467-020-15816-6
## get data exampleList <- getDeconvolutionExampleDataBisque() bulkExpressionSet <- exampleList[["bulkExpressionSet"]][,seq(10)] bulkExpression <- exprs(exampleList[["bulkExpressionSet"]]) bulkExpression <- bulkExpression[,c(11:ncol(bulkExpression))] ## get param object newBisqueParameter <- bisqueParam(bulkExpressionSet=bulkExpressionSet, bulkExpressionIndependent=bulkExpression, scData=exampleList[["singleCellExpressionSet"]], batchVariable="SubjectName", cellTypeVariable="cellType", useOverlap=FALSE) ## get predicted proportions deconvolutionResult <- deconvolution(newBisqueParameter)
## get data exampleList <- getDeconvolutionExampleDataBisque() bulkExpressionSet <- exampleList[["bulkExpressionSet"]][,seq(10)] bulkExpression <- exprs(exampleList[["bulkExpressionSet"]]) bulkExpression <- bulkExpression[,c(11:ncol(bulkExpression))] ## get param object newBisqueParameter <- bisqueParam(bulkExpressionSet=bulkExpressionSet, bulkExpressionIndependent=bulkExpression, scData=exampleList[["singleCellExpressionSet"]], batchVariable="SubjectName", cellTypeVariable="cellType", useOverlap=FALSE) ## get predicted proportions deconvolutionResult <- deconvolution(newBisqueParameter)
Deconvolution generic behavior for object of class deconvolutionParam
## S4 method for signature 'deconvolutionParam' deconvolution(object)
## S4 method for signature 'deconvolutionParam' deconvolution(object)
object |
An object of class deconvolutionParam (see
|
Method for behavior of deconvolution generic when called for object of class deconvolutionParam.
Null method.
param <- new("deconvolutionParam") deconvolution(param)
param <- new("deconvolutionParam") deconvolution(param)
Function to perform standard operations prior to deconvolution (a.k.a. "deconvolution prep") for an object of class independentbulkParam.
## S4 method for signature 'independentbulkParam' deconvolution(object)
## S4 method for signature 'independentbulkParam' deconvolution(object)
object |
An object of class independentbulkParam. |
Takes an object of independentbulkParam class as input, and returns a list with the filtered/checked/parsed experiment objects.
Method results.
new("independentbulkParam")
new("independentbulkParam")
Defines the deconvolution method for nnlsParam.
## S4 method for signature 'nnlsParam' deconvolution(object)
## S4 method for signature 'nnlsParam' deconvolution(object)
object |
An object of class nnlsParam (see
|
Takes an object of class nnlsParam as input, returning either a list containing proportions, return info, and metadata, or a vector of predicted cell type proportions.
The key term mappings for this method include:
* A
: bulkExpression
, bulk signals matrix (Y).
* b
: referenceExpression
, signature matrix (Z).
Either a vector of predicted proportions, or a list containing predictions, metadata, and original outputs.
Katharine M. Mullen and Ivo H. M. van Stokkum (2012). "nnls: The Lawson-Hanson algorithm for non-negative least squares (NNLS)." CRAN, R package version 1.4. URL: https://cran.r-project.org/web/packages/nnls/index.html
exampleList <- getDeconvolutionExampleData() param <- nnlsParam( cellScaleFactors=exampleList[["cellScaleFactors"]], bulkExpression=exampleList[["bulkExpression"]], referenceExpression=exampleList[["referenceExpression"]]) ## return only predicted proportions deconvolution(param) # return full results param@returnInfo <- TRUE names(deconvolution(param))
exampleList <- getDeconvolutionExampleData() param <- nnlsParam( cellScaleFactors=exampleList[["cellScaleFactors"]], bulkExpression=exampleList[["bulkExpression"]], referenceExpression=exampleList[["referenceExpression"]]) ## return only predicted proportions deconvolution(param) # return full results param@returnInfo <- TRUE names(deconvolution(param))
Deconvolution generic behavior for object of class referencebasedParam
## S4 method for signature 'referencebasedParam' deconvolution(object)
## S4 method for signature 'referencebasedParam' deconvolution(object)
object |
An object of class referencebasedParam (see
|
Method for behavior of deconvolution generic when called for object of class referencebasedParam.
Method results.
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors)
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors)
Defines the principal parent class for all deconvolution method parameters.
Defines the parent class for deconvolution method parameters. Since all
deconvolution runs require a y
signals matrix, whether from
experiment data or simulations such as pseudobulking, this parent class
manages the bulk signals matrix. For this class, the
deconvolution
generic performs basic summaries of the bulk
signals matrix.
New deconvolutionParam object.
deconvolution
param <- new("deconvolutionParam") deconvolution(param)
param <- new("deconvolutionParam") deconvolution(param)
eset_to_sce Convert ExpressionSet to SingleCellExperiment.
eset_to_sce(expressionSet, assayName = "counts")
eset_to_sce(expressionSet, assayName = "counts")
expressionSet |
Object of type ExpressionSet (see |
assayName |
Name of new assay in new SingleCellExperiment object. |
ExpressionSet.
expressionSet <- getDeconvolutionExampleDataBisque()$singleCellExpressionSet eset_to_sce(expressionSet)
expressionSet <- getDeconvolutionExampleDataBisque()$singleCellExpressionSet eset_to_sce(expressionSet)
Convert ExpressionSet to SummarizedExperiment.
eset_to_se(expressionSet, assayName = "counts")
eset_to_se(expressionSet, assayName = "counts")
expressionSet |
Object of type ExpressionSet (see |
assayName |
Name of assay to store in new SummarizedExperiment object. |
New object of type SummarizedExperiment.
expressionSet <- getDeconvolutionExampleDataBisque()$singleCellExpressionSet eset_to_se(expressionSet, "counts")
expressionSet <- getDeconvolutionExampleDataBisque()$singleCellExpressionSet eset_to_se(expressionSet, "counts")
Main constructor for class findmarkersParam.
findmarkersParam( singleCellExperiment, assayName = "counts", cellTypeVariable = "cellType", testType = "wilcox", markersPerType = 20, returnInfo = FALSE )
findmarkersParam( singleCellExperiment, assayName = "counts", cellTypeVariable = "cellType", testType = "wilcox", markersPerType = 20, returnInfo = FALSE )
singleCellExperiment |
Object of type SingleCellExperiment (see
|
assayName |
Name of expression matrix in SingleCellExperiment assays (e.g. "counts"). |
cellTypeVariable |
Name of cell type variable in SingleCellExperiment coldata. |
testType |
Test type (see |
markersPerType |
Number of top markers to get per cell type. |
returnInfo |
Whether to return metadata and original method outputs with predicted proportions. |
Main class for mapping arguments to the findMarkers method
implemented as scran::findMarkers()
.
Object of class findmarkersParam
exampleList <- getDeconvolutionExampleData() singleCellExperimentExample <- randomSingleCellExperiment() newParam <- findmarkersParam(singleCellExperiment=singleCellExperimentExample, cellTypeVariable="celltype", markersPerType=5) markers <- typemarkers(newParam)
exampleList <- getDeconvolutionExampleData() singleCellExperimentExample <- randomSingleCellExperiment() newParam <- findmarkersParam(singleCellExperiment=singleCellExperimentExample, cellTypeVariable="celltype", markersPerType=5) markers <- typemarkers(newParam)
class definition for findmarkersParam, which uses scran::findMarkers()
assayName |
Name of expression matrix in SingleCellExperiment assays (e.g. "counts"). |
singleCellExperiment |
Object of type SingleCellExperiment (see
|
cellTypeVariable |
Name of cell type variable in SingleCellExperiment coldata. |
testType |
Test type (see |
Main constructor for class findmarkersParam.
New object.
exampleList <- getDeconvolutionExampleData() singleCellExperimentExample <- randomSingleCellExperiment() newParam <- findmarkersParam(singleCellExperiment=singleCellExperimentExample, cellTypeVariable="celltype", markersPerType=5) markers <- typemarkers(newParam)
exampleList <- getDeconvolutionExampleData() singleCellExperimentExample <- randomSingleCellExperiment() newParam <- findmarkersParam(singleCellExperiment=singleCellExperimentExample, cellTypeVariable="celltype", markersPerType=5) markers <- typemarkers(newParam)
Extract cell type values from SingleCellExperiment.
get_celltypes_from_sce(singleCellExperiment, cellTypeVariable = "celltype")
get_celltypes_from_sce(singleCellExperiment, cellTypeVariable = "celltype")
singleCellExperiment |
A SingleCellExperiment object. |
cellTypeVariable |
Variable containing cell type labels (e.g. "type1", "type2", etc.). |
List of cell type variable metadata and values.
exampleList <- getDeconvolutionExampleData()
exampleList <- getDeconvolutionExampleData()
Retrieves the cell scale factors (csf) reference from the cellScaleFactors package.
get_csf_reference(userCellTypesVector = NULL, preferOrthogonal = TRUE)
get_csf_reference(userCellTypesVector = NULL, preferOrthogonal = TRUE)
userCellTypesVector |
Vector of user-specified cell types. |
preferOrthogonal |
Whether to prefer expression-orthogonal values (if TRUE, removes expression-based values, but only if alternative value types are available). |
Returns a table of cell scale factors from various data sources. The cell scale factors reference table has the following columns:
1. cell_type : Label of the cell type for the scale factor (e.g. neuron, T cell, etc.) 2. tissue : Label of the tissue of origin (e.g. brain, blood, etc.) 3. scale.factor.value : Point scale factor value prior to additional normalization 4. scale.factor.type : Label for scale factor type (e.g. cell or nuclear area, etc.) 5. scale.factor.data.source : Label for scale factor source (e.g. osmFISH, housekeeping gene expression, etc.) 6. citation.s : Citation(s) of source studies from which original measures or measure summaries were made.
Further details about the reference table can be found in the cellScaleFactors package.
Table of type "data.frame" or "tibble".
example.data <- getDeconvolutionExampleData()
example.data <- getDeconvolutionExampleData()
Makes an ExpressionSet from a matrix.
get_eset_from_matrix(inputMatrix, batchVariable = "SampleName")
get_eset_from_matrix(inputMatrix, batchVariable = "SampleName")
inputMatrix |
User-specified expression matrix. |
batchVariable |
Name of the batch variable. |
ExpressionSet.
exampleList <- getDeconvolutionExampleData()
exampleList <- getDeconvolutionExampleData()
Make example data for deconvolution.
getDeconvolutionExampleData( cellScaleFactors = c(1, 10), numberBulkSamples = 2, numberMarkers = 10, numberTypes = 2 )
getDeconvolutionExampleData( cellScaleFactors = c(1, 10), numberBulkSamples = 2, numberMarkers = 10, numberTypes = 2 )
cellScaleFactors |
Vector of cell scale factors |
numberBulkSamples |
Number of bulk samples. |
numberMarkers |
Number of cell type markers. |
numberTypes |
Number of cell types. |
Example data as list.
exampleData <- getDeconvolutionExampleData()
exampleData <- getDeconvolutionExampleData()
Get example data for Bisque algorithm.
getDeconvolutionExampleDataBisque( numberBulkSamples = 100, numberMarkers = 1000, numberCells = 1000, numberTypes = 2 )
getDeconvolutionExampleDataBisque( numberBulkSamples = 100, numberMarkers = 1000, numberCells = 1000, numberTypes = 2 )
numberBulkSamples |
Number of bulk samples. |
numberMarkers |
Number of cell type markers. |
numberCells |
Number of cells. |
numberTypes |
Number of cell types. |
Example data as list.
exampleData <- getDeconvolutionExampleDataBisque()
exampleData <- getDeconvolutionExampleDataBisque()
Get example data for SCDC
getDeconvolutionExampleDataSCDC()
getDeconvolutionExampleDataSCDC()
Example data as list.
exampleData <- getDeconvolutionExampleDataSCDC()
exampleData <- getDeconvolutionExampleDataSCDC()
Function to make a new object of class independentbulkParam
independentbulkParam( bulkExpression = NULL, bulkExpressionIndependent = NULL, referenceExpression = NULL, cellScaleFactors = NULL, returnInfo = FALSE )
independentbulkParam( bulkExpression = NULL, bulkExpressionIndependent = NULL, referenceExpression = NULL, cellScaleFactors = NULL, returnInfo = FALSE )
bulkExpression |
Bulk mixed signals matrix of samples, which can be matched to single-cell samples. |
bulkExpressionIndependent |
Bulk mixed signals matrix of independent samples, which should not overlap samples in y. |
referenceExpression |
Signature matrix of cell type-specific signals. If not provided, can be computed from a provided ExpressionSet containing single-cell data. |
cellScaleFactors |
Cell size scale factor transformations of length equal to the K cell types to deconvolve. |
returnInfo |
Whether to return metadata and original method outputs with predicted proportions. |
New object.
new("independentbulkParam")
new("independentbulkParam")
Class and methods for managing methods requiring independent bulk samples.
bulkExpressionIndependent |
Bulk mixed signals matrix of independent samples, which should not overlap samples in y. |
The main purpose of this class is to compare bulk sample data between the passed objects y and yi. Since we assume yi contains the independent bulk samples, it should not have overlapping sample IDs (colnames), and it should have overlapping marker IDs (rownames) compared to the reference bulk samples y.
New object.
deconParam, referencebasedParam
new("independentbulkParam")
new("independentbulkParam")
Obtain cell type markers and proportion predictions from various algorithms. Allows flexible data types and standard application of cell size scale factors.
lute( singleCellExperiment = NULL, referenceExpression = NULL, bulkExpression = NULL, bulkSummarizedExperiment = NULL, cellScaleFactors = NULL, returnInfo = FALSE, markersPerType = 20, assayName = "counts", cellTypeVariable = "celltype", typemarkerAlgorithm = "findmarkers", deconvolutionAlgorithm = "nnls", verbose = TRUE )
lute( singleCellExperiment = NULL, referenceExpression = NULL, bulkExpression = NULL, bulkSummarizedExperiment = NULL, cellScaleFactors = NULL, returnInfo = FALSE, markersPerType = 20, assayName = "counts", cellTypeVariable = "celltype", typemarkerAlgorithm = "findmarkers", deconvolutionAlgorithm = "nnls", verbose = TRUE )
singleCellExperiment |
Object of type SingleCellExperiment. Optional (see argument z). |
referenceExpression |
Signature matrix of cell type-specific signals. Optional (see argument singleCellExperiment). |
bulkExpression |
Bulk mixed signals matrix of samples, which can be matched to single-cell samples. Optional (see argument y.se). |
bulkSummarizedExperiment |
SummarizedExperiment or similar data type containing the bulk signals matrix in its assays (e.g. accessible with assays(y.se)[[assayName]] using the provided assayName argument). Optional (see argument y). |
cellScaleFactors |
Cell size factor transformations of length equal to the K cell types to deconvolve. Optional, if not provided, uses equal weights for types. |
returnInfo |
Whether to return metadata and original method outputs with predicted proportions. |
markersPerType |
Number of top markers to get per cell type. |
assayName |
Name of expression matrix in singleCellExperiment, and optionally y.se, assays. Optional (e.g. "counts"; see arguments singleCellExperiment, y.se). |
cellTypeVariable |
Name of cell type variable in singleCellExperiment coldata. |
typemarkerAlgorithm |
Which type-specific marker selection algorithm to use. If NULL, skips type marker analyses. |
deconvolutionAlgorithm |
Where deconvolution algorithm to use. If NULL, skips deconvolution. |
verbose |
Whether to show verbose status messages. |
Main function to use the lute deconvolution framework. Manages data conversions and mappings to deconvolution experiment steps, including setup, gene marker identification, and main deconvolution runs.
Support is provided for SummarizedExperiment-type or matrix-type inputs for the Z signature matrix (see referenceExpression argument) and Y bulk signals matrix (see bulkExpression arguments). Note, both Z and Y need to be provided or derivable in order to run deconvolution.
A list containing results returned from type marker selection and
deconvolution runs, with additional information returned if
returnInfo == TRUE
.
# get example bulk data bulkExpression <- getDeconvolutionExampleData()$reference # get example singleCellExperiment singleCellExperiment <- randomSingleCellExperiment()[seq(10),] # get framework results experiment.results <- lute( singleCellExperiment=singleCellExperiment, bulkExpression=bulkExpression, typemarkerAlgorithm=NULL )
# get example bulk data bulkExpression <- getDeconvolutionExampleData()$reference # get example singleCellExperiment singleCellExperiment <- randomSingleCellExperiment()[seq(10),] # get framework results experiment.results <- lute( singleCellExperiment=singleCellExperiment, bulkExpression=bulkExpression, typemarkerAlgorithm=NULL )
View details about supported deconvolution algorithms.
luteSupportedDeconvolutionAlgorithms()
luteSupportedDeconvolutionAlgorithms()
Table of supported deconvolution algorithms.
luteSupportedDeconvolutionAlgorithms()
luteSupportedDeconvolutionAlgorithms()
Makes a new experiment table for r-nf_deconvolution runs.
new_workflow_table( singleCellExperimentNames = NULL, dataDirectory = "data", trueProportionsFilenameStem = "true_proportions_", cellTypeVariable = "celltype", tableDirectory = ".", tableFileName = "workflow_table.csv", save = TRUE, overwrite = TRUE, verbose = FALSE )
new_workflow_table( singleCellExperimentNames = NULL, dataDirectory = "data", trueProportionsFilenameStem = "true_proportions_", cellTypeVariable = "celltype", tableDirectory = ".", tableFileName = "workflow_table.csv", save = TRUE, overwrite = TRUE, verbose = FALSE )
singleCellExperimentNames |
Names of SingleCellExperiment files to load. |
dataDirectory |
Directory containing datasets to load. |
trueProportionsFilenameStem |
File name stem of true proportions values. |
cellTypeVariable |
Name of variable containing cell type labels. |
tableDirectory |
Directory to write table. |
tableFileName |
The file name of the new table to write. |
save |
Whether to save the new table. |
overwrite |
Whether to overwrite old table files. |
verbose |
Whether to show verbose messages (T/F). |
Makes and returns/saves a r-nf_deconvolution experiment table. Checks for existence of provided files.
New r-nf_deconvolution compatible table of experiment/run metadata.
new_workflow_table(save=FALSE)
new_workflow_table(save=FALSE)
Main constructor for class nnlsParam.
nnlsParam( bulkExpression, referenceExpression, cellScaleFactors, returnInfo = FALSE )
nnlsParam( bulkExpression, referenceExpression, cellScaleFactors, returnInfo = FALSE )
bulkExpression |
Bulk mixed signals matrix of samples, which can be matched to single-cell samples. |
referenceExpression |
Signature matrix of cell type-specific signals. If not provided, can be computed from a provided ExpressionSet containing single-cell data. |
cellScaleFactors |
Cell size factor transformations of length equal to the K cell types to deconvolve. |
returnInfo |
Whether to return metadata and original method outputs with predicted proportions. |
Main parameter class for mapping inputs to the non-negative least
squares (NNLS) deconvolution algorithm, implemented as nnls::nnls()
.
Object of class nnlsParam
referencebasedParam, deconvolutionParam
exampleList <- getDeconvolutionExampleData() param <- nnlsParam(cellScaleFactors=exampleList[["cellScaleFactors"]], bulkExpression=exampleList[["bulkExpression"]], referenceExpression=exampleList[["referenceExpression"]]) ## return only predicted proportions deconvolution(param) # return full results param@returnInfo <- TRUE names(deconvolution(param))
exampleList <- getDeconvolutionExampleData() param <- nnlsParam(cellScaleFactors=exampleList[["cellScaleFactors"]], bulkExpression=exampleList[["bulkExpression"]], referenceExpression=exampleList[["referenceExpression"]]) ## return only predicted proportions deconvolution(param) # return full results param@returnInfo <- TRUE names(deconvolution(param))
Uses nnls::nnls().
Main constructor for class nnlsParam.
New object.
exampleList <- getDeconvolutionExampleData() param <- nnlsParam(cellScaleFactors=exampleList[["cellScaleFactors"]], bulkExpression=exampleList[["bulkExpression"]], referenceExpression=exampleList[["referenceExpression"]]) ## return only predicted proportions deconvolution(param) # return full results param@returnInfo <- TRUE names(deconvolution(param))
exampleList <- getDeconvolutionExampleData() param <- nnlsParam(cellScaleFactors=exampleList[["cellScaleFactors"]], bulkExpression=exampleList[["bulkExpression"]], referenceExpression=exampleList[["referenceExpression"]]) ## return only predicted proportions deconvolution(param) # return full results param@returnInfo <- TRUE names(deconvolution(param))
Gets formatted predicted cell type proportions table from deconvolution results list.
parseDeconvolutionPredictionsResults(listPred, columnLabels, rowLabels)
parseDeconvolutionPredictionsResults(listPred, columnLabels, rowLabels)
listPred |
List of cell type proportions predictions. |
columnLabels |
Vector of cell type labels (e.g. "type1", "type2", etc.). |
rowLabels |
Vector of sample id labels (e.g. "sample1", "sample2", etc.). |
Example data as list.
exampleData <- getDeconvolutionExampleData()
exampleData <- getDeconvolutionExampleData()
Get complementary proportions for k types. The first type k1 is the vector of proportions for the first type. The remaining types up to totalCellTypesK are based on the reverse of k1. Types k > 1 are assumed to have equal proportions complementary to k1.
proportionsVectorsList(totalCellTypesK = 2, firstCellTypeProportions = NULL)
proportionsVectorsList(totalCellTypesK = 2, firstCellTypeProportions = NULL)
totalCellTypesK |
Total number of cell types to simulate. |
firstCellTypeProportions |
Vector of first cell type proportions. If NULL, uses seq(1e-3, 1-1e-3, 1e-3). |
For k1=c(0, 0.5, 1), totalCellTypesK=2 will generate an additional type with proportions c(1, 0.5, 0).
For the same k1 above, totalCellTypesK=3, will generate 2 types with the same proportions as c(0.5, 0.25, 0).
lpv, a list of proportions vectors for simulation iterations.
proportionsVectorsList(firstCellTypeProportions=c(0, 0.5, 1))
proportionsVectorsList(firstCellTypeProportions=c(0, 0.5, 1))
Get randomized markers using Poisson distribution sampling. For a given K, we assume "positive" markers have higher values than for non-K types, and thus we sample from 2 different Poisson distributions defined by different lambda values (e.g. arguments lambdaMean, lambdaMeanNegative). WE also use argument markerIndexVector to define total markers as length(markerIndexVector) and the marker balance as relative counts of each type index.
randomMarkersVectorsList( markerIndexVector, numberIterations = 1, lambdaMean = 25, lambdaMeanNegative = 2, method = "nbinom", gammaSize = 10, gammaSizeNegative = 10 )
randomMarkersVectorsList( markerIndexVector, numberIterations = 1, lambdaMean = 25, lambdaMeanNegative = 2, method = "nbinom", gammaSize = 10, gammaSizeNegative = 10 )
markerIndexVector |
Vector of marker indices. Index values correspond to the k types, and each index position represents a marker (e.g. c(1,2,2) means two markers for the second type, etc.). |
numberIterations |
Total simulation iterations. |
lambdaMean |
Value of lambda (Poisson dist. mean) for "positive" marker status (e.g. mean of dist. for k when marker is positive for k, negative for not-k). This is passed to the argument mu when method is "nbinom". |
lambdaMeanNegative |
Value of lambda (Poisson dist. mean) for "negative" marker status (e.g. mean of dist. for k when marker is positive for not-k, negative for k). This is passed to the argument mu when method is "nbinom". |
method |
Type of randomization method to use. Accepts either "poisson" for poisson distribution (see '?rpois' for details), or "nbinom" for the negative binomial (a.k.a. gamm poisson) distribution (see '?rnbinom' for details). |
gammaSize |
The gamma distribution magnitude for "positive" markers. This is applied when the "nbinom" method is used. |
gammaSizeNegative |
The gamma distribution magnitude for "negative" markers. This is applied when the "nbinom" method is used. |
For example, if gindex is c(1, 1, 2), we define 3 total markers, 2 positive markers for type 1 (negative for type 2) and a single positive marker for type 2 (negative for type 1).
Listed lgv object containing the randomized marker values across types.
randomMarkersVectorsList(markerIndexVector=c(rep(1, 10), rep(2, 5)))
randomMarkersVectorsList(markerIndexVector=c(rep(1, 10), rep(2, 5)))
Make a random object of type SingleCellExperiment. Uses the negative binomial distribution to randomly generate gene expression data for simulated cells.
randomSingleCellExperiment( numberGenes = 20, numberCells = 12, numberTypes = 2, fractionTypes = NULL, dispersion = NULL, expressionMean = 10, naInclude = FALSE, naFraction = 0.2, zeroInclude = FALSE, zeroFraction = 0.2, verbose = FALSE, seedNumber = 0 )
randomSingleCellExperiment( numberGenes = 20, numberCells = 12, numberTypes = 2, fractionTypes = NULL, dispersion = NULL, expressionMean = 10, naInclude = FALSE, naFraction = 0.2, zeroInclude = FALSE, zeroFraction = 0.2, verbose = FALSE, seedNumber = 0 )
numberGenes |
Number of genes to randomize. |
numberCells |
Numnber of cells to randomize. |
numberTypes |
Number of cell types to annotate. |
fractionTypes |
Vector of fractions by type. |
dispersion |
Disperison of gene expression. If NULL, uses the mean from expressionMean |
expressionMean |
Poisson dist mean for random expression data. |
naInclude |
Whether to include random NA values. |
naFraction |
Fraction of NA values to include. |
zeroInclude |
Whether to include random zero-count values. |
zeroFraction |
Fraction of zero-count values to include. |
verbose |
Whether to show verbose status messages. |
seedNumber |
Seed value for randomization of expression data. |
New randomized SingleCellExperiment object.
singleCellExperiment <- randomSingleCellExperiment()
singleCellExperiment <- randomSingleCellExperiment()
Main constructor for class referencebasedParam.
referencebasedParam( bulkExpression, referenceExpression, cellScaleFactors, returnInfo = FALSE )
referencebasedParam( bulkExpression, referenceExpression, cellScaleFactors, returnInfo = FALSE )
bulkExpression |
Bulk mixed signals matrix of samples, which can be matched to single-cell samples. |
referenceExpression |
Signature matrix of cell type-specific signals. If not provided, can be computed from a provided ExpressionSet containing single-cell data. |
cellScaleFactors |
Cell size factor transformations of length equal to the K cell types to deconvolve. |
returnInfo |
Whether to return metadata and original method outputs with predicted proportions. |
Takes standard inputs for reference-based deconvolution algorithms.
New object of class referencebasedParam.
New object.
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors )
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors )
Class and methods for managing reference-based deconvolution methods.
This is a parent class to manage reference-based deconvolution algorithms.
Child/sub-classes of this are distinguished by their use of
either an explicit or implied z
signature matrix (i.e. Z[G,K] of
dimensions G markers by K cell types). These also have an implied cell size
term for biases from systematic cell size differences. If no cell size
transformation is intended, this is the equivalent of passing equal size
scales, (e.g. a K-length vector of equal values). See
'vignette(package="lute")' for details about experiment terms.
New object.
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors)
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors)
Makes the Z cell atlas reference from a SingleCellExperiment.
referenceFromSingleCellExperiment( singleCellExperiment, assayName = "counts", cellTypeVariable = "celltype" )
referenceFromSingleCellExperiment( singleCellExperiment, assayName = "counts", cellTypeVariable = "celltype" )
singleCellExperiment |
A SingleCellExperiment object. |
assayName |
Name of expression assay type (e.g. "counts"). |
cellTypeVariable |
Name of variable containing cell type labels (e.g. "type1", "type2", etc.). |
Matrix of cell summary values (Z reference atlas).
exampleList <- getDeconvolutionExampleData()
exampleList <- getDeconvolutionExampleData()
Takes 2 vectors of numerics
rmse(proportionsTrue, proportionsPred, summaryType = "mean")
rmse(proportionsTrue, proportionsPred, summaryType = "mean")
proportionsTrue |
cell type proportions taken as true |
proportionsPred |
cell type proportions taken as false |
summaryType |
Toggle summary type (either "mean" or "median") |
Calculates the root mean squared error (RMSE) for specified true and predicted cell type proportions.
Function does not distinguish between true and predicted status, variable labels provided for convenience.
single numeric
proportionsVectorPred <- seq(1e-10,2e-10,1e-11) proportionsVectorTrue <- rev(proportionsVectorPred) rmse(proportionsVectorTrue, proportionsVectorPred)
proportionsVectorPred <- seq(1e-10,2e-10,1e-11) proportionsVectorTrue <- rev(proportionsVectorPred) rmse(proportionsVectorTrue, proportionsVectorPred)
Takes 2 vectors of numerics
rmseTest(firstVector, secondVector)
rmseTest(firstVector, secondVector)
firstVector |
First numeric vector. |
secondVector |
Second numeric vector. |
Tests the rmse function for rounding imprecision.
Function to test RMSE values ('./unitTests/test_rmse.R').
Single numeric value
proportionsVectorPred <- seq(1e-10,2e-10,1e-11) proportionsVectorTrue <- rev(proportionsVectorPred) rmseTest(proportionsVectorTrue, proportionsVectorPred)
proportionsVectorPred <- seq(1e-10,2e-10,1e-11) proportionsVectorTrue <- rev(proportionsVectorPred) rmseTest(proportionsVectorTrue, proportionsVectorPred)
sce_to_eset Convert SingleCellExperiment to ExpressionSet.
sce_to_eset(singleCellExperiment, assayName = "counts")
sce_to_eset(singleCellExperiment, assayName = "counts")
singleCellExperiment |
Object of type SingleCellExperiment (see
|
assayName |
Name of assay to store in new eset. |
ExpressionSet.
sce <- randomSingleCellExperiment() sce_to_eset(sce, "counts")
sce <- randomSingleCellExperiment() sce_to_eset(sce, "counts")
sce_to_se Convert SingleCellExperiment to SummarizedExperiment.
sce_to_se(singleCellExperiment)
sce_to_se(singleCellExperiment)
singleCellExperiment |
Object of type SingleCellExperiment (see
|
SummarizedExperiment.
sce <- randomSingleCellExperiment() sce_to_se(sce)
sce <- randomSingleCellExperiment() sce_to_se(sce)
Convert SummarizedExperiment to ExpressionSet.
se_to_eset(summarizedExperiment, assayName = "counts")
se_to_eset(summarizedExperiment, assayName = "counts")
summarizedExperiment |
Object of type SummarizedExperiment (see
|
assayName |
Name of assay to store in new ExpressionSet object. |
New object of type ExpressionSet.
summarizedExperiment <- sce_to_se(randomSingleCellExperiment()) se_to_eset(summarizedExperiment)
summarizedExperiment <- sce_to_se(randomSingleCellExperiment()) se_to_eset(summarizedExperiment)
Convert SummarizedExperiment to SingleCellExperiment.
se_to_sce(summarizedExperiment)
se_to_sce(summarizedExperiment)
summarizedExperiment |
Object of type SummarizedExperiment (see
|
New SingleCellExperiment object.
se_to_sce(SummarizedExperiment())
se_to_sce(SummarizedExperiment())
Show generic behavior for object of class bisqueParam
## S4 method for signature 'bisqueParam' show(object)
## S4 method for signature 'bisqueParam' show(object)
object |
Object of class bisqueParam (see
|
Prints data summary messages to console.
## get data exampleList <- getDeconvolutionExampleDataBisque() bulkExpressionSet <- exampleList[["bulkExpressionSet"]][,seq(10)] bulkExpression <- exprs(exampleList[["bulkExpressionSet"]]) bulkExpression <- bulkExpression[,c(11:ncol(bulkExpression))] ## get param object newBisqueParameter <- bisqueParam(bulkExpressionSet=bulkExpressionSet, bulkExpressionIndependent=bulkExpression, scData=exampleList[["singleCellExpressionSet"]], batchVariable="SubjectName", cellTypeVariable="cellType", useOverlap=FALSE) ## show newBisqueParameter
## get data exampleList <- getDeconvolutionExampleDataBisque() bulkExpressionSet <- exampleList[["bulkExpressionSet"]][,seq(10)] bulkExpression <- exprs(exampleList[["bulkExpressionSet"]]) bulkExpression <- bulkExpression[,c(11:ncol(bulkExpression))] ## get param object newBisqueParameter <- bisqueParam(bulkExpressionSet=bulkExpressionSet, bulkExpressionIndependent=bulkExpression, scData=exampleList[["singleCellExpressionSet"]], batchVariable="SubjectName", cellTypeVariable="cellType", useOverlap=FALSE) ## show newBisqueParameter
Inspect cellProportionsPredictions object.
## S4 method for signature 'cellProportionsPredictions' show(object)
## S4 method for signature 'cellProportionsPredictions' show(object)
object |
Object of type cellProportionsPredictions (see
|
Method behavior for show.
Shows object summaries.
exampleData <- getDeconvolutionExampleData()
exampleData <- getDeconvolutionExampleData()
Show generic behavior for object of class deconvolutionParam
## S4 method for signature 'deconvolutionParam' show(object)
## S4 method for signature 'deconvolutionParam' show(object)
object |
An object of class deconvolutionParam (see
|
Method for behavior of show generic when called for object of class deconvolutionParam
Shows object summaries.
param <- new("deconvolutionParam") deconvolution(param)
param <- new("deconvolutionParam") deconvolution(param)
Show generic behavior for object of class findmarkersParam
## S4 method for signature 'findmarkersParam' show(object)
## S4 method for signature 'findmarkersParam' show(object)
object |
An object of class findmarkersParam (see
|
Method for behavior of show generic when called for object of class findmarkersParam
Shows object summaries.
exampleList <- getDeconvolutionExampleData() singleCellExperimentExample <- randomSingleCellExperiment() newParam <- findmarkersParam(singleCellExperiment=singleCellExperimentExample, cellTypeVariable="celltype", markersPerType=5) markers <- typemarkers(newParam)
exampleList <- getDeconvolutionExampleData() singleCellExperimentExample <- randomSingleCellExperiment() newParam <- findmarkersParam(singleCellExperiment=singleCellExperimentExample, cellTypeVariable="celltype", markersPerType=5) markers <- typemarkers(newParam)
Method for independentbulkParam
## S4 method for signature 'independentbulkParam' show(object)
## S4 method for signature 'independentbulkParam' show(object)
object |
An object of class independentbulkParam (see
|
Display data summaries for an object of class independentbulkParam.
Shows object summaries.
new("independentbulkParam")
new("independentbulkParam")
Show generic behavior for object of class nnlsParam
## S4 method for signature 'nnlsParam' show(object)
## S4 method for signature 'nnlsParam' show(object)
object |
Object of class nnlsParam (see
|
Prints data summary messages to console.
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors)
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors)
Show generic behavior for object of class referencebasedParam
## S4 method for signature 'referencebasedParam' show(object)
## S4 method for signature 'referencebasedParam' show(object)
object |
Object of class referencebasedParam (see
|
Prints data summary messages to console.
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors)
exampleList <- getDeconvolutionExampleData() referencebasedParam( bulkExpression=exampleList$bulkExpression, referenceExpression=exampleList$referenceExpression, cellScaleFactors=exampleList$cellScaleFactors)
Show generic behavior for object of class typemarkersParam
## S4 method for signature 'typemarkersParam' show(object)
## S4 method for signature 'typemarkersParam' show(object)
object |
An object of class typemarkersParam (see
|
Method for behavior of show generic when called for object of class typemarkersParam
Shows object summaries.
exampleList <- getDeconvolutionExampleData()
exampleList <- getDeconvolutionExampleData()
Get cell type gene markers using standard accessors to supported functions.
typemarkers(object)
typemarkers(object)
object |
A typemarkersParam-type object (see
|
This generic manages tasks for marker gene identification. In particular, it takes a specified amount of marker genes to return per type.
By default, return a vector of marker genes.
If returnInfo == TRUE
, provides detailed results, including original
outputs.
Sean Maden
exampleList <- getDeconvolutionExampleData()
exampleList <- getDeconvolutionExampleData()
Defines the typemarkers method for findmarkersParam.
## S4 method for signature 'findmarkersParam' typemarkers(object)
## S4 method for signature 'findmarkersParam' typemarkers(object)
object |
An object of class findmarkersParam (see
|
Takes an object of class findmarkersParam as input,
returning either a vector of cell type gene markers, or (if
returnInfo == TRUE
) a list containing such a vector along with
original function outputs.
Returns the top available markers, with type-specific marker filters, as either a vector of marker IDs or a results list.
exampleList <- getDeconvolutionExampleData() singleCellExperimentExample <- randomSingleCellExperiment() newParam <- findmarkersParam(singleCellExperiment=singleCellExperimentExample, cellTypeVariable="celltype", markersPerType=5) markers <- typemarkers(newParam)
exampleList <- getDeconvolutionExampleData() singleCellExperimentExample <- randomSingleCellExperiment() newParam <- findmarkersParam(singleCellExperiment=singleCellExperimentExample, cellTypeVariable="celltype", markersPerType=5) markers <- typemarkers(newParam)
Method for class typemarkersParam
## S4 method for signature 'typemarkersParam' typemarkers(object)
## S4 method for signature 'typemarkersParam' typemarkers(object)
object |
An object of class typemarkersParam. |
Info related to gene markers for cell types.
example.data <- getDeconvolutionExampleData()
example.data <- getDeconvolutionExampleData()
Main constructor for class typemarkersParam.
typemarkersParam(markersPerType = 20, returnInfo = FALSE)
typemarkersParam(markersPerType = 20, returnInfo = FALSE)
markersPerType |
Bulk mixed signals matrix of samples, which can be matched to single-cell samples. |
returnInfo |
Whether to return metadata and original marker selection method outputs with predicted proportions. |
This is the main parent class for cell type gene marker identification methods. Currently supported methods and their child classes include:
1. Mean Ratios: The method DeconvoBuddies::get_mean_ratios2(), supported by the class meanratiosParam.
New object of class typemarkersParam.
example.data <- getDeconvolutionExampleData()
example.data <- getDeconvolutionExampleData()
Main constructor for class to manage mappings to the typemarkers()
generic.
markersPerType |
Number of top markers to get per cell type. |
returnInfo |
Whether to return metadata and original method outputs with predicted proportions. |
Main constructor for class typemarkersParam.
New object.
meanratiosParam
exampleList <- getDeconvolutionExampleData()
exampleList <- getDeconvolutionExampleData()
Get pseudobulk from a SingleCellExperiment object.
ypb_from_sce( singleCellExperiment, assayName = "counts", cellTypeVariable = "celltype", sampleIdVariable = NULL, cellScaleFactors = NULL )
ypb_from_sce( singleCellExperiment, assayName = "counts", cellTypeVariable = "celltype", sampleIdVariable = NULL, cellScaleFactors = NULL )
singleCellExperiment |
An object of type SingleCellExperiment. |
assayName |
Name of expression matrix in |
cellTypeVariable |
Variable name for cell type labels in
|
sampleIdVariable |
Variable name for sample/group ID labels in
|
cellScaleFactors |
Vector of cell type size scale factors. Optional. |
Matrix of simulated bulk convoluted signals.
singleCellExperimentExample <- randomSingleCellExperiment() ypb_from_sce(singleCellExperimentExample)
singleCellExperimentExample <- randomSingleCellExperiment() ypb_from_sce(singleCellExperimentExample)
Calculate a Z signature matrix (referenceExpression) from object of type SingleCellExperiment.
z_matrix_from_sce( singleCellExperiment, cellTypeVariable = "celltype", summaryMethod = "mean", assayName = "counts" )
z_matrix_from_sce( singleCellExperiment, cellTypeVariable = "celltype", summaryMethod = "mean", assayName = "counts" )
singleCellExperiment |
An object of type SingleCellExperiment. |
cellTypeVariable |
Variable name for cell type labels in |
summaryMethod |
Summary statistic function to use. |
assayName |
Name of expression matrix in |
Calculate a Z signature matrix from object of type SingleCellExperiment.
New Z signature matrix.
singleCellExperiment.example <- randomSingleCellExperiment() z_matrix_from_sce(singleCellExperiment.example)
singleCellExperiment.example <- randomSingleCellExperiment() z_matrix_from_sce(singleCellExperiment.example)