К основному содержанию
скилл Claude Code CX Codex Cursor GitHub Copilot официальный · Anthropic

single-cell-rna-qc — скилл для Claude Code: установка

Проверяет качество single-cell RNA-seq данных, отбирает клетки по MAD-фильтрам и строит графики. Нужен для первичного QC файлов .h5ad и .h5.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add anthropics/knowledge-work-plugins --skill single-cell-rna-qc -a claude-code
Открыть на GitHub

Что делает single-cell-rna-qc

Скилл загружает данные в форматах .h5ad и .h5, рассчитывает глубину считывания, число обнаруженных генов и доли митохондриальных, рибосомных и гемоглобиновых генов. Затем он ищет выбросы по MAD, фильтрует клетки и удаляет гены, обнаруженные в небольшом числе клеток.

Для стандартного сценария используется scripts/qc_analysis.py: скрипт сам определяет формат файла и сохраняет графики до и после фильтрации, пороги и два файла .h5ad в каталоге <input_basename>_qc_results/. Для нестандартного порядка шагов доступны функции из scripts/qc_core.py и scripts/qc_plotting.py.

Нужны anndata, scanpy, scipy, matplotlib, seaborn и numpy. Паттерны генов зависят от вида: для мыши используется mt-, для человека MT-, поэтому перед запуском стоит проверить аннотации и графики QC.

Какие задачи решает

  • проверить качество single-cell RNA-seq данных
  • отфильтровать низкокачественные клетки по MAD
  • обработать файлы .h5ad и .h5
  • сравнить метрики до и после фильтрации
  • сохранить очищенный набор для следующего этапа анализа

Примеры запросов агенту

  • Проведи стандартный QC для `input.h5ad` и сохрани результаты в отдельный каталог.
  • Запусти анализ для `raw_feature_bc_matrix.h5`, используй MAD-фильтрацию и покажи графики до и после.
  • Рассчитай QC-метрики для `input.h5ad`, но пока не фильтруй клетки; используй функции из `scripts/qc_core.py`.

Как установить single-cell-rna-qc

1Через Skills CLI (Vercel)

npx skills add anthropics/knowledge-work-plugins --skill single-cell-rna-qc -a claude-code

2Вручную: положить файлы

~/.claude/skills/single-cell-rna-qc/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/single-cell-rna-qc/

Из того же набора133

Весь набор →
data-visualization официальный anthropics Подбирает подходящие типы графиков под структуру данных и генерирует код на Python с matplotlib, seaborn и plotly. Пригодится при подготовке отчётов. Claude Code CX Codex Cursor +1 13 700установок documentation официальный anthropics Скилл для технического письма: собирает README, справочник по API, ранбук, архитектурный документ или гайд для новичков. Пригодится, когда код есть, а описания к нему нет. Claude Code CX Codex Cursor +1 10 300установок build-dashboard официальный anthropics Генерирует автономный HTML-дашборд с графиками Chart.js, карточками KPI и таблицами. Помогает быстро оформить результаты запроса или сырые данные в один файл для браузера. Claude Code CX Codex Cursor +1 9 100установок memory-management официальный anthropics Скилл раскладывает рабочие сокращения, имена и термины по файлам памяти, чтобы агент учитывал их в запросах. Пригодится для проектов с внутренним словарём и множеством контекстных деталей. Claude Code CX Codex Cursor +1 7 400установок task-management официальный anthropics Ведёт список задач в локальном файле TASKS.md и показывает интерактивный дашборд. Пригодится, чтобы фиксировать дедлайны и поручения прямо во время диалога с агентом. Claude Code CX Codex Cursor +1 7 200установок architecture официальный anthropics Помогает оформить Architecture Decision Record или разобрать чужой дизайн системы: варианты, компромиссы, последствия. Пригодится, когда выбираете между технологиями. Claude Code CX Codex Cursor +1 6 700установок knowledge-synthesis официальный anthropics Скилл объединяет результаты корпоративного поиска из чатов, почты и документов в один связный ответ. Убирает дубли, выставляет уровень доверия и сохраняет ссылки на источники. Claude Code CX Codex Cursor +1 6 400установок testing-strategy официальный anthropics Скилл помогает спроектировать стратегию тестирования и план проверок для проекта. Пригодится, когда нужно выбрать типы тестов и найти пробелы в покрытии. Claude Code CX Codex Cursor +1 6 400установок

Похожие

embedding-strategies Seth Hobson Скилл помогает выбирать модели эмбеддингов, настраивать чанкинг и проверять качество в semantic search и RAG. Claude Code CX Codex Cursor 11 391установок startup-metrics-framework Seth Hobson Скилл помогает выбрать и считать метрики стартапа: CAC, LTV, burn multiple, удержание и рост. Подойдёт для дашбордов, отчётов инвесторам и совета директоров. Claude Code CX Codex Cursor 11 236установок data-quality-frameworks Seth Hobson Скилл помогает проверять качество данных через Great Expectations, dbt-тесты и контракты данных. Подойдёт для пайплайнов, CI/CD и контроля схем. Claude Code CX Codex Cursor 11 230установок managed-airflow-dag-troubleshooting официальный google Разбирает сбои DAG run и task instance в Managed Service for Apache Airflow по логам, состояниям задач и исходному коду DAG. Claude Code Gemini CLI CX Codex 3 500установок python-resource-management Seth Hobson Скилл помогает управлять файлами, соединениями и потоками в Python через контекстные менеджеры и гарантированную очистку. Нужен для кода с ресурсами и исключениями. Claude Code CX Codex Cursor 11 000установок dbt-transformation-patterns Seth Hobson Скилл для Claude, Codex и Cursor, который подсказывает агенту, как раскладывать dbt-модели по слоям, писать тесты и делать инкрементальные витрины. Claude Code CX Codex Cursor 11 000установок xlsx официальный anthropics Работает с табличными файлами: создаёт, читает, правит и преобразует книги. Подходит, когда итогом должен стать файл Excel или другой табличный формат. Claude Code Claude.ai 187 223установок google-agents-cli-observability официальный Google Помогает настроить трассировку и сбор данных о работе ИИ-агентов, включая агентов на ADK. Пригодится, когда нужно разбирать выполнение запросов или наблюдать за агентом после развёртывания. Claude Code CX Codex Cursor +1 509 900установок

Вопросы о single-cell-rna-qc

Как установить `single-cell-rna-qc` в Claude Code?

Выполните npx skills add anthropics/knowledge-work-plugins --skill single-cell-rna-qc -a claude-code, затем повторите npx skills add anthropics/knowledge-work-plugins --skill single-cell-rna-qc -a claude-code. Файл скилла находится по пути ~/.claude/skills/single-cell-rna-qc/SKILL.md.

Что делает `single-cell-rna-qc`?

Он рассчитывает QC-метрики для single-cell RNA-seq, находит выбросы по MAD, фильтрует клетки и гены, а также строит графики до и после обработки.

Какие библиотеки нужны для запуска QC-пайплайна?

Пайплайн использует anndata, scanpy, scipy, matplotlib, seaborn и numpy. На вход принимает .h5ad и .h5.

Исходный текст

SKILL.md · Apache-2.0
---
name: single-cell-rna-qc
description: Performs quality control on single-cell RNA-seq data (.h5ad or .h5 files) using scverse best practices with MAD-based filtering and comprehensive visualizations. Use when users request QC analysis, filtering low-quality cells, assessing data quality, or following scverse/scanpy best practices for single-cell analysis.
---

# Single-Cell RNA-seq Quality Control

Automated QC workflow for single-cell RNA-seq data following scverse best practices.

## When to Use This Skill

Use when users:
- Request quality control or QC on single-cell RNA-seq data
- Want to filter low-quality cells or assess data quality
- Need QC visualizations or metrics
- Ask to follow scverse/scanpy best practices
- Request MAD-based filtering or outlier detection

**Supported input formats:**
- `.h5ad` files (AnnData format from scanpy/Python workflows)
- `.h5` files (10X Genomics Cell Ranger output)

**Default recommendation**: Use Approach 1 (complete pipeline) unless the user has specific custom requirements or explicitly requests non-standard filtering logic.

## Approach 1: Complete QC Pipeline (Recommended for Standard Workflows)

For standard QC following scverse best practices, use the convenience script `scripts/qc_analysis.py`:

```bash
python3 scripts/qc_analysis.py input.h5ad
# or for 10X Genomics .h5 files:
python3 scripts/qc_analysis.py raw_feature_bc_matrix.h5
```

The script automatically detects the file format and loads it appropriately.

**When to use this approach:**
- Standard QC workflow with adjustable thresholds (all cells filtered the same way)
- Batch processing multiple datasets
- Quick exploratory analysis
- User wants the "just works" solution

**Requirements:** anndata, scanpy, scipy, matplotlib, seaborn, numpy

**Parameters:**

Customize filtering thresholds and gene patterns using command-line parameters:
- `--output-dir` - Output directory
- `--mad-counts`, `--mad-genes`, `--mad-mt` - MAD thresholds for counts/genes/MT%
- `--mt-threshold` - Hard mitochondrial % cutoff
- `--min-cells` - Gene filtering threshold
- `--mt-pattern`, `--ribo-pattern`, `--hb-pattern` - Gene name patterns for different species

Use `--help` to see current default values.

**Outputs:**

All files are saved to `<input_basename>_qc_results/` directory by default (or to the directory specified by `--output-dir`):
- `qc_metrics_before_filtering.png` - Pre-filtering visualizations
- `qc_filtering_thresholds.png` - MAD-based threshold overlays
- `qc_metrics_after_filtering.png` - Post-filtering quality metrics
- `<input_basename>_filtered.h5ad` - Clean, filtered dataset ready for downstream analysis
- `<input_basename>_with_qc.h5ad` - Original data with QC annotations preserved

If copying outputs for user access, copy individual files (not the entire directory) so users can preview them directly.

### Workflow Steps

The script performs the following steps:

1. **Calculate QC metrics** - Count depth, gene detection, mitochondrial/ribosomal/hemoglobin content
2. **Apply MAD-based filtering** - Permissive outlier detection using MAD thresholds for counts/genes/MT%
3. **Filter genes** - Remove genes detected in few cells
4. **Generate visualizations** - Comprehensive before/after plots with threshold overlays

## Approach 2: Modular Building Blocks (For Custom Workflows)

For custom analysis workflows or non-standard requirements, use the modular utility functions from `scripts/qc_core.py` and `scripts/qc_plotting.py`:

```python
# Run from scripts/ directory, or add scripts/ to sys.path if needed
import anndata as ad
from qc_core import calculate_qc_metrics, detect_outliers_mad, filter_cells
from qc_plotting import plot_qc_distributions  # Only if visualization needed

adata = ad.read_h5ad('input.h5ad')
calculate_qc_metrics(adata, inplace=True)
# ... custom analysis logic here
```

**When to use this approach:**
- Different workflow needed (skip steps, change order, apply different thresholds to subsets)
- Conditional logic (e.g., filter neurons differently than other cells)
- Partial execution (only metrics/visualization, no filtering)
- Integration with other analysis steps in a larger pipeline
- Custom filtering criteria beyond what command-line params support

**Available utility functions:**

From `qc_core.py` (core QC operations):
- `calculate_qc_metrics(adata, mt_pattern, ribo_pattern, hb_pattern, inplace=True)` - Calculate QC metrics and annotate adata
- `detect_outliers_mad(adata, metric, n_mads, verbose=True)` - MAD-based outlier detection, returns boolean mask
- `apply_hard_threshold(adata, metric, threshold, operator='>', verbose=True)` - Apply hard cutoffs, returns boolean mask
- `filter_cells(adata, mask, inplace=False)` - Apply boolean mask to filter cells
- `filter_genes(adata, min_cells=20, min_counts=None, inplace=True)` - Filter genes by detection
- `print_qc_summary(adata, label='')` - Print summary statistics

From `qc_plotting.py` (visualization):
- `plot_qc_distributions(adata, output_path, title)` - Generate comprehensive QC plots
- `plot_filtering_thresholds(adata, outlier_masks, thresholds, output_path)` - Visualize filtering thresholds
- `plot_qc_after_filtering(adata, output_path)` - Generate post-filtering plots

**Example custom workflows:**

**Example 1: Only calculate metrics and visualize, don't filter yet**
```python
adata = ad.read_h5ad('input.h5ad')
calculate_qc_metrics(adata, inplace=True)
plot_qc_distributions(adata, 'qc_before.png', title='Initial QC')
print_qc_summary(adata, label='Before filtering')
```

**Example 2: Apply only MT% filtering, keep other metrics permissive**
```python
adata = ad.read_h5ad('input.h5ad')
calculate_qc_metrics(adata, inplace=True)

# Only filter high MT% cells
high_mt = apply_hard_threshold(adata, 'pct_counts_mt', 10, operator='>')
adata_filtered = filter_cells(adata, ~high_mt)
adata_filtered.write('filtered.h5ad')
```

**Example 3: Different thresholds for different subsets**
```python
adata = ad.read_h5ad('input.h5ad')
calculate_qc_metrics(adata, inplace=True)

# Apply type-specific QC (assumes cell_type metadata exists)
neurons = adata.obs['cell_type'] == 'neuron'
other_cells = ~neurons

# Neurons tolerate higher MT%, other cells use stricter threshold
neuron_qc = apply_hard_threshold(adata[neurons], 'pct_counts_mt', 15, operator='>')
other_qc = apply_hard_threshold(adata[other_cells], 'pct_counts_mt', 8, operator='>')
```

## Best Practices

1. **Be permissive with filtering** - Default thresholds intentionally retain most cells to avoid losing rare populations
2. **Inspect visualizations** - Always review before/after plots to ensure filtering makes biological sense
3. **Consider dataset-specific factors** - Some tissues naturally have higher mitochondrial content (e.g., neurons, cardiomyocytes)
4. **Check gene annotations** - Mitochondrial gene prefixes vary by species (mt- for mouse, MT- for human)
5. **Iterate if needed** - QC parameters may need adjustment based on the specific experiment or tissue type

## Reference Materials

For detailed QC methodology, parameter rationale, and troubleshooting guidance, see `references/scverse_qc_guidelines.md`. This reference provides:
- Detailed explanations of each QC metric and why it matters
- Rationale for MAD-based thresholds and why they're better than fixed cutoffs
- Guidelines for interpreting QC visualizations (histograms, violin plots, scatter plots)
- Species-specific considerations for gene annotations
- When and how to adjust filtering parameters
- Advanced QC considerations (ambient RNA correction, doublet detection)

Load this reference when users need deeper understanding of the methodology or when troubleshooting QC issues.

## Next Steps After QC

Typical downstream analysis steps:
- Ambient RNA correction (SoupX, CellBender)
- Doublet detection (scDblFinder)
- Normalization (log-normalize, scran)
- Feature selection and dimensionality reduction
- Clustering and cell type annotation

© anthropics · Apache-2.0 · anthropics/knowledge-work-plugins

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой