% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Functions.R
\name{feature_percent}
\alias{feature_percent}
\title{Proportion of features}
\usage{
feature_percent(
  seu,
  feature,
  ident = NULL,
  group.by = NULL,
  DefaultAssay = "RNA",
  above = 0,
  total = F,
  if.expressed = F,
  min.pct = 0.1
)
}
\arguments{
\item{seu}{Seurat object}

\item{feature}{Features to plot (gene expression, metrics, PC scores, anything that can be
retreived by FetchData)}

\item{ident}{cluster name, Default: all clusters}

\item{group.by}{A variable name in meta.data to group by, if you don't want to use
default Idents of Seurat object}

\item{DefaultAssay}{Assay to use, Default: 'RNA'}

\item{above}{Above which value will be considered as positive cell, Default: 0}

\item{total}{If to calculate proportion in total cells of selected clusters, Default: F}

\item{if.expressed}{If only return logical value, Default: F}

\item{min.pct}{Minimum fraction of min.pct cells in the cluster will be considered "expressed",
only use this parameter when "if.expressed" is set to TRUE. Default: 0.1}
}
\value{
A matrix
}
\description{
Check the Proportion of positive cells (default: expression above 0)
in certain clusters
}
\details{
None.
}
\examples{
genes <- VariableFeatures(pbmc)[1:10]

feature_percent(pbmc, feature = genes)

# Count one cell as positive only the expression is above 2
feature_percent(pbmc, feature = genes, above = 2)

# Only check subset of clusters
feature_percent(pbmc, feature = genes, ident = c("B cell", "CD8 T cell"))

# Group by a different variable
feature_percent(pbmc, feature = genes, group.by = "orig.ident")

# Also check the proportion of expressed cells in total clusters
feature_percent(pbmc, feature = genes, total = T)

# only show logical value; 'TRUE' if more than 20\% cells are positive
feature_percent(pbmc, feature = genes, if.expressed = T, min.pct = 0.2)

}
