scBio (version 0.1.0)

CPM: The Cellular Population Mapping (CPM) algorithm.

Description

This function initiate the Cellular Population Mapping (CPM) algorithm - a deconvolution algorithm in which single-cell genomics is required in only one or a few samples, where in other samples of the same tissue, only bulk genomics is measured and the underlying fine resolution cellular heterogeneity is inferred.

Usage

CPM(SCData, SCLabels, BulkData, cellSpace, no_cores = NULL,
  neighborhoodSize = 10, modelSize = 50, minSelection = 5,
  genePercents = 0.4)

Arguments

SCData

A matrix containing the single-cell RNA-seq data. Each row corresponds to a certain gene and each column to a certain cell.

SCLabels

A vector containing the labels of each of the cells.

BulkData

A matrix containing heterogenous RNA-seq data for one or more samples. Each row corresponds to a certain gene and each column to a certain sample.

cellSpace

The cell space corresponding to the single-cell data. It can be a vector for a 1-dim space or a matrix for a multidimensional space where each column represents a different dimension.

no_cores

A number for the amount of cores which will be used for the analysis. The defalt (NULL) is total number of cores minus 1.

neighborhoodSize

Cell neighborhood size which will be used for the analysis. The defalt is 10.

modelSize

The reference subset size. The defalt is 50.

minSelection

The minimum selection times allowed for each cell. Increasing this value might have a large effect on the algorithm's running time. The defalt is 5.

genePercents

Percentage of genes randomely selected in each deconvolution repeat. The defalt is 0.4.

Value

A list including:

predicted

CPM predicted cell abundance matrix. Each row represnts a sample and each column a single cell

numOfRuns

The number of deconvolution repeats preformed by CPM

Examples

Run this code
# NOT RUN {
data(SCLabels)
data(SCFlu)
data(BulkFlu)
data(SCCellSpace)

# Creating relative bulk data (Infleunza infection compared to PBS):
BulkFluReduced = BulkFlu - rowMeans(BulkFlu[,grep("pbs",colnames(BulkFlu))])
BulkFluReduced = BulkFluReduced[,grep("flu",colnames(BulkFluReduced))]

# Running CPM using only a single cell-type:
oneCellTypeIndexes = which(SCLabels == "MPS")
res = CPM(SCData = SCFlu[,oneCellTypeIndexes], SCLabels = SCLabels[oneCellTypeIndexes],
          BulkData = BulkFluReduced, cellSpace = SCCellSpace[oneCellTypeIndexes,], no_cores = 2)

# }
# NOT RUN {
# Running CPM using a variety of cell-types:
res = CPM(SCFlu, SCLabels, BulkFluReduced, SCCellSpace, no_cores = 2)
### Full multi-threading : CPM(SCFlu, SCLabels, BulkFluReduced, SCCellSpace)
# }

Run the code above in your browser using DataCamp Workspace