% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/CoreMethods.R
\docType{methods}
\name{findCellType}
\alias{findCellType}
\alias{findCellType}
\alias{findCellType.data.frame}
\alias{findCellType,data.frame-method}
\alias{findCellType}
\title{Find cell types associated with a given gene list}
\usage{
findCellType(gene_index = NULL, gene_list = NULL)

findCellType.data.frame(gene_index, gene_list)

\S4method{findCellType}{data.frame}(gene_index = NULL, gene_list = NULL)
}
\arguments{
\item{gene_index}{a data.frame with cell types in columns and genes in rows}

\item{gene_list}{genes that need to be searched in the gene_index}
}
\value{
a named numeric vector containing p-values
}
\description{
Calculates p-values of a log-likelihood of a list of genes to be associated
with each cell type. Log-likelihood is based on gene expression values.
}
\examples{
library(SingleCellExperiment)
sce <- SingleCellExperiment(assays = list(normcounts = as.matrix(yan)), colData = ann)
# this is needed to calculate dropout rate for feature selection
# important: normcounts have the same zeros as raw counts (fpkm)
counts(sce) <- normcounts(sce)
logcounts(sce) <- log2(normcounts(sce) + 1)
# use gene names as feature symbols
rowData(sce)$feature_symbol <- rownames(sce)
isSpike(sce, 'ERCC') <- grepl('^ERCC-', rownames(sce))
# remove features with duplicated names
sce <- sce[!duplicated(rownames(sce)), ]
index <- buildCellTypeIndex(sce)
res <- findCellType(index, gene_list = c('SOX6', 'SNAI3'))

}
