This package provides a method to purify a cell type or cell population of interest from heterogeneous datasets. scGate package automatizes marker-based purification of specific cell populations, without requiring training data or reference gene expression profiles. scGate takes as input a gene expression matrix stored in a Seurat object and a GM, consisting of a set of marker genes that define the cell population of interest. It evaluates the strength of signature marker expression in each cell using the rank-based method UCell, and then performs kNN smoothing by calculating the mean UCell score across neighboring cells. kNN-smoothing aims at compensating for the large degree of sparsity in scRNAseq data. Finally, a universal threshold over kNN-smoothed signature scores is applied in binary decision trees generated from the user-provided gating model, to annotate cells as either “pure” or “impure”, with respect to the cell population of interest.