API#

Import popV as:

import popv

Preprocessing#

For convenience we provide a class that processes query and reference dataset and creates a concatenated dataset. All relevant entries for annotation are stored in the uns object of the returned AnnData.

Import as:

from popv.preprocessing import Process_Query

preprocessing.Process_Query

Processes the query and reference dataset in preparation for the annotation pipeline.

Annotation pipeline#

This is the core functionality of popV that performs annotation and consensus voting. AlgorithmsNT is a named tuple that summarizes all existing cell-type predictors.

Import as:

from popv.annotation import annotate_data

annotation.AlgorithmsNT

Dataclass to store all available algorithms.

annotation.annotate_data

Annotate an AnnData dataset preprocessed by popv.preprocessing.Process_Query by using the annotation pipeline.

Visualization#

visualization.agreement_score_bar_plot

Create bar-plot of prediction scores in query cells after running popv.

visualization.prediction_score_bar_plot

Create bar-plot of prediction scores in query cells after running popv.

visualization.celltype_ratio_bar_plot

Create bar-plot of celltype rations in query as well as reference cells after running popv.

visualization.make_agreement_plots

Create plot of confusion matrix for different popv methods and consensus prediction.

Hub#

Pretrained models are stored on HuggingFace and can be downloaded by using pull_from_huggingface_hub that returns a HubModel class.

hub.HubMetadata

Encapsulates the required metadata for popV hub models.

hub.HubModel

Wrapper for BaseModelClass backed by HuggingFace Hub.

hub.HubModelCardHelper

A helper for creating a ModelCard for popV hub models.

hub.create_criticism_report

Compute and store accuracy metrics for a model.

Algorithms#

algorithms.BaseAlgorithm

algorithms.KNN_SCVI

Class to compute KNN classifier after scVI integration.

algorithms.SCANVI_POPV

Class to compute classifier in scANVI model.

algorithms.KNN_BBKNN

Class to compute KNN classifier after BBKNN integration.

algorithms.KNN_HARMONY

Class to compute KNN classifier after Harmony integration.

algorithms.Support_Vector

Class to compute LinearSVC.

algorithms.Random_Forest

Class to compute Random forest classifier.

algorithms.XGboost

Class to compute XGboost classifier.

algorithms.ONCLASS

Class to compute OnClass cell-type prediction.

algorithms.KNN_SCANORAMA

Class to compute KNN classifier after Scanorama integration.

algorithms.CELLTYPIST

Class to compute Celltypist classifier.