omicverse-cross-modal-celltype-transfer

Transfer cell-type labels between AnnData objects using weighted KNN.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Transfers cell-type annotations from a reference AnnData to a query AnnData using a shared embedding, enabling cross-modal reuse of curated labels across datasets.

Core Features & Use Cases

  • Weighted KNN transfer core: train with ov.utils.weighted_knn_trainer on the reference embedding and apply with ov.utils.weighted_knn_transfer to the query, obtaining predicted labels and uncertainties.
  • Embedding flexibility: works with any shared embedding in .obsm (e.g., X_glue) and supports label_keys prefix matching to select the target annotation column.
  • Writeback and visualization: write transf_celltype and transf_celltype_unc back to query.obs; optional visualization via embedding() for quick validation.
  • Use cases: label an ATAC query from an RNA reference or convert OmicVerse cross-modal notebooks into reusable annotation workflows.

Quick Start

Train the KNN model on the reference embedding and transfer labels to the query using the trained model, then write back transf_celltype and transf_celltype_unc to the query AnnData.

Frequently Asked Questions about omicverse-cross-modal-celltype-transfer

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

FAQPage Schema
How do I transfer cell-type annotations from an RNA reference to an ATAC query AnnData?

Cross-modal cell-type annotation transfer uses a shared embedding to map labels from a reference AnnData to a query AnnData via weighted KNN. This enables labeling an ATAC query from an RNA reference without manual annotation.

How does weighted KNN transfer work for cross-modal annotation?

Weighted KNN transfer trains a model on the reference embedding and applies it to the query embedding to predict cell-type labels. It calculates prediction uncertainties and writes transf_celltype and transf_celltype_unc back to the query object.

Can I use a custom shared embedding in .obsm for cell-type transfer?

Cell-type transfer works with any shared embedding stored in .obsm, such as X_glue. You can select the target annotation column using label_keys prefix matching to apply the weighted KNN model.

What is needed to convert an OmicVerse notebook into a reusable annotation workflow?

Converting OmicVerse notebooks into reusable workflows requires calling weighted_knn_trainer on the reference embedding and weighted_knn_transfer on the query. The process writes predictions and uncertainties directly to the query AnnData object.

Does cross-modal transfer support visualization for quick validation?

Cross-modal transfer supports optional visualization via the embedding() function after writing transf_celltype and transf_celltype_unc to query.obs. This allows quick validation of transferred cell-type labels and uncertainties.

What are the limitations of using weighted KNN for cross-modal cell-type transfer?

Weighted KNN cross-modal transfer depends on a pre-existing shared embedding between the reference and query AnnData. It cannot transfer labels if the modalities lack an aligned embedding space in .obsm.