[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-aws-labs-scrna-seq-pipeline":3,"mdc-xqx0ut-key":49,"related-repo-aws-labs-scrna-seq-pipeline":1939,"related-org-aws-labs-scrna-seq-pipeline":2035},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":26,"repoUrl":27,"updatedAt":28,"license":29,"forks":30,"topics":31,"repo":44,"sourceUrl":47,"mdContent":48},"scrna-seq-pipeline","analyze single-cell RNA-seq data","Scanpy-based single-cell RNA-seq analysis pipeline covering loading (10X, h5ad), QC, normalization, HVG selection, PCA\u002FUMAP, Leiden clustering, differential expression, and batch correction (Harmony, scVI). Use when the user mentions single-cell, scRNA-seq, Scanpy, AnnData, UMAP, clustering, 10X, h5ad, leiden, highly variable genes, Harmony, scVI, cluster cells, find marker genes, filter low-quality cells, gene expression matrix, doublet removal, normalize counts, dimensionality reduction, cell clustering, QC single-cell, filtered_feature_bc_matrix, cellranger output, 10X h5, scrublet, cell ranger, count matrix, find cell types, batch effect, integration, neighborhood graph, or differential expression genes.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"aws-labs","AWS Labs","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Faws-labs.png","awslabs",[13,17,20,23],{"name":14,"slug":15,"type":16},"Data Analysis","data-analysis","tag",{"name":18,"slug":19,"type":16},"Life Sciences","life-sciences",{"name":21,"slug":22,"type":16},"Bioinformatics","bioinformatics",{"name":24,"slug":25,"type":16},"RNA-seq","rna-seq",4,"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fhcls-agent-skills","2026-07-12T08:37:47.38532",null,0,[32,33,34,35,36,37,38,39,40,19,41,42,43],"agent-skills","agentcore","ai-agents","amazon-quick-desktop","claims-processing","drug-discovery","genomics","healthcare-ai","kiro","medical-imaging","risk-adjustment","strands-agents",{"repoUrl":27,"stars":26,"forks":30,"topics":45,"description":46},[32,33,34,35,36,37,38,39,40,19,41,42,43],"Agent skills for healthcare and life sciences: genomics, imaging, claims, drug discovery, and more. Works with Amazon Quick, Kiro, Amazon AgentCore, AWS Strands SDK, Claude Code, Codex, and any Agent Skills-compatible platform.","https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fhcls-agent-skills\u002Ftree\u002FHEAD\u002Fskills\u002Fscrna-seq-pipeline","---\nname: scrna-seq-pipeline\ndescription: Scanpy-based single-cell RNA-seq analysis pipeline covering loading (10X, h5ad), QC, normalization, HVG selection, PCA\u002FUMAP, Leiden clustering, differential expression, and batch correction (Harmony, scVI). Use when the user mentions single-cell, scRNA-seq, Scanpy, AnnData, UMAP, clustering, 10X, h5ad, leiden, highly variable genes, Harmony, scVI, cluster cells, find marker genes, filter low-quality cells, gene expression matrix, doublet removal, normalize counts, dimensionality reduction, cell clustering, QC single-cell, filtered_feature_bc_matrix, cellranger output, 10X h5, scrublet, cell ranger, count matrix, find cell types, batch effect, integration, neighborhood graph, or differential expression genes.\nusage: Invoke when processing scRNA-seq data with Scanpy, including QC, normalization, clustering, DE, or batch correction.\nversion: 1.0.0\nvalidated_against:\n  date: 2025-01-15\n  packages: {scanpy: \"1.10\", anndata: \"0.10\", scvi-tools: \"1.1\"}\ntags: [skill, category:pipeline, single-cell, scanpy, scrna-seq, hcls]\n---\n\n# scRNA-seq Pipeline (Scanpy)\n\n## Overview\n\nThis skill produces a reproducible scRNA-seq analysis in Python using Scanpy and AnnData. It covers the standard workflow: load counts → QC filter → normalize\u002Flog → HVG → scale\u002FPCA → neighbors\u002FUMAP → Leiden → differential expression, plus batch correction with Harmony or scVI. Default parameters follow the Scanpy PBMC3k tutorial conventions and are safe starting points for most 10X Genomics datasets.\n\nOutput is a single `.h5ad` file with all intermediate embeddings, cluster labels, and DE results stored on the `AnnData` object.\n\n## Usage\n\nInstall dependencies:\n\n```bash\npip install \"scanpy>=1.10\" anndata leidenalg python-igraph harmonypy scvi-tools\n```\n\nRun the pipeline end-to-end:\n\n```python\nimport scanpy as sc\nimport scanpy.external as sce\n\nsc.settings.verbosity = 2\nsc.settings.set_figure_params(dpi=100, facecolor=\"white\")\n\n# 1. Load\nadata = sc.read_10x_h5(\"filtered_feature_bc_matrix.h5\")\n# Alternatives:\n# adata = sc.read_10x_mtx(\"filtered_feature_bc_matrix\u002F\", var_names=\"gene_symbols\", cache=True)\n# adata = sc.read_h5ad(\"input.h5ad\")\nadata.var_names_make_unique()\n\n# 2. QC\nadata.var[\"mt\"] = adata.var_names.str.startswith(\"MT-\")\nsc.pp.calculate_qc_metrics(adata, qc_vars=[\"mt\"], percent_top=None, log1p=False, inplace=True)\nsc.pp.filter_cells(adata, min_genes=200)\nsc.pp.filter_genes(adata, min_cells=3)\nadata = adata[adata.obs.n_genes_by_counts \u003C 5000, :]\nadata = adata[adata.obs.pct_counts_mt \u003C 20, :].copy()\n\n# 3. Normalize + HVG\nsc.pp.normalize_total(adata, target_sum=1e4)\nsc.pp.log1p(adata)\nadata.raw = adata  # freeze log-normalized full gene set BEFORE HVG subset\nsc.pp.highly_variable_genes(adata, n_top_genes=2000, flavor=\"seurat\")\nadata = adata[:, adata.var.highly_variable].copy()\n\n# 4. Scale + PCA + neighbors + UMAP + Leiden\nsc.pp.scale(adata, max_value=10)\nsc.tl.pca(adata, n_comps=50, svd_solver=\"arpack\")\nsc.pp.neighbors(adata, n_neighbors=15, n_pcs=30)\nsc.tl.umap(adata)\nsc.tl.leiden(adata, resolution=0.5)\n\n# 5. Differential expression per cluster\nsc.tl.rank_genes_groups(adata, groupby=\"leiden\", method=\"wilcoxon\")\n\n# 6. Save\nadata.write(\"result.h5ad\", compression=\"gzip\")\n```\n\n### Batch correction — Harmony\n\n```python\n# Assumes adata.obs[\"batch\"] exists and PCA is already computed.\nsce.pp.harmony_integrate(adata, key=\"batch\")  # writes adata.obsm[\"X_pca_harmony\"]\nsc.pp.neighbors(adata, n_neighbors=15, n_pcs=30, use_rep=\"X_pca_harmony\")\nsc.tl.umap(adata)\nsc.tl.leiden(adata, resolution=0.5)\n```\n\n### Batch correction — scVI\n\nscVI requires **raw counts**. Run it before normalization, or keep a raw-count layer.\n\n```python\nimport scvi\n\n# adata_raw holds unnormalized integer counts; adata.obs[\"batch\"] is the batch key.\nscvi.model.SCVI.setup_anndata(adata_raw, batch_key=\"batch\")\nmodel = scvi.model.SCVI(adata_raw, n_latent=30)\nmodel.train(max_epochs=400, early_stopping=True)\nadata.obsm[\"X_scVI\"] = model.get_latent_representation()\n\nsc.pp.neighbors(adata, n_neighbors=15, use_rep=\"X_scVI\")\nsc.tl.umap(adata)\nsc.tl.leiden(adata, resolution=0.5)\n```\n\n\n## Response Format\n\n- Lead with the command or code the user needs — explain after\n- Structure as: confirm inputs → working code → key parameters explained → gotchas\n- One complete working example per task; do not show every alternative\n- Keep code comments minimal and functional (what, not why-it-exists)\n- Target: 50-100 lines of code with brief surrounding explanation\n\n## Core Concepts\n\n- **AnnData layout.** `adata.X` is the current expression matrix (cells × genes). `adata.obs` holds per-cell metadata (QC metrics, cluster labels, batch). `adata.var` holds per-gene metadata (HVG flags, `mt`). Embeddings live in `adata.obsm` (`X_pca`, `X_umap`, `X_scVI`). Neighbor graph and DE results live in `adata.uns`.\n- **`.raw` snapshot.** `adata.raw = adata` stores the full log-normalized matrix before HVG subsetting. Downstream plotting functions (`sc.pl.umap(..., color=\"GENE\")`, `sc.pl.rank_genes_groups`) read from `.raw` so you can visualize any gene even after restricting `adata` to HVGs.\n- **QC thresholds are dataset-dependent.** `n_genes ∈ [200, 5000]` and `pct_mt \u003C 20` are reasonable defaults for human 10X PBMC-like data. Inspect distributions (`sc.pl.violin`) before committing. Use `MT-` for human and `mt-` for mouse.\n- **HVG flavor matters.** Use `flavor=\"seurat\"` on **log-normalized** data (default). Use `flavor=\"seurat_v3\"` on **raw counts** — it expects integer counts and will error or mislead on log data.\n- **Neighbors parameters.** `n_neighbors` controls local\u002Fglobal structure (10–50; larger = smoother UMAP). `n_pcs` should capture the elbow in `sc.pl.pca_variance_ratio` (typically 20–50). Leiden `resolution` controls cluster granularity (0.2–1.5; higher = more clusters).\n- **Batch correction choice.** Harmony is fast, operates on PCA, and works well for mild-to-moderate batch effects. scVI is a deep generative model, needs raw counts and GPU for speed, and handles stronger technical variation and multi-modal designs.\n\n## Quick Reference\n\n### Loading\n\n| Input | Call |\n| --- | --- |\n| 10X HDF5 | `sc.read_10x_h5(\"filtered_feature_bc_matrix.h5\")` |\n| 10X MTX dir | `sc.read_10x_mtx(\"path\u002F\", var_names=\"gene_symbols\", cache=True)` |\n| Existing AnnData | `sc.read_h5ad(\"input.h5ad\")` |\n| Always after load | `adata.var_names_make_unique()` |\n\n### Key parameter ranges\n\n| Parameter | Default | Typical range | Notes |\n| --- | --- | --- | --- |\n| `filter_cells(min_genes=)` | 200 | 100–500 | Drop empty\u002Flow-quality droplets |\n| `filter_genes(min_cells=)` | 3 | 3–10 | Drop rarely-expressed genes |\n| `n_genes_by_counts \u003C` | 5000 | 2500–8000 | Upper bound flags doublets |\n| `pct_counts_mt \u003C` | 20 | 5–25 | Human tissue dependent |\n| `normalize_total(target_sum=)` | `1e4` | `1e4` | CP10k; standard |\n| `n_top_genes` (HVG) | 2000 | 1000–5000 | More HVGs → more signal + noise |\n| `scale(max_value=)` | 10 | 10 | Clip extreme z-scores |\n| `pca(n_comps=)` | 50 | 30–100 | Pick elbow for downstream `n_pcs` |\n| `neighbors(n_neighbors=)` | 15 | 10–50 | Larger → smoother manifold |\n| `neighbors(n_pcs=)` | 30 | 20–50 | ≤ `n_comps` |\n| `leiden(resolution=)` | 0.5 | 0.2–1.5 | Higher → more clusters |\n\n### DE & inspection\n\n```python\nsc.tl.rank_genes_groups(adata, groupby=\"leiden\", method=\"wilcoxon\")\nsc.pl.rank_genes_groups(adata, n_genes=25, sharey=False)\n\n# Top-N markers per cluster as a DataFrame\nimport pandas as pd\nresult = adata.uns[\"rank_genes_groups\"]\ngroups = result[\"names\"].dtype.names\nmarkers = pd.DataFrame({g: result[\"names\"][g][:20] for g in groups})\n```\n\n### Saving \u002F loading\n\n```python\nadata.write(\"result.h5ad\", compression=\"gzip\")\nadata = sc.read_h5ad(\"result.h5ad\")\n```\n\n## Common Mistakes\n\n- **Wrong:** Subsetting to HVGs before saving `adata.raw = adata`\n  **Right:** Always set `.raw` on the log-normalized full matrix before `adata = adata[:, adata.var.highly_variable].copy()`\n  **Why:** Without `.raw`, you lose the ability to plot or score non-HVG genes in downstream analysis\n\n- **Wrong:** Using `flavor=\"seurat_v3\"` on log-normalized data\n  **Right:** Match HVG flavor to data state: `seurat_v3` requires raw integer counts; `seurat` (default) requires log-normalized data\n  **Why:** Wrong flavor produces nonsense HVG rankings or errors, corrupting all downstream steps\n\n- **Wrong:** Skipping `adata.var_names_make_unique()` after loading 10X data\n  **Right:** Call `adata.var_names_make_unique()` immediately after loading\n  **Why:** Duplicated gene symbols cause silent misbehavior in indexing, HVG selection, and DE analysis\n\n- **Wrong:** Running scVI on normalized\u002Flog-transformed data\n  **Right:** Feed scVI the raw-count AnnData and set `batch_key` via `setup_anndata`\n  **Why:** scVI models counts directly; normalized input violates its distributional assumptions and produces incorrect latent spaces\n\n- **Wrong:** Using `MT-` prefix for mouse mitochondrial genes (or `mt-` for human)\n  **Right:** Use `MT-` for human genes and `mt-` for mouse genes\n  **Why:** Wrong prefix makes `pct_counts_mt` always zero, rendering the QC filter a no-op\n\n- **Wrong:** Boolean-slicing AnnData without calling `.copy()`\n  **Right:** Always use `.copy()` after filtering: `adata = adata[mask, :].copy()`\n  **Why:** Without `.copy()`, the result is a view; subsequent in-place operations will warn or fail\n\n## References\n\n- Scanpy: Wolf et al. Genome Biol 2018, https:\u002F\u002Fdoi.org\u002F10.1186\u002Fs13059-017-1382-0\n- Scanpy tutorials: https:\u002F\u002Fscanpy.readthedocs.io\u002Fen\u002Fstable\u002Ftutorials.html\n- scVI: Gayoso et al. Nat Biotechnol 2022, https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41587-021-01206-w\n- Harmony: Korsunsky et al. Nat Methods 2019, https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41592-019-0619-0\n",{"data":50,"body":66},{"name":4,"description":6,"usage":51,"version":52,"validated_against":53,"tags":59},"Invoke when processing scRNA-seq data with Scanpy, including QC, normalization, clustering, DE, or batch correction.","1.0.0",{"date":54,"packages":55},"2025-01-15",{"scanpy":56,"anndata":57,"scvi-tools":58},"1.10","0.10","1.1",[60,61,62,63,64,65],"skill","category:pipeline","single-cell","scanpy","scrna-seq","hcls",{"type":67,"children":68},"root",[69,78,85,91,113,119,124,194,199,561,568,613,619,632,723,729,759,765,1040,1046,1052,1148,1154,1502,1508,1577,1583,1605,1611,1878,1884,1933],{"type":70,"tag":71,"props":72,"children":74},"element","h1",{"id":73},"scrna-seq-pipeline-scanpy",[75],{"type":76,"value":77},"text","scRNA-seq Pipeline (Scanpy)",{"type":70,"tag":79,"props":80,"children":82},"h2",{"id":81},"overview",[83],{"type":76,"value":84},"Overview",{"type":70,"tag":86,"props":87,"children":88},"p",{},[89],{"type":76,"value":90},"This skill produces a reproducible scRNA-seq analysis in Python using Scanpy and AnnData. It covers the standard workflow: load counts → QC filter → normalize\u002Flog → HVG → scale\u002FPCA → neighbors\u002FUMAP → Leiden → differential expression, plus batch correction with Harmony or scVI. Default parameters follow the Scanpy PBMC3k tutorial conventions and are safe starting points for most 10X Genomics datasets.",{"type":70,"tag":86,"props":92,"children":93},{},[94,96,103,105,111],{"type":76,"value":95},"Output is a single ",{"type":70,"tag":97,"props":98,"children":100},"code",{"className":99},[],[101],{"type":76,"value":102},".h5ad",{"type":76,"value":104}," file with all intermediate embeddings, cluster labels, and DE results stored on the ",{"type":70,"tag":97,"props":106,"children":108},{"className":107},[],[109],{"type":76,"value":110},"AnnData",{"type":76,"value":112}," object.",{"type":70,"tag":79,"props":114,"children":116},{"id":115},"usage",[117],{"type":76,"value":118},"Usage",{"type":70,"tag":86,"props":120,"children":121},{},[122],{"type":76,"value":123},"Install dependencies:",{"type":70,"tag":125,"props":126,"children":131},"pre",{"className":127,"code":128,"language":129,"meta":130,"style":130},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pip install \"scanpy>=1.10\" anndata leidenalg python-igraph harmonypy scvi-tools\n","bash","",[132],{"type":70,"tag":97,"props":133,"children":134},{"__ignoreMap":130},[135],{"type":70,"tag":136,"props":137,"children":140},"span",{"class":138,"line":139},"line",1,[141,147,153,159,164,169,174,179,184,189],{"type":70,"tag":136,"props":142,"children":144},{"style":143},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[145],{"type":76,"value":146},"pip",{"type":70,"tag":136,"props":148,"children":150},{"style":149},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[151],{"type":76,"value":152}," install",{"type":70,"tag":136,"props":154,"children":156},{"style":155},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[157],{"type":76,"value":158}," \"",{"type":70,"tag":136,"props":160,"children":161},{"style":149},[162],{"type":76,"value":163},"scanpy>=1.10",{"type":70,"tag":136,"props":165,"children":166},{"style":155},[167],{"type":76,"value":168},"\"",{"type":70,"tag":136,"props":170,"children":171},{"style":149},[172],{"type":76,"value":173}," anndata",{"type":70,"tag":136,"props":175,"children":176},{"style":149},[177],{"type":76,"value":178}," leidenalg",{"type":70,"tag":136,"props":180,"children":181},{"style":149},[182],{"type":76,"value":183}," python-igraph",{"type":70,"tag":136,"props":185,"children":186},{"style":149},[187],{"type":76,"value":188}," harmonypy",{"type":70,"tag":136,"props":190,"children":191},{"style":149},[192],{"type":76,"value":193}," scvi-tools\n",{"type":70,"tag":86,"props":195,"children":196},{},[197],{"type":76,"value":198},"Run the pipeline end-to-end:",{"type":70,"tag":125,"props":200,"children":204},{"className":201,"code":202,"language":203,"meta":130,"style":130},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import scanpy as sc\nimport scanpy.external as sce\n\nsc.settings.verbosity = 2\nsc.settings.set_figure_params(dpi=100, facecolor=\"white\")\n\n# 1. Load\nadata = sc.read_10x_h5(\"filtered_feature_bc_matrix.h5\")\n# Alternatives:\n# adata = sc.read_10x_mtx(\"filtered_feature_bc_matrix\u002F\", var_names=\"gene_symbols\", cache=True)\n# adata = sc.read_h5ad(\"input.h5ad\")\nadata.var_names_make_unique()\n\n# 2. QC\nadata.var[\"mt\"] = adata.var_names.str.startswith(\"MT-\")\nsc.pp.calculate_qc_metrics(adata, qc_vars=[\"mt\"], percent_top=None, log1p=False, inplace=True)\nsc.pp.filter_cells(adata, min_genes=200)\nsc.pp.filter_genes(adata, min_cells=3)\nadata = adata[adata.obs.n_genes_by_counts \u003C 5000, :]\nadata = adata[adata.obs.pct_counts_mt \u003C 20, :].copy()\n\n# 3. Normalize + HVG\nsc.pp.normalize_total(adata, target_sum=1e4)\nsc.pp.log1p(adata)\nadata.raw = adata  # freeze log-normalized full gene set BEFORE HVG subset\nsc.pp.highly_variable_genes(adata, n_top_genes=2000, flavor=\"seurat\")\nadata = adata[:, adata.var.highly_variable].copy()\n\n# 4. Scale + PCA + neighbors + UMAP + Leiden\nsc.pp.scale(adata, max_value=10)\nsc.tl.pca(adata, n_comps=50, svd_solver=\"arpack\")\nsc.pp.neighbors(adata, n_neighbors=15, n_pcs=30)\nsc.tl.umap(adata)\nsc.tl.leiden(adata, resolution=0.5)\n\n# 5. Differential expression per cluster\nsc.tl.rank_genes_groups(adata, groupby=\"leiden\", method=\"wilcoxon\")\n\n# 6. Save\nadata.write(\"result.h5ad\", compression=\"gzip\")\n","python",[205],{"type":70,"tag":97,"props":206,"children":207},{"__ignoreMap":130},[208,216,225,235,243,252,260,269,278,287,296,305,314,322,331,340,349,358,367,376,385,393,402,411,420,429,438,447,455,464,473,482,491,500,509,517,526,535,543,552],{"type":70,"tag":136,"props":209,"children":210},{"class":138,"line":139},[211],{"type":70,"tag":136,"props":212,"children":213},{},[214],{"type":76,"value":215},"import scanpy as sc\n",{"type":70,"tag":136,"props":217,"children":219},{"class":138,"line":218},2,[220],{"type":70,"tag":136,"props":221,"children":222},{},[223],{"type":76,"value":224},"import scanpy.external as sce\n",{"type":70,"tag":136,"props":226,"children":228},{"class":138,"line":227},3,[229],{"type":70,"tag":136,"props":230,"children":232},{"emptyLinePlaceholder":231},true,[233],{"type":76,"value":234},"\n",{"type":70,"tag":136,"props":236,"children":237},{"class":138,"line":26},[238],{"type":70,"tag":136,"props":239,"children":240},{},[241],{"type":76,"value":242},"sc.settings.verbosity = 2\n",{"type":70,"tag":136,"props":244,"children":246},{"class":138,"line":245},5,[247],{"type":70,"tag":136,"props":248,"children":249},{},[250],{"type":76,"value":251},"sc.settings.set_figure_params(dpi=100, facecolor=\"white\")\n",{"type":70,"tag":136,"props":253,"children":255},{"class":138,"line":254},6,[256],{"type":70,"tag":136,"props":257,"children":258},{"emptyLinePlaceholder":231},[259],{"type":76,"value":234},{"type":70,"tag":136,"props":261,"children":263},{"class":138,"line":262},7,[264],{"type":70,"tag":136,"props":265,"children":266},{},[267],{"type":76,"value":268},"# 1. Load\n",{"type":70,"tag":136,"props":270,"children":272},{"class":138,"line":271},8,[273],{"type":70,"tag":136,"props":274,"children":275},{},[276],{"type":76,"value":277},"adata = sc.read_10x_h5(\"filtered_feature_bc_matrix.h5\")\n",{"type":70,"tag":136,"props":279,"children":281},{"class":138,"line":280},9,[282],{"type":70,"tag":136,"props":283,"children":284},{},[285],{"type":76,"value":286},"# Alternatives:\n",{"type":70,"tag":136,"props":288,"children":290},{"class":138,"line":289},10,[291],{"type":70,"tag":136,"props":292,"children":293},{},[294],{"type":76,"value":295},"# adata = sc.read_10x_mtx(\"filtered_feature_bc_matrix\u002F\", var_names=\"gene_symbols\", cache=True)\n",{"type":70,"tag":136,"props":297,"children":299},{"class":138,"line":298},11,[300],{"type":70,"tag":136,"props":301,"children":302},{},[303],{"type":76,"value":304},"# adata = sc.read_h5ad(\"input.h5ad\")\n",{"type":70,"tag":136,"props":306,"children":308},{"class":138,"line":307},12,[309],{"type":70,"tag":136,"props":310,"children":311},{},[312],{"type":76,"value":313},"adata.var_names_make_unique()\n",{"type":70,"tag":136,"props":315,"children":317},{"class":138,"line":316},13,[318],{"type":70,"tag":136,"props":319,"children":320},{"emptyLinePlaceholder":231},[321],{"type":76,"value":234},{"type":70,"tag":136,"props":323,"children":325},{"class":138,"line":324},14,[326],{"type":70,"tag":136,"props":327,"children":328},{},[329],{"type":76,"value":330},"# 2. QC\n",{"type":70,"tag":136,"props":332,"children":334},{"class":138,"line":333},15,[335],{"type":70,"tag":136,"props":336,"children":337},{},[338],{"type":76,"value":339},"adata.var[\"mt\"] = adata.var_names.str.startswith(\"MT-\")\n",{"type":70,"tag":136,"props":341,"children":343},{"class":138,"line":342},16,[344],{"type":70,"tag":136,"props":345,"children":346},{},[347],{"type":76,"value":348},"sc.pp.calculate_qc_metrics(adata, qc_vars=[\"mt\"], percent_top=None, log1p=False, inplace=True)\n",{"type":70,"tag":136,"props":350,"children":352},{"class":138,"line":351},17,[353],{"type":70,"tag":136,"props":354,"children":355},{},[356],{"type":76,"value":357},"sc.pp.filter_cells(adata, min_genes=200)\n",{"type":70,"tag":136,"props":359,"children":361},{"class":138,"line":360},18,[362],{"type":70,"tag":136,"props":363,"children":364},{},[365],{"type":76,"value":366},"sc.pp.filter_genes(adata, min_cells=3)\n",{"type":70,"tag":136,"props":368,"children":370},{"class":138,"line":369},19,[371],{"type":70,"tag":136,"props":372,"children":373},{},[374],{"type":76,"value":375},"adata = adata[adata.obs.n_genes_by_counts \u003C 5000, :]\n",{"type":70,"tag":136,"props":377,"children":379},{"class":138,"line":378},20,[380],{"type":70,"tag":136,"props":381,"children":382},{},[383],{"type":76,"value":384},"adata = adata[adata.obs.pct_counts_mt \u003C 20, :].copy()\n",{"type":70,"tag":136,"props":386,"children":388},{"class":138,"line":387},21,[389],{"type":70,"tag":136,"props":390,"children":391},{"emptyLinePlaceholder":231},[392],{"type":76,"value":234},{"type":70,"tag":136,"props":394,"children":396},{"class":138,"line":395},22,[397],{"type":70,"tag":136,"props":398,"children":399},{},[400],{"type":76,"value":401},"# 3. Normalize + HVG\n",{"type":70,"tag":136,"props":403,"children":405},{"class":138,"line":404},23,[406],{"type":70,"tag":136,"props":407,"children":408},{},[409],{"type":76,"value":410},"sc.pp.normalize_total(adata, target_sum=1e4)\n",{"type":70,"tag":136,"props":412,"children":414},{"class":138,"line":413},24,[415],{"type":70,"tag":136,"props":416,"children":417},{},[418],{"type":76,"value":419},"sc.pp.log1p(adata)\n",{"type":70,"tag":136,"props":421,"children":423},{"class":138,"line":422},25,[424],{"type":70,"tag":136,"props":425,"children":426},{},[427],{"type":76,"value":428},"adata.raw = adata  # freeze log-normalized full gene set BEFORE HVG subset\n",{"type":70,"tag":136,"props":430,"children":432},{"class":138,"line":431},26,[433],{"type":70,"tag":136,"props":434,"children":435},{},[436],{"type":76,"value":437},"sc.pp.highly_variable_genes(adata, n_top_genes=2000, flavor=\"seurat\")\n",{"type":70,"tag":136,"props":439,"children":441},{"class":138,"line":440},27,[442],{"type":70,"tag":136,"props":443,"children":444},{},[445],{"type":76,"value":446},"adata = adata[:, adata.var.highly_variable].copy()\n",{"type":70,"tag":136,"props":448,"children":450},{"class":138,"line":449},28,[451],{"type":70,"tag":136,"props":452,"children":453},{"emptyLinePlaceholder":231},[454],{"type":76,"value":234},{"type":70,"tag":136,"props":456,"children":458},{"class":138,"line":457},29,[459],{"type":70,"tag":136,"props":460,"children":461},{},[462],{"type":76,"value":463},"# 4. Scale + PCA + neighbors + UMAP + Leiden\n",{"type":70,"tag":136,"props":465,"children":467},{"class":138,"line":466},30,[468],{"type":70,"tag":136,"props":469,"children":470},{},[471],{"type":76,"value":472},"sc.pp.scale(adata, max_value=10)\n",{"type":70,"tag":136,"props":474,"children":476},{"class":138,"line":475},31,[477],{"type":70,"tag":136,"props":478,"children":479},{},[480],{"type":76,"value":481},"sc.tl.pca(adata, n_comps=50, svd_solver=\"arpack\")\n",{"type":70,"tag":136,"props":483,"children":485},{"class":138,"line":484},32,[486],{"type":70,"tag":136,"props":487,"children":488},{},[489],{"type":76,"value":490},"sc.pp.neighbors(adata, n_neighbors=15, n_pcs=30)\n",{"type":70,"tag":136,"props":492,"children":494},{"class":138,"line":493},33,[495],{"type":70,"tag":136,"props":496,"children":497},{},[498],{"type":76,"value":499},"sc.tl.umap(adata)\n",{"type":70,"tag":136,"props":501,"children":503},{"class":138,"line":502},34,[504],{"type":70,"tag":136,"props":505,"children":506},{},[507],{"type":76,"value":508},"sc.tl.leiden(adata, resolution=0.5)\n",{"type":70,"tag":136,"props":510,"children":512},{"class":138,"line":511},35,[513],{"type":70,"tag":136,"props":514,"children":515},{"emptyLinePlaceholder":231},[516],{"type":76,"value":234},{"type":70,"tag":136,"props":518,"children":520},{"class":138,"line":519},36,[521],{"type":70,"tag":136,"props":522,"children":523},{},[524],{"type":76,"value":525},"# 5. Differential expression per cluster\n",{"type":70,"tag":136,"props":527,"children":529},{"class":138,"line":528},37,[530],{"type":70,"tag":136,"props":531,"children":532},{},[533],{"type":76,"value":534},"sc.tl.rank_genes_groups(adata, groupby=\"leiden\", method=\"wilcoxon\")\n",{"type":70,"tag":136,"props":536,"children":538},{"class":138,"line":537},38,[539],{"type":70,"tag":136,"props":540,"children":541},{"emptyLinePlaceholder":231},[542],{"type":76,"value":234},{"type":70,"tag":136,"props":544,"children":546},{"class":138,"line":545},39,[547],{"type":70,"tag":136,"props":548,"children":549},{},[550],{"type":76,"value":551},"# 6. Save\n",{"type":70,"tag":136,"props":553,"children":555},{"class":138,"line":554},40,[556],{"type":70,"tag":136,"props":557,"children":558},{},[559],{"type":76,"value":560},"adata.write(\"result.h5ad\", compression=\"gzip\")\n",{"type":70,"tag":562,"props":563,"children":565},"h3",{"id":564},"batch-correction-harmony",[566],{"type":76,"value":567},"Batch correction — Harmony",{"type":70,"tag":125,"props":569,"children":571},{"className":201,"code":570,"language":203,"meta":130,"style":130},"# Assumes adata.obs[\"batch\"] exists and PCA is already computed.\nsce.pp.harmony_integrate(adata, key=\"batch\")  # writes adata.obsm[\"X_pca_harmony\"]\nsc.pp.neighbors(adata, n_neighbors=15, n_pcs=30, use_rep=\"X_pca_harmony\")\nsc.tl.umap(adata)\nsc.tl.leiden(adata, resolution=0.5)\n",[572],{"type":70,"tag":97,"props":573,"children":574},{"__ignoreMap":130},[575,583,591,599,606],{"type":70,"tag":136,"props":576,"children":577},{"class":138,"line":139},[578],{"type":70,"tag":136,"props":579,"children":580},{},[581],{"type":76,"value":582},"# Assumes adata.obs[\"batch\"] exists and PCA is already computed.\n",{"type":70,"tag":136,"props":584,"children":585},{"class":138,"line":218},[586],{"type":70,"tag":136,"props":587,"children":588},{},[589],{"type":76,"value":590},"sce.pp.harmony_integrate(adata, key=\"batch\")  # writes adata.obsm[\"X_pca_harmony\"]\n",{"type":70,"tag":136,"props":592,"children":593},{"class":138,"line":227},[594],{"type":70,"tag":136,"props":595,"children":596},{},[597],{"type":76,"value":598},"sc.pp.neighbors(adata, n_neighbors=15, n_pcs=30, use_rep=\"X_pca_harmony\")\n",{"type":70,"tag":136,"props":600,"children":601},{"class":138,"line":26},[602],{"type":70,"tag":136,"props":603,"children":604},{},[605],{"type":76,"value":499},{"type":70,"tag":136,"props":607,"children":608},{"class":138,"line":245},[609],{"type":70,"tag":136,"props":610,"children":611},{},[612],{"type":76,"value":508},{"type":70,"tag":562,"props":614,"children":616},{"id":615},"batch-correction-scvi",[617],{"type":76,"value":618},"Batch correction — scVI",{"type":70,"tag":86,"props":620,"children":621},{},[622,624,630],{"type":76,"value":623},"scVI requires ",{"type":70,"tag":625,"props":626,"children":627},"strong",{},[628],{"type":76,"value":629},"raw counts",{"type":76,"value":631},". Run it before normalization, or keep a raw-count layer.",{"type":70,"tag":125,"props":633,"children":635},{"className":201,"code":634,"language":203,"meta":130,"style":130},"import scvi\n\n# adata_raw holds unnormalized integer counts; adata.obs[\"batch\"] is the batch key.\nscvi.model.SCVI.setup_anndata(adata_raw, batch_key=\"batch\")\nmodel = scvi.model.SCVI(adata_raw, n_latent=30)\nmodel.train(max_epochs=400, early_stopping=True)\nadata.obsm[\"X_scVI\"] = model.get_latent_representation()\n\nsc.pp.neighbors(adata, n_neighbors=15, use_rep=\"X_scVI\")\nsc.tl.umap(adata)\nsc.tl.leiden(adata, resolution=0.5)\n",[636],{"type":70,"tag":97,"props":637,"children":638},{"__ignoreMap":130},[639,647,654,662,670,678,686,694,701,709,716],{"type":70,"tag":136,"props":640,"children":641},{"class":138,"line":139},[642],{"type":70,"tag":136,"props":643,"children":644},{},[645],{"type":76,"value":646},"import scvi\n",{"type":70,"tag":136,"props":648,"children":649},{"class":138,"line":218},[650],{"type":70,"tag":136,"props":651,"children":652},{"emptyLinePlaceholder":231},[653],{"type":76,"value":234},{"type":70,"tag":136,"props":655,"children":656},{"class":138,"line":227},[657],{"type":70,"tag":136,"props":658,"children":659},{},[660],{"type":76,"value":661},"# adata_raw holds unnormalized integer counts; adata.obs[\"batch\"] is the batch key.\n",{"type":70,"tag":136,"props":663,"children":664},{"class":138,"line":26},[665],{"type":70,"tag":136,"props":666,"children":667},{},[668],{"type":76,"value":669},"scvi.model.SCVI.setup_anndata(adata_raw, batch_key=\"batch\")\n",{"type":70,"tag":136,"props":671,"children":672},{"class":138,"line":245},[673],{"type":70,"tag":136,"props":674,"children":675},{},[676],{"type":76,"value":677},"model = scvi.model.SCVI(adata_raw, n_latent=30)\n",{"type":70,"tag":136,"props":679,"children":680},{"class":138,"line":254},[681],{"type":70,"tag":136,"props":682,"children":683},{},[684],{"type":76,"value":685},"model.train(max_epochs=400, early_stopping=True)\n",{"type":70,"tag":136,"props":687,"children":688},{"class":138,"line":262},[689],{"type":70,"tag":136,"props":690,"children":691},{},[692],{"type":76,"value":693},"adata.obsm[\"X_scVI\"] = model.get_latent_representation()\n",{"type":70,"tag":136,"props":695,"children":696},{"class":138,"line":271},[697],{"type":70,"tag":136,"props":698,"children":699},{"emptyLinePlaceholder":231},[700],{"type":76,"value":234},{"type":70,"tag":136,"props":702,"children":703},{"class":138,"line":280},[704],{"type":70,"tag":136,"props":705,"children":706},{},[707],{"type":76,"value":708},"sc.pp.neighbors(adata, n_neighbors=15, use_rep=\"X_scVI\")\n",{"type":70,"tag":136,"props":710,"children":711},{"class":138,"line":289},[712],{"type":70,"tag":136,"props":713,"children":714},{},[715],{"type":76,"value":499},{"type":70,"tag":136,"props":717,"children":718},{"class":138,"line":298},[719],{"type":70,"tag":136,"props":720,"children":721},{},[722],{"type":76,"value":508},{"type":70,"tag":79,"props":724,"children":726},{"id":725},"response-format",[727],{"type":76,"value":728},"Response Format",{"type":70,"tag":730,"props":731,"children":732},"ul",{},[733,739,744,749,754],{"type":70,"tag":734,"props":735,"children":736},"li",{},[737],{"type":76,"value":738},"Lead with the command or code the user needs — explain after",{"type":70,"tag":734,"props":740,"children":741},{},[742],{"type":76,"value":743},"Structure as: confirm inputs → working code → key parameters explained → gotchas",{"type":70,"tag":734,"props":745,"children":746},{},[747],{"type":76,"value":748},"One complete working example per task; do not show every alternative",{"type":70,"tag":734,"props":750,"children":751},{},[752],{"type":76,"value":753},"Keep code comments minimal and functional (what, not why-it-exists)",{"type":70,"tag":734,"props":755,"children":756},{},[757],{"type":76,"value":758},"Target: 50-100 lines of code with brief surrounding explanation",{"type":70,"tag":79,"props":760,"children":762},{"id":761},"core-concepts",[763],{"type":76,"value":764},"Core Concepts",{"type":70,"tag":730,"props":766,"children":767},{},[768,849,902,951,989,1030],{"type":70,"tag":734,"props":769,"children":770},{},[771,776,778,784,786,792,794,800,802,808,810,816,818,824,826,832,833,839,841,847],{"type":70,"tag":625,"props":772,"children":773},{},[774],{"type":76,"value":775},"AnnData layout.",{"type":76,"value":777}," ",{"type":70,"tag":97,"props":779,"children":781},{"className":780},[],[782],{"type":76,"value":783},"adata.X",{"type":76,"value":785}," is the current expression matrix (cells × genes). ",{"type":70,"tag":97,"props":787,"children":789},{"className":788},[],[790],{"type":76,"value":791},"adata.obs",{"type":76,"value":793}," holds per-cell metadata (QC metrics, cluster labels, batch). ",{"type":70,"tag":97,"props":795,"children":797},{"className":796},[],[798],{"type":76,"value":799},"adata.var",{"type":76,"value":801}," holds per-gene metadata (HVG flags, ",{"type":70,"tag":97,"props":803,"children":805},{"className":804},[],[806],{"type":76,"value":807},"mt",{"type":76,"value":809},"). Embeddings live in ",{"type":70,"tag":97,"props":811,"children":813},{"className":812},[],[814],{"type":76,"value":815},"adata.obsm",{"type":76,"value":817}," (",{"type":70,"tag":97,"props":819,"children":821},{"className":820},[],[822],{"type":76,"value":823},"X_pca",{"type":76,"value":825},", ",{"type":70,"tag":97,"props":827,"children":829},{"className":828},[],[830],{"type":76,"value":831},"X_umap",{"type":76,"value":825},{"type":70,"tag":97,"props":834,"children":836},{"className":835},[],[837],{"type":76,"value":838},"X_scVI",{"type":76,"value":840},"). Neighbor graph and DE results live in ",{"type":70,"tag":97,"props":842,"children":844},{"className":843},[],[845],{"type":76,"value":846},"adata.uns",{"type":76,"value":848},".",{"type":70,"tag":734,"props":850,"children":851},{},[852,863,864,870,872,878,879,885,887,892,894,900],{"type":70,"tag":625,"props":853,"children":854},{},[855,861],{"type":70,"tag":97,"props":856,"children":858},{"className":857},[],[859],{"type":76,"value":860},".raw",{"type":76,"value":862}," snapshot.",{"type":76,"value":777},{"type":70,"tag":97,"props":865,"children":867},{"className":866},[],[868],{"type":76,"value":869},"adata.raw = adata",{"type":76,"value":871}," stores the full log-normalized matrix before HVG subsetting. Downstream plotting functions (",{"type":70,"tag":97,"props":873,"children":875},{"className":874},[],[876],{"type":76,"value":877},"sc.pl.umap(..., color=\"GENE\")",{"type":76,"value":825},{"type":70,"tag":97,"props":880,"children":882},{"className":881},[],[883],{"type":76,"value":884},"sc.pl.rank_genes_groups",{"type":76,"value":886},") read from ",{"type":70,"tag":97,"props":888,"children":890},{"className":889},[],[891],{"type":76,"value":860},{"type":76,"value":893}," so you can visualize any gene even after restricting ",{"type":70,"tag":97,"props":895,"children":897},{"className":896},[],[898],{"type":76,"value":899},"adata",{"type":76,"value":901}," to HVGs.",{"type":70,"tag":734,"props":903,"children":904},{},[905,910,911,917,919,925,927,933,935,941,943,949],{"type":70,"tag":625,"props":906,"children":907},{},[908],{"type":76,"value":909},"QC thresholds are dataset-dependent.",{"type":76,"value":777},{"type":70,"tag":97,"props":912,"children":914},{"className":913},[],[915],{"type":76,"value":916},"n_genes ∈ [200, 5000]",{"type":76,"value":918}," and ",{"type":70,"tag":97,"props":920,"children":922},{"className":921},[],[923],{"type":76,"value":924},"pct_mt \u003C 20",{"type":76,"value":926}," are reasonable defaults for human 10X PBMC-like data. Inspect distributions (",{"type":70,"tag":97,"props":928,"children":930},{"className":929},[],[931],{"type":76,"value":932},"sc.pl.violin",{"type":76,"value":934},") before committing. Use ",{"type":70,"tag":97,"props":936,"children":938},{"className":937},[],[939],{"type":76,"value":940},"MT-",{"type":76,"value":942}," for human and ",{"type":70,"tag":97,"props":944,"children":946},{"className":945},[],[947],{"type":76,"value":948},"mt-",{"type":76,"value":950}," for mouse.",{"type":70,"tag":734,"props":952,"children":953},{},[954,959,961,967,969,974,976,982,983,987],{"type":70,"tag":625,"props":955,"children":956},{},[957],{"type":76,"value":958},"HVG flavor matters.",{"type":76,"value":960}," Use ",{"type":70,"tag":97,"props":962,"children":964},{"className":963},[],[965],{"type":76,"value":966},"flavor=\"seurat\"",{"type":76,"value":968}," on ",{"type":70,"tag":625,"props":970,"children":971},{},[972],{"type":76,"value":973},"log-normalized",{"type":76,"value":975}," data (default). Use ",{"type":70,"tag":97,"props":977,"children":979},{"className":978},[],[980],{"type":76,"value":981},"flavor=\"seurat_v3\"",{"type":76,"value":968},{"type":70,"tag":625,"props":984,"children":985},{},[986],{"type":76,"value":629},{"type":76,"value":988}," — it expects integer counts and will error or mislead on log data.",{"type":70,"tag":734,"props":990,"children":991},{},[992,997,998,1004,1006,1012,1014,1020,1022,1028],{"type":70,"tag":625,"props":993,"children":994},{},[995],{"type":76,"value":996},"Neighbors parameters.",{"type":76,"value":777},{"type":70,"tag":97,"props":999,"children":1001},{"className":1000},[],[1002],{"type":76,"value":1003},"n_neighbors",{"type":76,"value":1005}," controls local\u002Fglobal structure (10–50; larger = smoother UMAP). ",{"type":70,"tag":97,"props":1007,"children":1009},{"className":1008},[],[1010],{"type":76,"value":1011},"n_pcs",{"type":76,"value":1013}," should capture the elbow in ",{"type":70,"tag":97,"props":1015,"children":1017},{"className":1016},[],[1018],{"type":76,"value":1019},"sc.pl.pca_variance_ratio",{"type":76,"value":1021}," (typically 20–50). Leiden ",{"type":70,"tag":97,"props":1023,"children":1025},{"className":1024},[],[1026],{"type":76,"value":1027},"resolution",{"type":76,"value":1029}," controls cluster granularity (0.2–1.5; higher = more clusters).",{"type":70,"tag":734,"props":1031,"children":1032},{},[1033,1038],{"type":70,"tag":625,"props":1034,"children":1035},{},[1036],{"type":76,"value":1037},"Batch correction choice.",{"type":76,"value":1039}," Harmony is fast, operates on PCA, and works well for mild-to-moderate batch effects. scVI is a deep generative model, needs raw counts and GPU for speed, and handles stronger technical variation and multi-modal designs.",{"type":70,"tag":79,"props":1041,"children":1043},{"id":1042},"quick-reference",[1044],{"type":76,"value":1045},"Quick Reference",{"type":70,"tag":562,"props":1047,"children":1049},{"id":1048},"loading",[1050],{"type":76,"value":1051},"Loading",{"type":70,"tag":1053,"props":1054,"children":1055},"table",{},[1056,1075],{"type":70,"tag":1057,"props":1058,"children":1059},"thead",{},[1060],{"type":70,"tag":1061,"props":1062,"children":1063},"tr",{},[1064,1070],{"type":70,"tag":1065,"props":1066,"children":1067},"th",{},[1068],{"type":76,"value":1069},"Input",{"type":70,"tag":1065,"props":1071,"children":1072},{},[1073],{"type":76,"value":1074},"Call",{"type":70,"tag":1076,"props":1077,"children":1078},"tbody",{},[1079,1097,1114,1131],{"type":70,"tag":1061,"props":1080,"children":1081},{},[1082,1088],{"type":70,"tag":1083,"props":1084,"children":1085},"td",{},[1086],{"type":76,"value":1087},"10X HDF5",{"type":70,"tag":1083,"props":1089,"children":1090},{},[1091],{"type":70,"tag":97,"props":1092,"children":1094},{"className":1093},[],[1095],{"type":76,"value":1096},"sc.read_10x_h5(\"filtered_feature_bc_matrix.h5\")",{"type":70,"tag":1061,"props":1098,"children":1099},{},[1100,1105],{"type":70,"tag":1083,"props":1101,"children":1102},{},[1103],{"type":76,"value":1104},"10X MTX dir",{"type":70,"tag":1083,"props":1106,"children":1107},{},[1108],{"type":70,"tag":97,"props":1109,"children":1111},{"className":1110},[],[1112],{"type":76,"value":1113},"sc.read_10x_mtx(\"path\u002F\", var_names=\"gene_symbols\", cache=True)",{"type":70,"tag":1061,"props":1115,"children":1116},{},[1117,1122],{"type":70,"tag":1083,"props":1118,"children":1119},{},[1120],{"type":76,"value":1121},"Existing AnnData",{"type":70,"tag":1083,"props":1123,"children":1124},{},[1125],{"type":70,"tag":97,"props":1126,"children":1128},{"className":1127},[],[1129],{"type":76,"value":1130},"sc.read_h5ad(\"input.h5ad\")",{"type":70,"tag":1061,"props":1132,"children":1133},{},[1134,1139],{"type":70,"tag":1083,"props":1135,"children":1136},{},[1137],{"type":76,"value":1138},"Always after load",{"type":70,"tag":1083,"props":1140,"children":1141},{},[1142],{"type":70,"tag":97,"props":1143,"children":1145},{"className":1144},[],[1146],{"type":76,"value":1147},"adata.var_names_make_unique()",{"type":70,"tag":562,"props":1149,"children":1151},{"id":1150},"key-parameter-ranges",[1152],{"type":76,"value":1153},"Key parameter ranges",{"type":70,"tag":1053,"props":1155,"children":1156},{},[1157,1183],{"type":70,"tag":1057,"props":1158,"children":1159},{},[1160],{"type":70,"tag":1061,"props":1161,"children":1162},{},[1163,1168,1173,1178],{"type":70,"tag":1065,"props":1164,"children":1165},{},[1166],{"type":76,"value":1167},"Parameter",{"type":70,"tag":1065,"props":1169,"children":1170},{},[1171],{"type":76,"value":1172},"Default",{"type":70,"tag":1065,"props":1174,"children":1175},{},[1176],{"type":76,"value":1177},"Typical range",{"type":70,"tag":1065,"props":1179,"children":1180},{},[1181],{"type":76,"value":1182},"Notes",{"type":70,"tag":1076,"props":1184,"children":1185},{},[1186,1213,1240,1267,1294,1328,1357,1383,1415,1442,1475],{"type":70,"tag":1061,"props":1187,"children":1188},{},[1189,1198,1203,1208],{"type":70,"tag":1083,"props":1190,"children":1191},{},[1192],{"type":70,"tag":97,"props":1193,"children":1195},{"className":1194},[],[1196],{"type":76,"value":1197},"filter_cells(min_genes=)",{"type":70,"tag":1083,"props":1199,"children":1200},{},[1201],{"type":76,"value":1202},"200",{"type":70,"tag":1083,"props":1204,"children":1205},{},[1206],{"type":76,"value":1207},"100–500",{"type":70,"tag":1083,"props":1209,"children":1210},{},[1211],{"type":76,"value":1212},"Drop empty\u002Flow-quality droplets",{"type":70,"tag":1061,"props":1214,"children":1215},{},[1216,1225,1230,1235],{"type":70,"tag":1083,"props":1217,"children":1218},{},[1219],{"type":70,"tag":97,"props":1220,"children":1222},{"className":1221},[],[1223],{"type":76,"value":1224},"filter_genes(min_cells=)",{"type":70,"tag":1083,"props":1226,"children":1227},{},[1228],{"type":76,"value":1229},"3",{"type":70,"tag":1083,"props":1231,"children":1232},{},[1233],{"type":76,"value":1234},"3–10",{"type":70,"tag":1083,"props":1236,"children":1237},{},[1238],{"type":76,"value":1239},"Drop rarely-expressed genes",{"type":70,"tag":1061,"props":1241,"children":1242},{},[1243,1252,1257,1262],{"type":70,"tag":1083,"props":1244,"children":1245},{},[1246],{"type":70,"tag":97,"props":1247,"children":1249},{"className":1248},[],[1250],{"type":76,"value":1251},"n_genes_by_counts \u003C",{"type":70,"tag":1083,"props":1253,"children":1254},{},[1255],{"type":76,"value":1256},"5000",{"type":70,"tag":1083,"props":1258,"children":1259},{},[1260],{"type":76,"value":1261},"2500–8000",{"type":70,"tag":1083,"props":1263,"children":1264},{},[1265],{"type":76,"value":1266},"Upper bound flags doublets",{"type":70,"tag":1061,"props":1268,"children":1269},{},[1270,1279,1284,1289],{"type":70,"tag":1083,"props":1271,"children":1272},{},[1273],{"type":70,"tag":97,"props":1274,"children":1276},{"className":1275},[],[1277],{"type":76,"value":1278},"pct_counts_mt \u003C",{"type":70,"tag":1083,"props":1280,"children":1281},{},[1282],{"type":76,"value":1283},"20",{"type":70,"tag":1083,"props":1285,"children":1286},{},[1287],{"type":76,"value":1288},"5–25",{"type":70,"tag":1083,"props":1290,"children":1291},{},[1292],{"type":76,"value":1293},"Human tissue dependent",{"type":70,"tag":1061,"props":1295,"children":1296},{},[1297,1306,1315,1323],{"type":70,"tag":1083,"props":1298,"children":1299},{},[1300],{"type":70,"tag":97,"props":1301,"children":1303},{"className":1302},[],[1304],{"type":76,"value":1305},"normalize_total(target_sum=)",{"type":70,"tag":1083,"props":1307,"children":1308},{},[1309],{"type":70,"tag":97,"props":1310,"children":1312},{"className":1311},[],[1313],{"type":76,"value":1314},"1e4",{"type":70,"tag":1083,"props":1316,"children":1317},{},[1318],{"type":70,"tag":97,"props":1319,"children":1321},{"className":1320},[],[1322],{"type":76,"value":1314},{"type":70,"tag":1083,"props":1324,"children":1325},{},[1326],{"type":76,"value":1327},"CP10k; standard",{"type":70,"tag":1061,"props":1329,"children":1330},{},[1331,1342,1347,1352],{"type":70,"tag":1083,"props":1332,"children":1333},{},[1334,1340],{"type":70,"tag":97,"props":1335,"children":1337},{"className":1336},[],[1338],{"type":76,"value":1339},"n_top_genes",{"type":76,"value":1341}," (HVG)",{"type":70,"tag":1083,"props":1343,"children":1344},{},[1345],{"type":76,"value":1346},"2000",{"type":70,"tag":1083,"props":1348,"children":1349},{},[1350],{"type":76,"value":1351},"1000–5000",{"type":70,"tag":1083,"props":1353,"children":1354},{},[1355],{"type":76,"value":1356},"More HVGs → more signal + noise",{"type":70,"tag":1061,"props":1358,"children":1359},{},[1360,1369,1374,1378],{"type":70,"tag":1083,"props":1361,"children":1362},{},[1363],{"type":70,"tag":97,"props":1364,"children":1366},{"className":1365},[],[1367],{"type":76,"value":1368},"scale(max_value=)",{"type":70,"tag":1083,"props":1370,"children":1371},{},[1372],{"type":76,"value":1373},"10",{"type":70,"tag":1083,"props":1375,"children":1376},{},[1377],{"type":76,"value":1373},{"type":70,"tag":1083,"props":1379,"children":1380},{},[1381],{"type":76,"value":1382},"Clip extreme z-scores",{"type":70,"tag":1061,"props":1384,"children":1385},{},[1386,1395,1400,1405],{"type":70,"tag":1083,"props":1387,"children":1388},{},[1389],{"type":70,"tag":97,"props":1390,"children":1392},{"className":1391},[],[1393],{"type":76,"value":1394},"pca(n_comps=)",{"type":70,"tag":1083,"props":1396,"children":1397},{},[1398],{"type":76,"value":1399},"50",{"type":70,"tag":1083,"props":1401,"children":1402},{},[1403],{"type":76,"value":1404},"30–100",{"type":70,"tag":1083,"props":1406,"children":1407},{},[1408,1410],{"type":76,"value":1409},"Pick elbow for downstream ",{"type":70,"tag":97,"props":1411,"children":1413},{"className":1412},[],[1414],{"type":76,"value":1011},{"type":70,"tag":1061,"props":1416,"children":1417},{},[1418,1427,1432,1437],{"type":70,"tag":1083,"props":1419,"children":1420},{},[1421],{"type":70,"tag":97,"props":1422,"children":1424},{"className":1423},[],[1425],{"type":76,"value":1426},"neighbors(n_neighbors=)",{"type":70,"tag":1083,"props":1428,"children":1429},{},[1430],{"type":76,"value":1431},"15",{"type":70,"tag":1083,"props":1433,"children":1434},{},[1435],{"type":76,"value":1436},"10–50",{"type":70,"tag":1083,"props":1438,"children":1439},{},[1440],{"type":76,"value":1441},"Larger → smoother manifold",{"type":70,"tag":1061,"props":1443,"children":1444},{},[1445,1454,1459,1464],{"type":70,"tag":1083,"props":1446,"children":1447},{},[1448],{"type":70,"tag":97,"props":1449,"children":1451},{"className":1450},[],[1452],{"type":76,"value":1453},"neighbors(n_pcs=)",{"type":70,"tag":1083,"props":1455,"children":1456},{},[1457],{"type":76,"value":1458},"30",{"type":70,"tag":1083,"props":1460,"children":1461},{},[1462],{"type":76,"value":1463},"20–50",{"type":70,"tag":1083,"props":1465,"children":1466},{},[1467,1469],{"type":76,"value":1468},"≤ ",{"type":70,"tag":97,"props":1470,"children":1472},{"className":1471},[],[1473],{"type":76,"value":1474},"n_comps",{"type":70,"tag":1061,"props":1476,"children":1477},{},[1478,1487,1492,1497],{"type":70,"tag":1083,"props":1479,"children":1480},{},[1481],{"type":70,"tag":97,"props":1482,"children":1484},{"className":1483},[],[1485],{"type":76,"value":1486},"leiden(resolution=)",{"type":70,"tag":1083,"props":1488,"children":1489},{},[1490],{"type":76,"value":1491},"0.5",{"type":70,"tag":1083,"props":1493,"children":1494},{},[1495],{"type":76,"value":1496},"0.2–1.5",{"type":70,"tag":1083,"props":1498,"children":1499},{},[1500],{"type":76,"value":1501},"Higher → more clusters",{"type":70,"tag":562,"props":1503,"children":1505},{"id":1504},"de-inspection",[1506],{"type":76,"value":1507},"DE & inspection",{"type":70,"tag":125,"props":1509,"children":1511},{"className":201,"code":1510,"language":203,"meta":130,"style":130},"sc.tl.rank_genes_groups(adata, groupby=\"leiden\", method=\"wilcoxon\")\nsc.pl.rank_genes_groups(adata, n_genes=25, sharey=False)\n\n# Top-N markers per cluster as a DataFrame\nimport pandas as pd\nresult = adata.uns[\"rank_genes_groups\"]\ngroups = result[\"names\"].dtype.names\nmarkers = pd.DataFrame({g: result[\"names\"][g][:20] for g in groups})\n",[1512],{"type":70,"tag":97,"props":1513,"children":1514},{"__ignoreMap":130},[1515,1522,1530,1537,1545,1553,1561,1569],{"type":70,"tag":136,"props":1516,"children":1517},{"class":138,"line":139},[1518],{"type":70,"tag":136,"props":1519,"children":1520},{},[1521],{"type":76,"value":534},{"type":70,"tag":136,"props":1523,"children":1524},{"class":138,"line":218},[1525],{"type":70,"tag":136,"props":1526,"children":1527},{},[1528],{"type":76,"value":1529},"sc.pl.rank_genes_groups(adata, n_genes=25, sharey=False)\n",{"type":70,"tag":136,"props":1531,"children":1532},{"class":138,"line":227},[1533],{"type":70,"tag":136,"props":1534,"children":1535},{"emptyLinePlaceholder":231},[1536],{"type":76,"value":234},{"type":70,"tag":136,"props":1538,"children":1539},{"class":138,"line":26},[1540],{"type":70,"tag":136,"props":1541,"children":1542},{},[1543],{"type":76,"value":1544},"# Top-N markers per cluster as a DataFrame\n",{"type":70,"tag":136,"props":1546,"children":1547},{"class":138,"line":245},[1548],{"type":70,"tag":136,"props":1549,"children":1550},{},[1551],{"type":76,"value":1552},"import pandas as pd\n",{"type":70,"tag":136,"props":1554,"children":1555},{"class":138,"line":254},[1556],{"type":70,"tag":136,"props":1557,"children":1558},{},[1559],{"type":76,"value":1560},"result = adata.uns[\"rank_genes_groups\"]\n",{"type":70,"tag":136,"props":1562,"children":1563},{"class":138,"line":262},[1564],{"type":70,"tag":136,"props":1565,"children":1566},{},[1567],{"type":76,"value":1568},"groups = result[\"names\"].dtype.names\n",{"type":70,"tag":136,"props":1570,"children":1571},{"class":138,"line":271},[1572],{"type":70,"tag":136,"props":1573,"children":1574},{},[1575],{"type":76,"value":1576},"markers = pd.DataFrame({g: result[\"names\"][g][:20] for g in groups})\n",{"type":70,"tag":562,"props":1578,"children":1580},{"id":1579},"saving-loading",[1581],{"type":76,"value":1582},"Saving \u002F loading",{"type":70,"tag":125,"props":1584,"children":1586},{"className":201,"code":1585,"language":203,"meta":130,"style":130},"adata.write(\"result.h5ad\", compression=\"gzip\")\nadata = sc.read_h5ad(\"result.h5ad\")\n",[1587],{"type":70,"tag":97,"props":1588,"children":1589},{"__ignoreMap":130},[1590,1597],{"type":70,"tag":136,"props":1591,"children":1592},{"class":138,"line":139},[1593],{"type":70,"tag":136,"props":1594,"children":1595},{},[1596],{"type":76,"value":560},{"type":70,"tag":136,"props":1598,"children":1599},{"class":138,"line":218},[1600],{"type":70,"tag":136,"props":1601,"children":1602},{},[1603],{"type":76,"value":1604},"adata = sc.read_h5ad(\"result.h5ad\")\n",{"type":70,"tag":79,"props":1606,"children":1608},{"id":1607},"common-mistakes",[1609],{"type":76,"value":1610},"Common Mistakes",{"type":70,"tag":730,"props":1612,"children":1613},{},[1614,1663,1707,1742,1777,1832],{"type":70,"tag":734,"props":1615,"children":1616},{},[1617,1622,1624,1629,1634,1636,1641,1643,1649,1654,1656,1661],{"type":70,"tag":625,"props":1618,"children":1619},{},[1620],{"type":76,"value":1621},"Wrong:",{"type":76,"value":1623}," Subsetting to HVGs before saving ",{"type":70,"tag":97,"props":1625,"children":1627},{"className":1626},[],[1628],{"type":76,"value":869},{"type":70,"tag":625,"props":1630,"children":1631},{},[1632],{"type":76,"value":1633},"Right:",{"type":76,"value":1635}," Always set ",{"type":70,"tag":97,"props":1637,"children":1639},{"className":1638},[],[1640],{"type":76,"value":860},{"type":76,"value":1642}," on the log-normalized full matrix before ",{"type":70,"tag":97,"props":1644,"children":1646},{"className":1645},[],[1647],{"type":76,"value":1648},"adata = adata[:, adata.var.highly_variable].copy()",{"type":70,"tag":625,"props":1650,"children":1651},{},[1652],{"type":76,"value":1653},"Why:",{"type":76,"value":1655}," Without ",{"type":70,"tag":97,"props":1657,"children":1659},{"className":1658},[],[1660],{"type":76,"value":860},{"type":76,"value":1662},", you lose the ability to plot or score non-HVG genes in downstream analysis",{"type":70,"tag":734,"props":1664,"children":1665},{},[1666,1670,1672,1677,1679,1683,1685,1691,1693,1699,1701,1705],{"type":70,"tag":625,"props":1667,"children":1668},{},[1669],{"type":76,"value":1621},{"type":76,"value":1671}," Using ",{"type":70,"tag":97,"props":1673,"children":1675},{"className":1674},[],[1676],{"type":76,"value":981},{"type":76,"value":1678}," on log-normalized data\n",{"type":70,"tag":625,"props":1680,"children":1681},{},[1682],{"type":76,"value":1633},{"type":76,"value":1684}," Match HVG flavor to data state: ",{"type":70,"tag":97,"props":1686,"children":1688},{"className":1687},[],[1689],{"type":76,"value":1690},"seurat_v3",{"type":76,"value":1692}," requires raw integer counts; ",{"type":70,"tag":97,"props":1694,"children":1696},{"className":1695},[],[1697],{"type":76,"value":1698},"seurat",{"type":76,"value":1700}," (default) requires log-normalized data\n",{"type":70,"tag":625,"props":1702,"children":1703},{},[1704],{"type":76,"value":1653},{"type":76,"value":1706}," Wrong flavor produces nonsense HVG rankings or errors, corrupting all downstream steps",{"type":70,"tag":734,"props":1708,"children":1709},{},[1710,1714,1716,1721,1723,1727,1729,1734,1736,1740],{"type":70,"tag":625,"props":1711,"children":1712},{},[1713],{"type":76,"value":1621},{"type":76,"value":1715}," Skipping ",{"type":70,"tag":97,"props":1717,"children":1719},{"className":1718},[],[1720],{"type":76,"value":1147},{"type":76,"value":1722}," after loading 10X data\n",{"type":70,"tag":625,"props":1724,"children":1725},{},[1726],{"type":76,"value":1633},{"type":76,"value":1728}," Call ",{"type":70,"tag":97,"props":1730,"children":1732},{"className":1731},[],[1733],{"type":76,"value":1147},{"type":76,"value":1735}," immediately after loading\n",{"type":70,"tag":625,"props":1737,"children":1738},{},[1739],{"type":76,"value":1653},{"type":76,"value":1741}," Duplicated gene symbols cause silent misbehavior in indexing, HVG selection, and DE analysis",{"type":70,"tag":734,"props":1743,"children":1744},{},[1745,1749,1751,1755,1757,1763,1765,1771,1775],{"type":70,"tag":625,"props":1746,"children":1747},{},[1748],{"type":76,"value":1621},{"type":76,"value":1750}," Running scVI on normalized\u002Flog-transformed data\n",{"type":70,"tag":625,"props":1752,"children":1753},{},[1754],{"type":76,"value":1633},{"type":76,"value":1756}," Feed scVI the raw-count AnnData and set ",{"type":70,"tag":97,"props":1758,"children":1760},{"className":1759},[],[1761],{"type":76,"value":1762},"batch_key",{"type":76,"value":1764}," via ",{"type":70,"tag":97,"props":1766,"children":1768},{"className":1767},[],[1769],{"type":76,"value":1770},"setup_anndata",{"type":70,"tag":625,"props":1772,"children":1773},{},[1774],{"type":76,"value":1653},{"type":76,"value":1776}," scVI models counts directly; normalized input violates its distributional assumptions and produces incorrect latent spaces",{"type":70,"tag":734,"props":1778,"children":1779},{},[1780,1784,1785,1790,1792,1797,1799,1803,1804,1809,1811,1816,1818,1822,1824,1830],{"type":70,"tag":625,"props":1781,"children":1782},{},[1783],{"type":76,"value":1621},{"type":76,"value":1671},{"type":70,"tag":97,"props":1786,"children":1788},{"className":1787},[],[1789],{"type":76,"value":940},{"type":76,"value":1791}," prefix for mouse mitochondrial genes (or ",{"type":70,"tag":97,"props":1793,"children":1795},{"className":1794},[],[1796],{"type":76,"value":948},{"type":76,"value":1798}," for human)\n",{"type":70,"tag":625,"props":1800,"children":1801},{},[1802],{"type":76,"value":1633},{"type":76,"value":960},{"type":70,"tag":97,"props":1805,"children":1807},{"className":1806},[],[1808],{"type":76,"value":940},{"type":76,"value":1810}," for human genes and ",{"type":70,"tag":97,"props":1812,"children":1814},{"className":1813},[],[1815],{"type":76,"value":948},{"type":76,"value":1817}," for mouse genes\n",{"type":70,"tag":625,"props":1819,"children":1820},{},[1821],{"type":76,"value":1653},{"type":76,"value":1823}," Wrong prefix makes ",{"type":70,"tag":97,"props":1825,"children":1827},{"className":1826},[],[1828],{"type":76,"value":1829},"pct_counts_mt",{"type":76,"value":1831}," always zero, rendering the QC filter a no-op",{"type":70,"tag":734,"props":1833,"children":1834},{},[1835,1839,1841,1847,1851,1853,1858,1860,1866,1870,1871,1876],{"type":70,"tag":625,"props":1836,"children":1837},{},[1838],{"type":76,"value":1621},{"type":76,"value":1840}," Boolean-slicing AnnData without calling ",{"type":70,"tag":97,"props":1842,"children":1844},{"className":1843},[],[1845],{"type":76,"value":1846},".copy()",{"type":70,"tag":625,"props":1848,"children":1849},{},[1850],{"type":76,"value":1633},{"type":76,"value":1852}," Always use ",{"type":70,"tag":97,"props":1854,"children":1856},{"className":1855},[],[1857],{"type":76,"value":1846},{"type":76,"value":1859}," after filtering: ",{"type":70,"tag":97,"props":1861,"children":1863},{"className":1862},[],[1864],{"type":76,"value":1865},"adata = adata[mask, :].copy()",{"type":70,"tag":625,"props":1867,"children":1868},{},[1869],{"type":76,"value":1653},{"type":76,"value":1655},{"type":70,"tag":97,"props":1872,"children":1874},{"className":1873},[],[1875],{"type":76,"value":1846},{"type":76,"value":1877},", the result is a view; subsequent in-place operations will warn or fail",{"type":70,"tag":79,"props":1879,"children":1881},{"id":1880},"references",[1882],{"type":76,"value":1883},"References",{"type":70,"tag":730,"props":1885,"children":1886},{},[1887,1900,1911,1922],{"type":70,"tag":734,"props":1888,"children":1889},{},[1890,1892],{"type":76,"value":1891},"Scanpy: Wolf et al. Genome Biol 2018, ",{"type":70,"tag":1893,"props":1894,"children":1898},"a",{"href":1895,"rel":1896},"https:\u002F\u002Fdoi.org\u002F10.1186\u002Fs13059-017-1382-0",[1897],"nofollow",[1899],{"type":76,"value":1895},{"type":70,"tag":734,"props":1901,"children":1902},{},[1903,1905],{"type":76,"value":1904},"Scanpy tutorials: ",{"type":70,"tag":1893,"props":1906,"children":1909},{"href":1907,"rel":1908},"https:\u002F\u002Fscanpy.readthedocs.io\u002Fen\u002Fstable\u002Ftutorials.html",[1897],[1910],{"type":76,"value":1907},{"type":70,"tag":734,"props":1912,"children":1913},{},[1914,1916],{"type":76,"value":1915},"scVI: Gayoso et al. Nat Biotechnol 2022, ",{"type":70,"tag":1893,"props":1917,"children":1920},{"href":1918,"rel":1919},"https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41587-021-01206-w",[1897],[1921],{"type":76,"value":1918},{"type":70,"tag":734,"props":1923,"children":1924},{},[1925,1927],{"type":76,"value":1926},"Harmony: Korsunsky et al. Nat Methods 2019, ",{"type":70,"tag":1893,"props":1928,"children":1931},{"href":1929,"rel":1930},"https:\u002F\u002Fdoi.org\u002F10.1038\u002Fs41592-019-0619-0",[1897],[1932],{"type":76,"value":1929},{"type":70,"tag":1934,"props":1935,"children":1936},"style",{},[1937],{"type":76,"value":1938},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1940,"total":554},[1941,1961,1974,1988,1999,2012,2025],{"slug":1942,"name":1942,"fn":1943,"description":1944,"org":1945,"tags":1946,"stars":26,"repoUrl":27,"updatedAt":1960},"aws-genai-ml-architect","design AWS GenAI and ML architectures","Reasoning skill for designing AWS GenAI and ML architectures for healthcare and life sciences workloads. Use when the user asks to choose between SageMaker and Bedrock, design a RAG system over medical literature, architect clinical NLP or medical imaging inference, plan genomics or drug discovery pipelines on AWS, address HIPAA\u002FPHI compliance in ML systems, design MLOps for regulated clinical models, or optimize cost for HCLS ML workloads. Triggers include \"AWS architecture\", \"SageMaker vs Bedrock\", \"HIPAA ML\", \"clinical RAG\", \"medical imaging inference\", \"genomics on AWS\", \"PHI training\", \"MLOps healthcare\", \"Bedrock guardrails\", \"HealthLake\", \"HCLS cloud architecture\", \"BAA compliance\", \"SageMaker endpoint\", \"Bedrock knowledge base\", \"clinical NLP on AWS\", \"FDA SaMD on AWS\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1947,1950,1953,1956,1957],{"name":1948,"slug":1949,"type":16},"Architecture","architecture",{"name":1951,"slug":1952,"type":16},"AWS","aws",{"name":1954,"slug":1955,"type":16},"Healthcare","healthcare",{"name":18,"slug":19,"type":16},{"name":1958,"slug":1959,"type":16},"LLM","llm","2026-07-12T08:38:07.975937",{"slug":1962,"name":1962,"fn":1963,"description":1964,"org":1965,"tags":1966,"stars":26,"repoUrl":27,"updatedAt":1973},"biomarker-discovery","guide biomarker discovery and validation","Reason about biomarker discovery and validation in HCLS — classifying biomarker intent, choosing feature-selection and cross-validation strategies, avoiding leakage, and planning external replication. Use when the user asks to discover, develop, or validate a biomarker; select features from high-dimensional omics or clinical data; design a validation study; choose evaluation metrics; justify sample size; combine multi-omics signals; or assess clinical utility. Triggers include \"discover a biomarker\", \"validate biomarker\", \"prognostic vs predictive\", \"feature selection\", \"LASSO vs elastic net\", \"nested cross-validation\", \"data leakage\", \"C-index\", \"time-dependent AUC\", \"decision curve analysis\", \"external validation cohort\", \"events per variable\", \"optimism-corrected\", \"multi-omics integration\", \"clinical utility of a biomarker\", \"is this biomarker ready\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1967,1968,1969,1970],{"name":1951,"slug":1952,"type":16},{"name":21,"slug":22,"type":16},{"name":18,"slug":19,"type":16},{"name":1971,"slug":1972,"type":16},"Research","research","2026-07-12T08:37:49.295301",{"slug":1975,"name":1975,"fn":1976,"description":1977,"org":1978,"tags":1979,"stars":26,"repoUrl":27,"updatedAt":1987},"cdisc-compliance","reason about CDISC SDTM and ADaM implementation","Reason about CDISC SDTM and ADaM implementation for regulatory submissions. Use when the user asks about SDTM domain mapping, ADaM dataset design, controlled terminology versioning, define.xml completeness, FDA or PMDA submission requirements, query prioritization by clinical impact, SUPPQUAL usage, or CDISC compliance review. Triggers include \"SDTM mapping\", \"ADaM dataset\", \"CDISC compliance\", \"controlled terminology\", \"define.xml\", \"FDA submission data\", \"PMDA submission\", \"SDTM domain\", \"ADSL\", \"ADAE\", \"ADLB\", \"BDS structure\", \"SUPPQUAL\", \"RELREC\", \"value-level metadata\", \"CDISC CT\", \"regulatory submission data standards\", \"eCTD datasets\", \"SDTM 3.3\", \"ADaM 1.1\", \"query prioritization\", \"clinical data review\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1980,1983,1984],{"name":1981,"slug":1982,"type":16},"Clinical Trials","clinical-trials",{"name":18,"slug":19,"type":16},{"name":1985,"slug":1986,"type":16},"Regulatory Compliance","regulatory-compliance","2026-07-12T08:37:33.35594",{"slug":1989,"name":1989,"fn":1990,"description":1991,"org":1992,"tags":1993,"stars":26,"repoUrl":27,"updatedAt":1998},"cell-type-annotation","annotate single-cell RNA-seq clusters","Generate code to assign cell type labels to single-cell RNA-seq clusters using CellTypist, SingleR, marker-based annotation, or reference label transfer (scANVI\u002Fingest). Triggers on requests to \"annotate cell types\", \"label clusters\", \"run CellTypist\", \"SingleR annotation\", \"marker gene dotplot\", \"transfer labels from reference atlas\", \"cell identity\", \"automated annotation\", \"reference mapping\", \"scANVI label transfer\", \"canonical markers\", \"immune cell types\", \"hierarchical annotation\", \"majority voting CellTypist\", \"over-clustering annotation\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1994,1995,1996,1997],{"name":21,"slug":22,"type":16},{"name":14,"slug":15,"type":16},{"name":18,"slug":19,"type":16},{"name":24,"slug":25,"type":16},"2026-07-12T08:38:05.443454",{"slug":2000,"name":2000,"fn":2001,"description":2002,"org":2003,"tags":2004,"stars":26,"repoUrl":27,"updatedAt":2011},"cheminformatics","calculate molecular properties with RDKit","Cheminformatics pipeline for small-molecule property calculation, filtering, and similarity analysis using RDKit. Use when the user asks to compute molecular descriptors, filter compounds by Lipinski or Veber rules, detect PAINS, calculate fingerprint similarity, run matched molecular pair analysis, generate ADMET descriptors, or process SMILES. Triggers include \"RDKit\", \"molecular descriptors\", \"Lipinski\", \"rule of five\", \"Veber\", \"PAINS\", \"pan-assay interference\", \"Morgan fingerprint\", \"Tanimoto\", \"fingerprint similarity\", \"matched molecular pair\", \"MMP\", \"mmpdb\", \"ADMET\", \"druglikeness\", \"SMILES\", \"cheminformatics\", \"compound filtering\", \"chemical similarity\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2005,2006,2009,2010],{"name":21,"slug":22,"type":16},{"name":2007,"slug":2008,"type":16},"Chemistry","chemistry",{"name":14,"slug":15,"type":16},{"name":1971,"slug":1972,"type":16},"2026-07-12T08:37:28.334619",{"slug":2013,"name":2013,"fn":2014,"description":2015,"org":2016,"tags":2017,"stars":26,"repoUrl":27,"updatedAt":2024},"claims-analytics","analyze and parse healthcare claims data","Pipeline skill for healthcare claims data parsing, analysis, and fraud detection. Use when the user asks to parse X12 837 or 835 claim files, manipulate ICD-10 CPT or HCPCS codes, detect billing pattern anomalies, profile providers against specialty peers, identify outlier billing behavior, validate NCCI edits programmatically, detect duplicate claims, run Benford's law analysis on charges, build claims data pipelines, or analyze E&M code distributions. Triggers include \"parse X12 837\", \"parse 835\", \"claims SQL\", \"ICD-10 manipulation\", \"CPT code analysis\", \"provider profiling\", \"billing outlier\", \"NCCI validation code\", \"duplicate claim detection\", \"Benford's law charges\", \"claims ETL\", \"E&M distribution analysis\", \"claims analytics pipeline\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2018,2019,2020,2023],{"name":14,"slug":15,"type":16},{"name":1954,"slug":1955,"type":16},{"name":2021,"slug":2022,"type":16},"Insurance","insurance",{"name":18,"slug":19,"type":16},"2026-07-12T08:37:34.815088",{"slug":2026,"name":2026,"fn":2027,"description":2028,"org":2029,"tags":2030,"stars":26,"repoUrl":27,"updatedAt":2034},"claims-billing-rules","analyze healthcare claims billing rules","Reasoning skill for healthcare claims billing rules and fraud detection logic. Use when the user asks about CMS billing rules, place of service codes, global surgery periods, modifier usage (25 59 76 77), NCCI edit logic, column 1 column 2 code pairs, mutually exclusive procedures, modifier indicators, fraud waste and abuse patterns, E&M upcoding, unbundling, phantom billing, impossible day detection, coding error versus fraud distinction, FWA investigation methodology, or claims audit logic. Triggers include \"CMS billing rules\", \"NCCI edits\", \"modifier 25\", \"modifier 59\", \"global surgery period\", \"upcoding\", \"unbundling\", \"phantom billing\", \"impossible day\", \"FWA\", \"fraud waste abuse\", \"coding error vs fraud\", \"claims audit\", \"billing compliance\", \"E&M level selection\".\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2031,2032,2033],{"name":1954,"slug":1955,"type":16},{"name":2021,"slug":2022,"type":16},{"name":1985,"slug":1986,"type":16},"2026-07-12T08:38:28.210856",{"items":2036,"total":2212},[2037,2056,2077,2087,2100,2113,2123,2133,2154,2169,2184,2199],{"slug":2038,"name":2038,"fn":2039,"description":2040,"org":2041,"tags":2042,"stars":2053,"repoUrl":2054,"updatedAt":2055},"agentcore-investigation","investigate Bedrock AgentCore runtime sessions","Investigate Bedrock AgentCore runtime sessions via CloudWatch Logs Insights — resolve session\u002Ftrace IDs, query OTEL spans, filter noise, build timelines. Use when debugging AgentCore agent sessions, tracing tool calls, or analyzing latency.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2043,2044,2047,2050],{"name":1951,"slug":1952,"type":16},{"name":2045,"slug":2046,"type":16},"Debugging","debugging",{"name":2048,"slug":2049,"type":16},"Logs","logs",{"name":2051,"slug":2052,"type":16},"Observability","observability",9427,"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fmcp","2026-07-12T08:37:22.601527",{"slug":2057,"name":2058,"fn":2059,"description":2060,"org":2061,"tags":2062,"stars":2053,"repoUrl":2054,"updatedAt":2076},"amazon-aurora-dsql","amazon aurora dsql","build applications with Aurora DSQL","Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, FK replacement code generation, OCC retry patterns, ORM migration (Django\u002FHibernate\u002FRails), DDL operations, query plan explainability, SQL compatibility validation, and bulk data loading. Triggers on phrases like: DSQL, Aurora DSQL, create DSQL table, DSQL schema, migrate to DSQL, distributed SQL database, serverless PostgreSQL-compatible database, DSQL query plan, DSQL EXPLAIN ANALYZE, why is my DSQL query slow, DSQL foreign key, DSQL OCC retry, DSQL multi-region, load into DSQL, load CSV into DSQL, bulk load DSQL, aurora-dsql-loader.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2063,2066,2067,2070,2073],{"name":2064,"slug":2065,"type":16},"Aurora","aurora",{"name":1951,"slug":1952,"type":16},{"name":2068,"slug":2069,"type":16},"Database","database",{"name":2071,"slug":2072,"type":16},"Serverless","serverless",{"name":2074,"slug":2075,"type":16},"SQL","sql","2026-07-12T08:36:45.053393",{"slug":2078,"name":2079,"fn":2059,"description":2060,"org":2080,"tags":2081,"stars":2053,"repoUrl":2054,"updatedAt":2086},"aurora-dsql","aurora dsql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2082,2083,2084,2085],{"name":1951,"slug":1952,"type":16},{"name":2068,"slug":2069,"type":16},{"name":2071,"slug":2072,"type":16},{"name":2074,"slug":2075,"type":16},"2026-07-12T08:36:42.694299",{"slug":2088,"name":2089,"fn":2059,"description":2060,"org":2090,"tags":2091,"stars":2053,"repoUrl":2054,"updatedAt":2099},"aws-dsql","aws dsql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2092,2093,2094,2097,2098],{"name":1951,"slug":1952,"type":16},{"name":2068,"slug":2069,"type":16},{"name":2095,"slug":2096,"type":16},"Migration","migration",{"name":2071,"slug":2072,"type":16},{"name":2074,"slug":2075,"type":16},"2026-07-12T08:36:38.584057",{"slug":2101,"name":2102,"fn":2059,"description":2060,"org":2103,"tags":2104,"stars":2053,"repoUrl":2054,"updatedAt":2112},"distributed-postgres","distributed postgres",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2105,2106,2107,2110,2111],{"name":1951,"slug":1952,"type":16},{"name":2068,"slug":2069,"type":16},{"name":2108,"slug":2109,"type":16},"PostgreSQL","postgresql",{"name":2071,"slug":2072,"type":16},{"name":2074,"slug":2075,"type":16},"2026-07-12T08:36:46.530743",{"slug":2114,"name":2115,"fn":2059,"description":2060,"org":2116,"tags":2117,"stars":2053,"repoUrl":2054,"updatedAt":2122},"distributed-sql","distributed sql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2118,2119,2120,2121],{"name":1951,"slug":1952,"type":16},{"name":2068,"slug":2069,"type":16},{"name":2071,"slug":2072,"type":16},{"name":2074,"slug":2075,"type":16},"2026-07-12T08:36:48.104182",{"slug":2124,"name":2124,"fn":2059,"description":2060,"org":2125,"tags":2126,"stars":2053,"repoUrl":2054,"updatedAt":2132},"dsql",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2127,2128,2129,2130,2131],{"name":1951,"slug":1952,"type":16},{"name":2068,"slug":2069,"type":16},{"name":2095,"slug":2096,"type":16},{"name":2071,"slug":2072,"type":16},{"name":2074,"slug":2075,"type":16},"2026-07-12T08:36:36.374512",{"slug":2134,"name":2134,"fn":2135,"description":2136,"org":2137,"tags":2138,"stars":2151,"repoUrl":2152,"updatedAt":2153},"cost-efficiency-analyzer","analyze cost efficiency and expenses","Analyzes cost structure, cost efficiency, and expense management from P&L data. Use when the user asks about costs, expenses, COGS, operating expenses, cost ratios, cost control, spending efficiency, margin compression from cost side, or wants to understand where money is going. Also use for \"are we spending too much\", \"cost breakdown\", \"expense analysis\", or \"how efficient are our operations\". NOT for revenue or top-line analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2139,2142,2145,2148],{"name":2140,"slug":2141,"type":16},"Accounting","accounting",{"name":2143,"slug":2144,"type":16},"Analytics","analytics",{"name":2146,"slug":2147,"type":16},"Cost Optimization","cost-optimization",{"name":2149,"slug":2150,"type":16},"Finance","finance",3176,"https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fagentcore-samples","2026-07-12T08:40:03.29555",{"slug":2155,"name":2155,"fn":2156,"description":2157,"org":2158,"tags":2159,"stars":2151,"repoUrl":2152,"updatedAt":2168},"executive-financial-briefing","generate executive financial briefings","Generates a concise executive-level financial briefing or summary suitable for a CEO, CFO, or board presentation. Use when the user asks for a summary, briefing, executive summary, board update, financial overview, financial health check, or \"how is the business doing\". Covers the full P&L picture in one page. Also use for \"give me the highlights\", \"what do I need to know\", or \"quick financial update\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2160,2161,2162,2165],{"name":1951,"slug":1952,"type":16},{"name":2149,"slug":2150,"type":16},{"name":2163,"slug":2164,"type":16},"Management","management",{"name":2166,"slug":2167,"type":16},"Reporting","reporting","2026-07-12T08:40:02.066471",{"slug":2170,"name":2170,"fn":2171,"description":2172,"org":2173,"tags":2174,"stars":2151,"repoUrl":2152,"updatedAt":2183},"multi-quarter-trend-analysis","analyze multi-quarter financial trends","Analyzes financial trends across multiple quarters by comparing P&L metrics over time. Use when the user wants to see trends, patterns, trajectories, or directional movement across 3 or more quarters. Also use for \"how are we trending\", \"show me the trend\", \"track performance over time\", \"quarter over quarter comparison across all quarters\", or any multi-period longitudinal analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2175,2176,2177,2180],{"name":2143,"slug":2144,"type":16},{"name":2149,"slug":2150,"type":16},{"name":2178,"slug":2179,"type":16},"Financial Statements","financial-statements",{"name":2181,"slug":2182,"type":16},"Variance Analysis","variance-analysis","2026-07-12T08:40:00.79141",{"slug":2185,"name":2185,"fn":2186,"description":2187,"org":2188,"tags":2189,"stars":2151,"repoUrl":2152,"updatedAt":2198},"pdf","process and manipulate PDF documents","Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text\u002Ftables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting\u002Fdecrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2190,2193,2196],{"name":2191,"slug":2192,"type":16},"Automation","automation",{"name":2194,"slug":2195,"type":16},"Documents","documents",{"name":2197,"slug":2185,"type":16},"PDF","2026-07-12T08:41:44.135656",{"slug":2200,"name":2200,"fn":2201,"description":2202,"org":2203,"tags":2204,"stars":2151,"repoUrl":2152,"updatedAt":2211},"quarterly-kpi-calculator","calculate quarterly financial KPIs","Calculates quarterly financial KPIs from P&L data. P&L figures can be provided directly by the user or fetched from the financial data MCP server. Use when the user wants KPI calculations such as Gross Margin %, EBITDA Margin %, Operating Expense Ratio, or Revenue Growth % QoQ. Also use for quarterly performance review, P&L analysis, or interpreting financial ratios against benchmarks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2205,2206,2207,2208],{"name":2140,"slug":2141,"type":16},{"name":14,"slug":15,"type":16},{"name":2149,"slug":2150,"type":16},{"name":2209,"slug":2210,"type":16},"KPI","kpi","2026-07-12T08:39:59.54971",150]