[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DKSXFFRS2N1XMF91WP9BYD":3,"skill-same:01M7DKSXFFRS2N1XMF91WP9BYD":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":43,"install":44,"resources":57},"01M7DKSXFFRS2N1XMF91WP9BYD","annotate-clusters-by-markers",null,"Reference-free cell-type annotation of clusters from a curated marker panel with scanpy. Signature scores (score_genes) give a z-scored first pass, and the final label is decided on raw log-normalised expression of a few lineage-specific discriminator genes, so lineages that share markers are not mislabelled and clusters with no coherent signal stay Unassigned. Takes a clustered AnnData and writes per-cluster labels with the first-pass call, any correction and its evidence (JSON), a score matrix, a composition table and an annotated h5ad. Use when labelling clusters by markers instead of transferring labels from a reference atlas, when building a marker panel and discriminator table for a tissue, or when a score argmax gives suspicious labels. In AiScientist the built-in run_marker_annotation tool runs this procedure; use the script to change the procedure itself.","lijinbio\u002Faiscientist-skills","lijinbio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F16247242?v=4","01M7DKPQK7Q6V7QXAAPV51Z89N","Jin Li","01M7DKPQM0NMDN3M6XH7Z9AAKM",0,"MIT","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsingle-cell\u002Fannotate-clusters-by-markers\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: annotate-clusters-by-markers\ndescription: Reference-free cell-type annotation of clusters from a curated marker panel with scanpy. Signature scores (score_genes) give a z-scored first pass, and the final label is decided on raw log-normalised expression of a few lineage-specific discriminator genes, so lineages that share markers are not mislabelled and clusters with no coherent signal stay Unassigned. Takes a clustered AnnData and writes per-cluster labels with the first-pass call, any correction and its evidence (JSON), a score matrix, a composition table and an annotated h5ad. Use when labelling clusters by markers instead of transferring labels from a reference atlas, when building a marker panel and discriminator table for a tissue, or when a score argmax gives suspicious labels. In AiScientist the built-in run_marker_annotation tool runs this procedure; use the script to change the procedure itself.\nlicense: MIT\ncompatibility: Python 3.12+ with scanpy and anndata (conda or pip). No GPU, no scheduler.\nmetadata:\n  category: single-cell\n  version: \"1.0.0\"\n  status: community\n  author: \"Yijun Sun\"\n  aliases: \"annotate_clusters_by_markers_v2, annotate_clusters_by_markers\"\n  tags: \"scrna-seq, snrna-seq, cell-type-annotation, marker-genes, scanpy, retina\"\n  tested-with: \"scanpy 1.12.1, anndata 0.12.16, pandas 2.3.3, numpy 2.4.6, Python 3.13.9\"\n  compute: \"1 CPU, under 1 GB RAM (0.3 GB peak), about 2 s for 240 cells x 181 genes\"\n  requires-gpu: \"false\"\n  scheduler: \"none\"\n  requires-network: \"install\"\n  requires-secrets: \"none\"\n---\n\n# Annotate clusters by marker genes\n\n`scripts\u002Freference.py` labels each cluster of a clustered AnnData from a curated marker panel in\nthree steps:\n\n1. score every cell against each lineage's panel with `sc.tl.score_genes` (background-corrected\n   mean), averaged per cluster;\n2. z-score each lineage across clusters and take the argmax, as a **first pass only**;\n3. decide the label on **raw** log-normalised expression of 2–4 lineage-specific discriminator\n   genes, and assign it only when that lineage's own discriminators are the dominant raw signal.\n\nThe most likely mistake is trusting the first pass. Per-lineage z-scoring inflates weak and\nambient signal into confident-looking maxima, so lineages that share markers (RHO\u002FPDE6A across\nrod and cone, SLC1A3 across Müller glia and astrocyte) get mislabelled by the argmax alone. The\nsecond most likely mistake is the panel itself: the labels are only as good as the panel, and the\nbundled one is **human retina**.\n\nTested on synthetic data only (`tests\u002F`: six clusters of 40 cells, 181 genes; rod, cone, Müller\nglia with a weak reactive GFAP\u002FS100B signal that the z-scored first pass calls astrocyte,\nmicroglia that also express Müller-panel genes, a cluster with no coherent signal, and pericytes)\nwith scanpy 1.12.1, anndata 0.12.16, pandas 2.3.3, numpy 2.4.6 and Python 3.13.9. The tests check\nthat the raw check overrules the astrocyte call and records it as a correction, that the noise\ncluster stays `Unassigned`, and that markers are found in `.raw` when `X` holds only variable\ngenes. It supersedes AiScientist's v1 template (`annotate_clusters_by_markers`).\n\n## Why not count marker genes among the top DE genes\n\nThe v1 procedure counted how many of a cluster's top-25 DE genes appeared in each marker list and\ntook the argmax. Both of its flaws produce confident wrong labels rather than visible failures:\n\n- **A set intersection throws away expression.** A gene either is or isn't in the top 25, so a\n  lineage with 3 weakly detected markers beats one with 2 strongly expressed ones.\n- **It cannot handle shared markers.** `LAMP3` is in both the AT2 and dendritic-cell panels;\n  `PDPN` is in both AT1 and lymphatic endothelium. Whichever list overlaps by one more gene wins,\n  and nothing in the procedure can notice the ambiguity.\n\n## The rule that decides the label\n\nSignature scores alone will mislabel shared-marker lineages, so the final label comes from raw\nexpression of a few discriminators. Two consequences are part of the rule, not optional\nrefinements:\n\n- A cluster whose first-pass call and raw check disagree is **reported as a correction**, with\n  both calls kept in the output. That disagreement is evidence about the data; keeping only the\n  winner destroys it.\n- A cluster with no coherent dominant signal is **`Unassigned`**: likely low quality or a\n  doublet. Do not force a label onto it.\n\nA cluster is labelled only if its best lineage's discriminator mean is at least\n`MIN_DISCRIMINATOR_MEAN` **and** at least `DOMINANCE_RATIO` times the runner-up lineage's. A\nwinner that barely edges out the runner-up is exactly the shared-marker case. Confidence is\n`high` when the winning mean is at least twice the floor, `medium` otherwise, `none` for\n`Unassigned`.\n\n## When to use it\n\nMarker-based (manual) annotation of a clustered object. For label transfer against an annotated\nreference atlas, use a reference-based method (such as scGPT) instead.\n\n**Annotate per tissue, not across tissues.** Tissue of origin is the dominant axis of variation,\nso one global clustering of a multi-tissue object separates by tissue and washes out\nintra-tissue subtypes, and each tissue needs its own panel. Split first, run per tissue.\n\n**Choose the clustering resolution first.** Labels inherit whatever partition they are given, so\na default resolution is an unexamined assumption in every downstream label. Sweep candidate\nresolutions, measure bootstrap stability (mean ARI over resampled re-clusterings), and take the\nfinest resolution that still reproduces; then check that it separates the panel's major lineages.\nIn AiScientist, `run_clustering` with `select_resolution: true` does this, writes\n`tables\u002Fresolution_sweep.csv` and reports `resolution_source`; quote it.\n\n## 1. Environment setup\n\n```bash\nmamba create -y -n scanpy_1.12 -c conda-forge python=3.13 scanpy=1.12.1 anndata=0.12.16\nsource \"$(conda info --base)\u002Fetc\u002Fprofile.d\u002Fconda.sh\"\nconda activate scanpy_1.12\npython -c \"import scanpy; print(scanpy.__version__)\"\n```\n\nInside an AiScientist run, the analysis image already has scanpy.\n\n## 2. Prepare inputs\n\n- `$AISCIENTIST_WORK\u002Fadata_de.h5ad`: a clustered AnnData with the cluster labels in an `obs`\n  column (`leiden` by default) and log-normalised expression. The file name is the checkpoint\n  AiScientist's DE step writes; standalone, save your clustered object under that name. Its\n  `rank_genes_groups` results are not used.\n- If `.raw` is present, the script scores and checks markers there (the full log-normalised\n  matrix, set before subsetting to highly variable genes), so every panel gene is visible, not\n  only the genes clustering ran on. Without `.raw` it uses `X`; make sure `X` then holds all\n  genes, log-normalised.\n- `$AISCIENTIST_ARTIFACTS` is where the tables go (`tables\u002F` is created).\n\nGene symbols must match the object's namespace and case: the bundled panel is human\n(`RHO`, `GLUL`); a mouse object needs `Rho`, `Glul`. Panel genes absent from the object are\ndropped and listed, and a lineage with no detected marker cannot be called at all.\n\n## 3. Configure\n\nEdit the CONFIG block at the top of the script:\n\n| Variable | Meaning | Default |\n| --- | --- | --- |\n| `CLUSTER_KEY` | the `obs` column with the clusters | `leiden` |\n| `MIN_DISCRIMINATOR_MEAN` | absolute floor for the winning lineage's discriminator mean | `0.20` |\n| `DOMINANCE_RATIO` | how many times the runner-up the winner must reach | `1.5` |\n| `PANEL` | lineage to full marker list, used for signature scoring; keys are the labels | human retina, 13 lineages |\n| `DISCRIMINATORS` | lineage to the 2–4 specific genes that settle a contested cluster | human retina |\n\nBoth thresholds are deliberately visible knobs. On a shallow snRNA-seq object the absolute floor\nhas to come down, and loosening it is a decision to state in the report.\n\n**Replace `PANEL` and `DISCRIMINATORS` with your tissue's markers.** Search the literature for\nthe canonical markers of the tissue in hand rather than reusing a panel from another tissue or\nwriting one from memory, and record where the panel came from.\n\n**Building the discriminator table.** For every lineage in `PANEL`, `DISCRIMINATORS` needs the\ngenes specific enough to settle a contested cluster, not the whole panel. The useful pattern is\n\"gene X is in two panels, gene Y is in only one\": drop X, keep Y. A gene that appears in two\npanels cannot discriminate between them, so it stays in `PANEL` for scoring but leaves\n`DISCRIMINATORS`. The bundled retina table:\n\n| Lineage | Confirm with (dominant raw signal) | False positive it overrides |\n| --- | --- | --- |\n| Rod photoreceptor | RHO \u002F NRL \u002F GNAT1 | cone (shared phototransduction genes) |\n| Cone photoreceptor | ARR3 \u002F PDE6H \u002F GNAT2 | rod |\n| Muller glia | RLBP1 \u002F GLUL | astrocyte (shared SLC1A3) |\n| Retinal astrocyte | GFAP \u002F PAX2 | Muller glia |\n| Microglia | C1QA \u002F P2RY12 \u002F CX3CR1 | infiltrating macrophage |\n| Vascular endothelium | PECAM1 \u002F VWF \u002F CLDN5 | — |\n| Lymphatic endothelium | PROX1 \u002F CCL21 (PECAM1 also present) | vascular endothelium |\n\nReplace the whole table for a different tissue: the shape transfers, not the genes.\n\n## 4. Run\n\n```bash\nexport AISCIENTIST_WORK=\u002Fpath\u002Fto\u002Fwork AISCIENTIST_ARTIFACTS=\u002Fpath\u002Fto\u002Fresults\npython scripts\u002Freference.py\n```\n\nIn AiScientist: prefer the `run_marker_annotation` tool, which implements this procedure and\ntakes `panel` and `discriminators`, so the panel is the only thing to get right. Use the script\nonly to change the procedure (a different first pass, an extra confirmation step): read it with\n`read_skill_reference`, replace `PANEL` and `DISCRIMINATORS`, and run it with `run_code`, which\nsets both variables.\n\nOutputs:\n\n| Path | Contents |\n| --- | --- |\n| `tables\u002Fcluster_cell_types.json` | per cluster: final label, first-pass label, whether the raw check corrected it, discriminator mean, runner-up and its mean, confidence, evidence; plus untestable lineages, absent panel genes, corrected and unassigned clusters, thresholds |\n| `tables\u002Fcelltype_scores_by_cluster.csv` | the raw (un-z-scored) signature score matrix, cluster by lineage |\n| `tables\u002Fcelltype_composition.csv` | cells and percentage per final label |\n| `$AISCIENTIST_WORK\u002Fadata_annotated.h5ad` | `obs[\"cell_type\"]` and `obs[\"cluster_note\"]` (the evidence string) |\n\n`\u002F` in score column names (`score_Pericyte\u002FSMC`) is replaced by `_` before writing, because h5py\nrejects it.\n\n## 5. Validate before using the output\n\n1. `lineages_not_testable` and `panel_genes_absent_from_object` in the printed summary: a\n   lineage with no detected marker could not have been called. Many absent genes usually mean a\n   species or case mismatch (`RHO` against a mouse object).\n2. `corrected_by_raw_check`: read each correction's `first_pass_label`, `runner_up` and\n   `evidence`. A correction is expected for shared-marker lineages; many corrections suggest the\n   panel's scoring genes are not specific.\n3. `unassigned`: check each cluster's size and its top DE genes. A large `Unassigned` cluster can\n   be a lineage missing from the panel, not only low-quality cells or doublets.\n4. `confidence: medium` labels sit close to the floor; check their discriminator means against\n   the other clusters in `celltype_scores_by_cluster.csv`.\n5. Known biology: the labels should account for the major cell types expected in the tissue, in\n   plausible proportions (`celltype_composition.csv`).\n\n## Report\n\nState the panel and its source, the clustering resolution and how it was chosen, the two\nthresholds (and why, if changed), every cluster the raw check corrected (first-pass and final\nlabel), and every cluster left `Unassigned` with its size. An annotation whose corrections and\nunassigned clusters are not stated cannot be reviewed.\n","# Annotate clusters by marker genes\n\n`scripts\u002Freference.py` labels each cluster of a clustered AnnData from a curated marker panel in\nthree steps:\n\n1. score every cell against each lineage's panel with `sc.tl.score_genes` (background-corrected\n   mean), averaged per cluster;\n2. z-score each lineage across clusters and take the argmax, as a **first pass only**;\n3. decide the label on **raw** log-normalised expression of 2–4 lineage-specific discriminator\n   genes, and assign it only when that lineage's own discriminators are the dominant raw signal.\n\nThe most likely mistake is trusting the first pass. Per-lineage z-scoring inflates weak and\nambient signal into confident-looking maxima, so lineages that share markers (RHO\u002FPDE6A across\nrod and cone, SLC1A3 across Müller glia and astrocyte) get mislabelled by the argmax alone. The\nsecond most likely mistake is the panel itself: the labels are only as good as the panel, and the\nbundled one is **human retina**.\n\nTested on synthetic data only (`tests\u002F`: six clusters of 40 cells, 181 genes; rod, cone, Müller\nglia with a weak reactive GFAP\u002FS100B signal that the z-scored first pass calls astrocyte,\nmicroglia that also express Müller-panel genes, a cluster with no coherent signal, and pericytes)\nwith scanpy 1.12.1, anndata 0.12.16, pandas 2.3.3, numpy 2.4.6 and Python 3.13.9. The tests check\nthat the raw check overrules the astrocyte call and records it as a correction, that the noise\ncluster stays `Unassigned`, and that markers are found in `.raw` when `X` holds only variable\ngenes. It supersedes AiScientist's v1 template (`annotate_clusters_by_markers`).\n\n## Why not count marker genes among the top DE genes\n\nThe v1 procedure counted how many of a cluster's top-25 DE genes appeared in each marker list and\ntook the argmax. Both of its flaws produce confident wrong labels rather than visible failures:\n\n- **A set intersection throws away expression.** A gene either is or isn't in the top 25, so a\n  lineage with 3 weakly detected markers beats one with 2 strongly expressed ones.\n- **It cannot handle shared markers.** `LAMP3` is in both the AT2 and dendritic-cell panels;\n  `PDPN` is in both AT1 and lymphatic endothelium. Whichever list overlaps by one more gene wins,\n  and nothing in the procedure can notice the ambiguity.\n\n## The rule that decides the label\n\nSignature scores alone will mislabel shared-marker lineages, so the final label comes from raw\nexpression of a few discriminators. Two consequences are part of the rule, not optional\nrefinements:\n\n- A cluster whose first-pass call and raw check disagree is **reported as a correction**, with\n  both calls kept in the output. That disagreement is evidence about the data; keeping only the\n  winner destroys it.\n- A cluster with no coherent dominant signal is **`Unassigned`**: likely low quality or a\n  doublet. Do not force a label onto it.\n\nA cluster is labelled only if its best lineage's discriminator mean is at least\n`MIN_DISCRIMINATOR_MEAN` **and** at least `DOMINANCE_RATIO` times the runner-up lineage's. A\nwinner that barely edges out the runner-up is exactly the shared-marker case. Confidence is\n`high` when the winning mean is at least twice the floor, `medium` otherwise, `none` for\n`Unassigned`.\n\n## When to use it\n\nMarker-based (manual) annotation of a clustered object. For label transfer against an annotated\nreference atlas, use a reference-based method (such as scGPT) instead.\n\n**Annotate per tissue, not across tissues.** Tissue of origin is the dominant axis of variation,\nso one global clustering of a multi-tissue object separates by tissue and washes out\nintra-tissue subtypes, and each tissue needs its own panel. Split first, run per tissue.\n\n**Choose the clustering resolution first.** Labels inherit whatever partition they are given, so\na default resolution is an unexamined assumption in every downstream label. Sweep candidate\nresolutions, measure bootstrap stability (mean ARI over resampled re-clusterings), and take the\nfinest resolution that still reproduces; then check that it separates the panel's major lineages.\nIn AiScientist, `run_clustering` with `select_resolution: true` does this, writes\n`tables\u002Fresolution_sweep.csv` and reports `resolution_source`; quote it.\n\n## 1. Environment setup\n\n```bash\nmamba create -y -n scanpy_1.12 -c conda-forge python=3.13 scanpy=1.12.1 anndata=0.12.16\nsource \"$(conda info --base)\u002Fetc\u002Fprofile.d\u002Fconda.sh\"\nconda activate scanpy_1.12\npython -c \"import scanpy; print(scanpy.__version__)\"\n```\n\nInside an AiScientist run, the analysis image already has scanpy.\n\n## 2. Prepare inputs\n\n- `$AISCIENTIST_WORK\u002Fadata_de.h5ad`: a clustered AnnData with the cluster labels in an `obs`\n  column (`leiden` by default) and log-normalised expression. The file name is the checkpoint\n  AiScientist's DE step writes; standalone, save your clustered object under that name. Its\n  `rank_genes_groups` results are not used.\n- If `.raw` is present, the script scores and checks markers there (the full log-normalised\n  matrix, set before subsetting to highly variable genes), so every panel gene is visible, not\n  only the genes clustering ran on. Without `.raw` it uses `X`; make sure `X` then holds all\n  genes, log-normalised.\n- `$AISCIENTIST_ARTIFACTS` is where the tables go (`tables\u002F` is created).\n\nGene symbols must match the object's namespace and case: the bundled panel is human\n(`RHO`, `GLUL`); a mouse object needs `Rho`, `Glul`. Panel genes absent from the object are\ndropped and listed, and a lineage with no detected marker cannot be called at all.\n\n## 3. Configure\n\nEdit the CONFIG block at the top of the script:\n\n| Variable | Meaning | Default |\n| --- | --- | --- |\n| `CLUSTER_KEY` | the `obs` column with the clusters | `leiden` |\n| `MIN_DISCRIMINATOR_MEAN` | absolute floor for the winning lineage's discriminator mean | `0.20` |\n| `DOMINANCE_RATIO` | how many times the runner-up the winner must reach | `1.5` |\n| `PANEL` | lineage to full marker list, used for signature scoring; keys are the labels | human retina, 13 lineages |\n| `DISCRIMINATORS` | lineage to the 2–4 specific genes that settle a contested cluster | human retina |\n\nBoth thresholds are deliberately visible knobs. On a shallow snRNA-seq object the absolute floor\nhas to come down, and loosening it is a decision to state in the report.\n\n**Replace `PANEL` and `DISCRIMINATORS` with your tissue's markers.** Search the literature for\nthe canonical markers of the tissue in hand rather than reusing a panel from another tissue or\nwriting one from memory, and record where the panel came from.\n\n**Building the discriminator table.** For every lineage in `PANEL`, `DISCRIMINATORS` needs the\ngenes specific enough to settle a contested cluster, not the whole panel. The useful pattern is\n\"gene X is in two panels, gene Y is in only one\": drop X, keep Y. A gene that appears in two\npanels cannot discriminate between them, so it stays in `PANEL` for scoring but leaves\n`DISCRIMINATORS`. The bundled retina table:\n\n| Lineage | Confirm with (dominant raw signal) | False positive it overrides |\n| --- | --- | --- |\n| Rod photoreceptor | RHO \u002F NRL \u002F GNAT1 | cone (shared phototransduction genes) |\n| Cone photoreceptor | ARR3 \u002F PDE6H \u002F GNAT2 | rod |\n| Muller glia | RLBP1 \u002F GLUL | astrocyte (shared SLC1A3) |\n| Retinal astrocyte | GFAP \u002F PAX2 | Muller glia |\n| Microglia | C1QA \u002F P2RY12 \u002F CX3CR1 | infiltrating macrophage |\n| Vascular endothelium | PECAM1 \u002F VWF \u002F CLDN5 | — |\n| Lymphatic endothelium | PROX1 \u002F CCL21 (PECAM1 also present) | vascular endothelium |\n\nReplace the whole table for a different tissue: the shape transfers, not the genes.\n\n## 4. Run\n\n```bash\nexport AISCIENTIST_WORK=\u002Fpath\u002Fto\u002Fwork AISCIENTIST_ARTIFACTS=\u002Fpath\u002Fto\u002Fresults\npython scripts\u002Freference.py\n```\n\nIn AiScientist: prefer the `run_marker_annotation` tool, which implements this procedure and\ntakes `panel` and `discriminators`, so the panel is the only thing to get right. Use the script\nonly to change the procedure (a different first pass, an extra confirmation step): read it with\n`read_skill_reference`, replace `PANEL` and `DISCRIMINATORS`, and run it with `run_code`, which\nsets both variables.\n\nOutputs:\n\n| Path | Contents |\n| --- | --- |\n| `tables\u002Fcluster_cell_types.json` | per cluster: final label, first-pass label, whether the raw check corrected it, discriminator mean, runner-up and its mean, confidence, evidence; plus untestable lineages, absent panel genes, corrected and unassigned clusters, thresholds |\n| `tables\u002Fcelltype_scores_by_cluster.csv` | the raw (un-z-scored) signature score matrix, cluster by lineage |\n| `tables\u002Fcelltype_composition.csv` | cells and percentage per final label |\n| `$AISCIENTIST_WORK\u002Fadata_annotated.h5ad` | `obs[\"cell_type\"]` and `obs[\"cluster_note\"]` (the evidence string) |\n\n`\u002F` in score column names (`score_Pericyte\u002FSMC`) is replaced by `_` before writing, because h5py\nrejects it.\n\n## 5. Validate before using the output\n\n1. `lineages_not_testable` and `panel_genes_absent_from_object` in the printed summary: a\n   lineage with no detected marker could not have been called. Many absent genes usually mean a\n   species or case mismatch (`RHO` against a mouse object).\n2. `corrected_by_raw_check`: read each correction's `first_pass_label`, `runner_up` and\n   `evidence`. A correction is expected for shared-marker lineages; many corrections suggest the\n   panel's scoring genes are not specific.\n3. `unassigned`: check each cluster's size and its top DE genes. A large `Unassigned` cluster can\n   be a lineage missing from the panel, not only low-quality cells or doublets.\n4. `confidence: medium` labels sit close to the floor; check their discriminator means against\n   the other clusters in `celltype_scores_by_cluster.csv`.\n5. Known biology: the labels should account for the major cell types expected in the tissue, in\n   plausible proportions (`celltype_composition.csv`).\n\n## Report\n\nState the panel and its source, the clustering resolution and how it was chosen, the two\nthresholds (and why, if changed), every cluster the raw check corrected (first-pass and final\nlabel), and every cluster left `Unassigned` with its size. An annotation whose corrections and\nunassigned clusters are not stated cannot be reviewed.\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":36},{"tags":25,"author":26,"status":27,"aliases":28,"compute":29,"version":30,"category":31,"scheduler":32,"tested-with":33,"requires-gpu":34,"requires-network":35,"requires-secrets":32},"scrna-seq, snrna-seq, cell-type-annotation, marker-genes, scanpy, retina","Yijun Sun","community","annotate_clusters_by_markers_v2, annotate_clusters_by_markers","1 CPU, under 1 GB RAM (0.3 GB peak), about 2 s for 240 cells x 181 genes","1.0.0","single-cell","none","scanpy 1.12.1, anndata 0.12.16, pandas 2.3.3, numpy 2.4.6, Python 3.13.9","false","install","Python 3.12+ with scanpy and anndata (conda or pip). No GPU, no scheduler.","main","5c42aa74b19348cb68aa35301eba042a737d94d4","skills\u002Fsingle-cell\u002Fannotate-clusters-by-markers",2,"https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills","https:\u002F\u002Fgithub.com\u002Flijinbio","2026-11-14 05:44:08",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add lijinbio\u002Faiscientist-skills --skill annotate-clusters-by-markers",{"tool":50,"command":51},"bunx","bunx skills add lijinbio\u002Faiscientist-skills --skill annotate-clusters-by-markers",{"tool":53,"command":54},"pnpm","pnpm dlx skills add lijinbio\u002Faiscientist-skills --skill annotate-clusters-by-markers","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsingle-cell\u002Fannotate-clusters-by-markers\u002FSKILL.md",true,[58,64],{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"scripts\u002Freference.py","SCRIPT","脚本",8766,"https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsingle-cell\u002Fannotate-clusters-by-markers\u002Fscripts\u002Freference.py",{"path":65,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":66,"sourceHtmlUrl":67},"tests\u002Ftest_annotate_clusters_by_markers.py",5354,"https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fsingle-cell\u002Fannotate-clusters-by-markers\u002Ftests\u002Ftest_annotate_clusters_by_markers.py",[69,76,83,90,97,104],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7DKZPCPYM78N1R0MVAVVYKT","verb-object-with-tool","One or two sentences on what the skill does and when to use it. Name the tool, the input it takes and the output it produces, then list the situations that should trigger it (for example \"Use when setting up X, writing a Y config, or diagnosing a failed Z run\").","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Ftemplate\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7DKZCJMFJJB9ZH9YGCSQHR5","write-variant-tables","Write the five standard variant-annotation result tables - consequence, impact and ClinVar-significance distributions, a ClinVar pathogenic and likely-pathogenic list, and a shortlist of rare, damaging variants not in ClinVar - plus a JSON summary, from an annotated per-variant TSV (VEP consequence and impact, SIFT, PolyPhen, max population AF, rsID, ClinVar significance), in pure Python without re-parsing the VCF or re-running VEP. Use when a study needs these tables with a different rarity cutoff, impact set or damaging-predictor rule, or when rebuilding them from an existing annotation table. In AiScientist, annotate_variants already writes the default tables, so use this only for a custom cut.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Fwrite-variant-tables\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7DKZ3R4E6JEJT3YB6AHXE60","rank-phenotype-differentials-with-mcp","Map clinical phenotype text to grounded HPO terms and rank a research differential through an already configured phenotype-diagnosis MCP service with LIRICAL and optional literature adjudication. Use for explicit service-based analysis while preserving negation, uncertainty and original probabilities; retain the established workflow when the service is unavailable.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Frank-phenotype-differentials-with-mcp\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7DKYS9R4F5EPCMDHSH3TEZ7","qc-vcf-callset","Judge whether a germline VCF callset is trustworthy before interpreting any variant - Ti\u002FTv, Het\u002FHom, SNP, indel and multiallelic counts, sample count and genotype call rate from bcftools stats (falling back to cyvcf2, then to a plain-Python Ti\u002FTv scan) - and flag values outside the expected human WGS or WES ranges. Writes tables\u002Fvcf_qc_summary.csv and data\u002Fvcf_qc.json with a qc_flags list. Use when a VCF (one sample or a cohort) arrives for annotation or prioritization, when a Ti\u002FTv or Het\u002FHom value needs interpreting, or when deciding whether downstream variant tables must carry a low-confidence caveat.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Fqc-vcf-callset\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7DKYDRBFTBS2J58QMB7SMHK","prioritize-clinical-variants","Rank annotated variants into research-triage tiers (ClinVar pathogenic, likely pathogenic, VUS favouring pathogenic, VUS, likely benign, benign) from ClinVar significance used verbatim, gnomAD allele frequency against a dominant or recessive disease-model cutoff and the ACMG BA1 5 percent rule, and in-silico predictors (SIFT, PolyPhen, REVEL, CADD, AlphaMissense) as supporting evidence only. Pure Python; reads a per-variant annotation TSV and writes a tier-sorted CSV with the evidence for each tier plus a JSON of tier counts. Use when a rare-variant list from VEP, ClinVar and gnomAD annotation must be ordered for review (which variants to look at first) or when choosing the disease model and cutoffs for that ordering. Research triage only, NOT a clinical ACMG\u002FAMP classification.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Fprioritize-clinical-variants\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7DKY2XPCQ2S639KTPSAJ170","normalize-vcf-with-bcftools","Normalize a VCF with bcftools norm before annotation or ClinVar\u002FgnomAD matching - split multiallelic sites into biallelic records, atomize MNPs into SNPs, then left-align and trim indels against the reference FASTA of the same build - writing an indexed normalized.vcf.gz and a JSON of record counts before and after. Use when a VCF not known to be normalized (especially an indel-heavy one) will be matched against ClinVar, gnomAD or dbSNP, compared between callers or loaded into PLINK, or when a known pathogenic indel comes back as not in ClinVar. In AiScientist, the offline annotate_variants path already normalizes, so do not plan it as a separate step there.","https:\u002F\u002Fgithub.com\u002Flijinbio\u002Faiscientist-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvariants\u002Fnormalize-vcf-with-bcftools\u002FSKILL.md",[],[]]