trainModel: Pretrains model for the unsupervised version of MetaNeighbor

Description Usage Arguments Value Examples

View source: R/trainModel.R

Description

When comparing clusters to a large reference dataset, this function summarizes the gene-by-cell matrix into a much smaller highly variable gene-by-cluster matrix which can be fed as training data into MetaNeighborUS, resulting in substantial time and memory savings.

Usage

1
trainModel(var_genes, dat, i = 1, study_id, cell_type)

Arguments

var_genes

vector of high variance genes.

dat

SummarizedExperiment object containing gene-by-sample expression matrix.

i

default value 1; non-zero index value of assay containing the matrix data

study_id

a vector that lists the Study (dataset) ID for each sample

cell_type

a vector that lists the cell type of each sample

Value

The output is a gene-by-cluster matrix that contains all the information necessary to run MetaNeighborUS from a pre-trained model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(mn_data)
var_genes = variableGenes(dat = mn_data, exp_labels = mn_data$study_id)
trained_model = trainModel(var_genes = var_genes,
                           dat = mn_data,
                           study_id = mn_data$study_id,
                           cell_type = mn_data$cell_type)
celltype_NV = MetaNeighborUS(trained_model = trained_model,
                             dat = mn_data,
                             study_id = mn_data$study_id,
                             cell_type = mn_data$cell_type)
celltype_NV

MetaNeighbor documentation built on Nov. 8, 2020, 5:40 p.m.