---
name: universal-single-cell-annotator
description: A unified interface for annotating single-cell RNA-seq data using Marker Genes, Deep Learning (CellTypist), or LLMs.
license: MIT
metadata:
  author: AI Group
  version: "1.0.0"
  category: Genomics
compatibility:
  - system: Python 3.9+
  - library: scanpy
  - library: celltypist (optional)
allowed-tools:
  - run_shell_command
  - read_file
---

# Universal Single-Cell Annotator

This skill wraps multiple cell type annotation strategies into a single Python class. It allows agents to flexibly choose between rule-based (markers), data-driven (CellTypist), or reasoning-based (LLM) approaches depending on the context.

## When to Use This Skill

*   **Initial Analysis**: When processing raw AnnData objects.
*   **Validation**: When cross-referencing automated labels with known markers.
*   **Discovery**: When identifying rare cell types using LLM reasoning on marker lists.

## Core Capabilities

1.  **Marker-Based Scoring**: Scores cells based on provided gene lists (e.g., "T-cell": ["CD3D", "CD3E"]).
2.  **Deep Learning Reference**: Wraps `celltypist` to transfer labels from massive atlases.
3.  **LLM Reasoning**: Extracts top markers per cluster and constructs prompts for LLM interpretation.

## Workflow

1.  **Load Data**: Ensure data is in `AnnData` format (standard for Scanpy).
2.  **Choose Strategy**:
    *   Use **Markers** if you have a known gene panel.
    *   Use **CellTypist** for broad immune/tissue profiling.
    *   Use **LLM** for novel clusters.
3.  **Annotate**: Run the corresponding method.
4.  **Inspect**: Check `adata.obs` for the new annotation columns.

## Example Usage

**User**: "Annotate this dataset looking for T-cells and B-cells."

**Agent Action**:
```python
from universal_annotator import UniversalAnnotator
import scanpy as sc

adata = sc.read_h5ad('data.h5ad')
annotator = UniversalAnnotator(adata)

markers = {
    'T-cell': ['CD3D', 'CD3E', 'CD8A'],
    'B-cell': ['CD79A', 'MS4A1']
}

annotator.annotate_marker_based(markers)
# Results in adata.obs['predicted_cell_type']
```


---
Source attribution: mdbabumiamssm
Original project: https://github.com/mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills-/blob/ef3c40b235ba23083e67263a921759784f0dd251/Skills/Genomics/Single_Cell/Cell_Type_Annotation/RNA/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: mdbabumiamssm
Original project: https://github.com/mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills-/blob/ef3c40b235ba23083e67263a921759784f0dd251/Skills/Genomics/Single_Cell/Cell_Type_Annotation/RNA/SKILL.md
Attribution basis: Original GitHub package verified against archived instruction text

Fields of work: Data & Analytics, Development & Engineering, Education & Research
Roles: Business Intelligence Analyst, Data Scientist, Market Research Analyst, ML / AI Engineer, Researcher
Specialties: API
Tools: Celltypist, Scanpy
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 4c9172ec2c87583aebc72b4ecb27a09223dc7627b7ff5de10e2456d564a6ada4
Metadata reviewed: 2026-10-27
This metadata supersedes earlier Mega AI Hub catalog attribution. Original instruction and supporting files are preserved.
