omicverse-reference-label-transfer

Transfer cell labels between AnnData objects using weighted kNN models.

13|2|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/Starlitnightly/omicverse-skills --skill omicverse-reference-label-transfer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: omicverse-reference-label-transfer
Source: https://github.com/Starlitnightly/omicverse-skills/tree/main/src/omicverse_skills/skills/reference-label-transfer
Command: npx skills add https://github.com/Starlitnightly/omicverse-skills --skill omicverse-reference-label-transfer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Label-transfer between AnnData objects is essential for applying reference annotations to new single-cell datasets. This skill enables transferring cell-type labels from a well-annotated reference to a query dataset by building a shared integrated space and using a weighted kNN transfer model.

Core Features & Use Cases

  • Supports multiple backends (harmony, scVI, scanorama) to perform label transfer across integrated spaces.
  • Provides a unified interface through AnnotationRef: preprocess, train, and predict, plus a batch_correction helper for preprocessing and validation.
  • Use cases include annotating a new dataset with a reference, benchmarking transfer strategies, and reusing reference annotations in downstream analyses.

Quick Start

Prepare paired query and reference AnnData objects and run the harmony transfer path to generate predictions.

Frequently Asked Questions about omicverse-reference-label-transfer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I transfer cell type annotations from a reference to a query AnnData object?

Label transfer uses a weighted kNN model within a shared integrated space to map reference cell-type annotations onto a query AnnData object. You need paired AnnData objects with shared gene names and an existing reference annotation.

What backends can I use for single-cell label transfer between AnnData objects?

You can use harmony, scVI, or scanorama as integration backends for single-cell label transfer. Each builds a shared space and outputs corresponding prediction and uncertainty keys, such as harmony_prediction and scVI_uncertainty.

How does the weighted kNN transfer model work for annotating new single-cell datasets?

The weighted kNN transfer model builds a shared integrated space between reference and query datasets, then applies weighted nearest neighbors to project reference cell-type labels onto the query data using the AnnotationRef preprocess, train, and predict interfaces.

Do I need shared gene names to transfer labels between single-cell AnnData objects?

Yes, shared gene names between your query and reference AnnData objects are required to perform label transfer. This shared feature space is necessary to build the integrated space for the weighted kNN transfer model.

What is the difference between harmony and scVI prediction outputs in label transfer?

Harmony outputs harmony_prediction and harmony_uncertainty keys, while scVI outputs scVI_prediction and scVI_uncertainty keys. These reflect the distinct shared integrated spaces generated by each backend during the label transfer process.