[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DTBC9EG8A9GF810HDBKAEG":3,"skill-same:01M6DTBC9EG8A9GF810HDBKAEG":107},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":52,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":54,"install":55,"resources":68},"01M6DTBC9EG8A9GF810HDBKAEG","bulkrna-survival",null,"Load when comparing bulk expression strata against clinical time-to-event data with Kaplan-Meier and log-rank tests. R survival also fits Cox HR; Python reports a descriptive events\u002Fperson-time ratio. Skip missing clinical outcomes.","TianGzlab\u002FOmicsClaw","TianGzlab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F150978281?v=4","01M6DT9WNJJ470ADHPSMFAA02Y","01M6DT9WSN09C5K65GB6RK18R9",161,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"bulkrna survival","bulkrna","clinical","hazard-ratio","Cox","Kaplan-Meier","survival","expression","missing","python","tests","time","reports","log","outcomes","outcome","data","2026-11-10 10:12:30",false,"---\nname: bulkrna-survival\ndescription: Load when comparing bulk expression strata against clinical time-to-event data with Kaplan-Meier and log-rank tests. R survival also fits Cox HR; Python reports a descriptive events\u002Fperson-time ratio. Skip missing clinical outcomes.\ntrigger: survival, Kaplan-Meier, Cox, prognosis, hazard ratio, overall survival, clinical outcome\ntags:\n- bulkrna\n- survival\n- Kaplan-Meier\n- Cox\n- hazard-ratio\n- clinical\n---\n\n# bulkrna-survival\n\n## When to use\n\nLoad when comparing bulk expression strata against clinical time-to-event data with Kaplan-Meier and log-rank tests. R survival also fits Cox HR; Python reports a descriptive events\u002Fperson-time ratio. Skip missing clinical outcomes.\n\n## Use from a step\n\n```python\nfrom skills._sdk.notebook import load_skill, write_output\nlibrary = load_skill(\"bulkrna-survival\")\nresult = library.analyze(data, clinical=clinical, backend=\"python\")\nwrite_output(result, \"tables\u002Fresult.csv\")\nwrite_output(library.curve_figure(result, gene=\"G\"), \"figures\u002Fresult.png\")\n```\n\nRead expression and metadata with `read_input` before calling the library.\n`examples\u002Fexample_step.py` constructs a small synthetic dataset and checks\nits results through the step runner and fresh-kernel replay.\n\n## API\n\n\u003C!-- api:begin generated from _api.py; regenerate with run.py api \u003Cskill dir> --write -->\n\n### `analyze(data: pd.DataFrame, *, clinical: pd.DataFrame, genes: list[str] | None=None, cutoff_method: str='median', backend: str='auto') -> pd.DataFrame`\n\nReturn gene-wise survival comparisons without modifying expression.\n\n:param data: Nonnegative feature-by-sample expression.\n:param clinical: Clinical table with unique sample, nonnegative time and binary event columns.\n:param genes: Genes to test; None uses every row. Missing genes raise.\n:param cutoff_method: CLI default median; optimal scans cuts with unadjusted p-values.\n:param backend: auto prefers R survival with Cox HR, as the CLI did; python uses an events\u002Fperson-time ratio.\n:returns: Per-gene table with diagnostics and KM points attached in attrs.\n:raises ValueError: Identifiers, clinical values, requested genes or comparison groups are invalid.\n:raises ImportError: Explicit R backend lacks survival or Matrix.\n:raises RuntimeError: The requested R method fails or returns incomplete results.\n\n### `run_info(data: pd.DataFrame, *, keep: bool=True) -> dict`\n\nReturn actual backend, HR estimator and summary.\n\n:param data: Result from analyze.\n:param keep: Keep diagnostics by default; the CLI passes False.\n:returns: Diagnostics dictionary.\n:raises ValueError: The table has no analysis diagnostics.\n\n### `km_table(data: pd.DataFrame) -> pd.DataFrame`\n\nReturn the fitted Kaplan-Meier points for both expression strata.\n\n:param data: Result from analyze.\n:returns: New table with gene, group, time and survival columns.\n:raises ValueError: The result lacks stored curves.\n\n### `curve_figure(data: pd.DataFrame, *, gene: str)`\n\nPlot the stored Kaplan-Meier curves for one analyzed gene.\n\n:param data: Result from analyze.\n:param gene: Exact gene identifier in the result.\n:returns: Matplotlib Figure.\n:raises ValueError: No curve exists for the requested gene.\n\n\u003C!-- api:end -->\n\n## Methods and parameters\n\nThe function library returns DataFrames and Figures. The CLI loads the\nsame library and owns reports and file writes. R runs in a temporary\ndirectory using Matrix Market, feature\u002Fsample identifiers and metadata.\nNo R intermediate is a permanent CLI output.\n\n## Gotchas\n\n- `analyze(backend=\"auto\")` prefers R survival, which fits Cox PH hazard ratios. Its Python fallback uses a descriptive events\u002Fperson-time ratio. `run_info()[\"hazard_estimator\"]` distinguishes them.\n- `analyze` raises for missing genes or insufficient high\u002Flow groups; it does not silently deliver a subset of the requested genes.\n- `analyze(cutoff_method=\"optimal\")` scans cutoffs and reports unadjusted p-values. Treat the selected-cutoff test as exploratory.\n- `km_table` exposes both KM curves. Median survival is None when a curve never reaches 0.5; no extrapolated median is invented.\n- `run_info()[\"dropped_expression_samples\"]` reports samples excluded by the expression\u002Fclinical intersection. Clinical IDs must be unique.\n\n## Inputs and outputs\n\nFeature-by-sample expression CSV and a clinical CSV containing unique sample, nonnegative time and binary event.\n\nCLI outputs:\n\n- `tables\u002Fsurvival_results.csv`\n- `figures\u002Fkm_\u003Cgene>.png` per successful gene\n- `figures\u002Fforest_plot.png` when at least two genes succeed\n- `report.md`, `result.json`\n- `reproducibility\u002Fcommands.sh`\n\n## CLI\n\n```bash\npython skills\u002Fbulkrna\u002Fbulkrna-survival\u002Fbulkrna_survival.py --demo --output \u002Ftmp\u002Fbulkrna_survival_demo\n```\n\nRun the script with `--help` for real-input arguments.\n\n## See also\n\n- `references\u002Fparameters.md`\n- `references\u002Fmethodology.md`\n- `references\u002Foutput_contract.md`\n\n## Dependencies\n\n`matplotlib`, `numpy`, `pandas`, `scipy`, `survival`, `Matrix`\n","# bulkrna-survival\n\n## When to use\n\nLoad when comparing bulk expression strata against clinical time-to-event data with Kaplan-Meier and log-rank tests. R survival also fits Cox HR; Python reports a descriptive events\u002Fperson-time ratio. Skip missing clinical outcomes.\n\n## Use from a step\n\n```python\nfrom skills._sdk.notebook import load_skill, write_output\nlibrary = load_skill(\"bulkrna-survival\")\nresult = library.analyze(data, clinical=clinical, backend=\"python\")\nwrite_output(result, \"tables\u002Fresult.csv\")\nwrite_output(library.curve_figure(result, gene=\"G\"), \"figures\u002Fresult.png\")\n```\n\nRead expression and metadata with `read_input` before calling the library.\n`examples\u002Fexample_step.py` constructs a small synthetic dataset and checks\nits results through the step runner and fresh-kernel replay.\n\n## API\n\n\u003C!-- api:begin generated from _api.py; regenerate with run.py api \u003Cskill dir> --write -->\n\n### `analyze(data: pd.DataFrame, *, clinical: pd.DataFrame, genes: list[str] | None=None, cutoff_method: str='median', backend: str='auto') -> pd.DataFrame`\n\nReturn gene-wise survival comparisons without modifying expression.\n\n:param data: Nonnegative feature-by-sample expression.\n:param clinical: Clinical table with unique sample, nonnegative time and binary event columns.\n:param genes: Genes to test; None uses every row. Missing genes raise.\n:param cutoff_method: CLI default median; optimal scans cuts with unadjusted p-values.\n:param backend: auto prefers R survival with Cox HR, as the CLI did; python uses an events\u002Fperson-time ratio.\n:returns: Per-gene table with diagnostics and KM points attached in attrs.\n:raises ValueError: Identifiers, clinical values, requested genes or comparison groups are invalid.\n:raises ImportError: Explicit R backend lacks survival or Matrix.\n:raises RuntimeError: The requested R method fails or returns incomplete results.\n\n### `run_info(data: pd.DataFrame, *, keep: bool=True) -> dict`\n\nReturn actual backend, HR estimator and summary.\n\n:param data: Result from analyze.\n:param keep: Keep diagnostics by default; the CLI passes False.\n:returns: Diagnostics dictionary.\n:raises ValueError: The table has no analysis diagnostics.\n\n### `km_table(data: pd.DataFrame) -> pd.DataFrame`\n\nReturn the fitted Kaplan-Meier points for both expression strata.\n\n:param data: Result from analyze.\n:returns: New table with gene, group, time and survival columns.\n:raises ValueError: The result lacks stored curves.\n\n### `curve_figure(data: pd.DataFrame, *, gene: str)`\n\nPlot the stored Kaplan-Meier curves for one analyzed gene.\n\n:param data: Result from analyze.\n:param gene: Exact gene identifier in the result.\n:returns: Matplotlib Figure.\n:raises ValueError: No curve exists for the requested gene.\n\n\u003C!-- api:end -->\n\n## Methods and parameters\n\nThe function library returns DataFrames and Figures. The CLI loads the\nsame library and owns reports and file writes. R runs in a temporary\ndirectory using Matrix Market, feature\u002Fsample identifiers and metadata.\nNo R intermediate is a permanent CLI output.\n\n## Gotchas\n\n- `analyze(backend=\"auto\")` prefers R survival, which fits Cox PH hazard ratios. Its Python fallback uses a descriptive events\u002Fperson-time ratio. `run_info()[\"hazard_estimator\"]` distinguishes them.\n- `analyze` raises for missing genes or insufficient high\u002Flow groups; it does not silently deliver a subset of the requested genes.\n- `analyze(cutoff_method=\"optimal\")` scans cutoffs and reports unadjusted p-values. Treat the selected-cutoff test as exploratory.\n- `km_table` exposes both KM curves. Median survival is None when a curve never reaches 0.5; no extrapolated median is invented.\n- `run_info()[\"dropped_expression_samples\"]` reports samples excluded by the expression\u002Fclinical intersection. Clinical IDs must be unique.\n\n## Inputs and outputs\n\nFeature-by-sample expression CSV and a clinical CSV containing unique sample, nonnegative time and binary event.\n\nCLI outputs:\n\n- `tables\u002Fsurvival_results.csv`\n- `figures\u002Fkm_\u003Cgene>.png` per successful gene\n- `figures\u002Fforest_plot.png` when at least two genes succeed\n- `report.md`, `result.json`\n- `reproducibility\u002Fcommands.sh`\n\n## CLI\n\n```bash\npython skills\u002Fbulkrna\u002Fbulkrna-survival\u002Fbulkrna_survival.py --demo --output \u002Ftmp\u002Fbulkrna_survival_demo\n```\n\nRun the script with `--help` for real-input arguments.\n\n## See also\n\n- `references\u002Fparameters.md`\n- `references\u002Fmethodology.md`\n- `references\u002Foutput_contract.md`\n\n## Dependencies\n\n`matplotlib`, `numpy`, `pandas`, `scipy`, `survival`, `Matrix`\n",{"name":5,"tags":45,"trigger":46,"description":7},[24,29,28,27,26,25],"survival, Kaplan-Meier, Cox, prognosis, hazard ratio, overall survival, clinical outcome","main","90a3bec3e6549bc33dddbf67e4b23869736c49d1","skills\u002Fbulkrna\u002Fbulkrna-survival",27,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw","https:\u002F\u002FTianGzlab.github.io\u002FOmicsClaw\u002F","https:\u002F\u002Fgithub.com\u002FTianGzlab","2026-10-08 01:36:11",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add TianGzlab\u002FOmicsClaw --skill bulkrna-survival",{"tool":61,"command":62},"bunx","bunx skills add TianGzlab\u002FOmicsClaw --skill bulkrna-survival",{"tool":64,"command":65},"pnpm","pnpm dlx skills add TianGzlab\u002FOmicsClaw --skill bulkrna-survival","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002FSKILL.md",true,[69,75,79,83,89,93,97,103],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"_api.py","SCRIPT","脚本",6617,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002F_api.py",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"bulkrna_survival.py",12643,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Fbulkrna_survival.py",{"path":80,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":81,"sourceHtmlUrl":82},"examples\u002Fexample_step.py",758,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Fexamples\u002Fexample_step.py",{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fmethodology.md","REFERENCE","参考文档",1007,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Freferences\u002Fmethodology.md",{"path":90,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Foutput_contract.md",535,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Freferences\u002Foutput_contract.md",{"path":94,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fparameters.md",253,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Freferences\u002Fparameters.md",{"path":98,"resourceType":99,"resourceTypeDesc":100,"sizeBytes":101,"sourceHtmlUrl":102},"rscripts\u002Fbulkrna_survival.R","OTHER","其他",7280,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Frscripts\u002Fbulkrna_survival.R",{"path":104,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":105,"sourceHtmlUrl":106},"tests\u002Ftest_api.py",1867,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Ftests\u002Ftest_api.py",[108,124,136,153,177,199],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":117,"publishedAt":40},"01M6DTP4X225Q92RMY8XXHPCTT","demo-skill","A fixture skill for the skill environment tests. Use it for nothing else.","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Ftests\u002Fskillenv\u002Ffixtures\u002Fskills\u002Fdemo\u002Fdemo-skill\u002FSKILL.md",[114],{"categoryNo":115,"categoryName":116,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[118,119,33,120,121,122,123],"demo skill","demo","fixture","fixture skill","use","environment",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":40},"01M6DTP28JTWQK3HHXDNQV8BBV","fake-domains","Test fixture for the golden deployment in tests\u002Fentry. Load never; it has no script.","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Ftests\u002Fentry\u002Ffake_skills\u002Fspatial\u002Ffake-domains\u002FSKILL.md",[],[131,132,133,33,120,134,135],"domains","fake domains","deployment","never","test",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":143,"publishedAt":40},"01M6DTNZ4AMWKTME1T18K5C643","replace-me-skill","Load when copying this directory to bootstrap a new OmicsClaw skill. Skip when an existing skill already covers the request.","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Ftemplates\u002Fskill\u002FSKILL.md",[142],{"categoryNo":115,"categoryName":116,"taxonomyType":20,"taxonomyTypeDesc":21},[144,145,146,147,148,149,150,151,152],"me","replace me skill","template","directory","skill template","existing skill","new skill","bootstrap","scaffold",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":40},"01M6DTNV63MTD0Q6YRC52F0B1Y","spatial-velocity","Load when estimating RNA velocity on a spatial AnnData with `layers[\"spliced\"]` + `layers[\"unspliced\"]` via scVelo (stochastic \u002F deterministic \u002F dynamical) or veloVI (deep generative). Skip when input lacks the spliced\u002Funspliced layers (must be quantified upstream by velocyto \u002F kb-python \u002F STARsolo); non-spatial scRNA velocity (use sc-velocity).","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-velocity\u002FSKILL.md",[],[160,161,162,163,164,165,34,166,167,168,169,170,171,172,173,174,175,122,32,176],"velocity","spatial velocity","Spatial","scvelo","input","starsolo","deep","RNA","kb-python","via","velocyto","rna-velocity","velovi","dynamics","upstream","kb","deterministic",{"skillNo":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":183,"publishedAt":40},"01M6DTNPMR227NAT8QFY620YDW","spatial-trajectory","Load when inferring pseudotime \u002F lineage trajectories on a preprocessed spatial AnnData via DPT (default — diffusion pseudotime), CellRank (terminal-state + fate-probability), or Palantir (waypoint branch probabilities). Skip when the data has spliced\u002Funspliced layers and you want velocity-driven dynamics (use spatial-velocity); non-spatial scRNA pseudotime (use sc-pseudotime).","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-trajectory\u002FSKILL.md",[],[162,184,185,186,187,188,189,190,169,191,192,193,194,195,160,196,122,197,198,39],"trajectory","spatial trajectory","state","terminal","lineage","diffusion","cellrank","palantir","dpt","pseudotime","probability","cell","default","branch","anndata",{"skillNo":200,"name":201,"nameZh":6,"description":202,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":203,"categories":204,"keywords":205,"publishedAt":40},"01M6DTNJEYFT33P84DGHDNXW95","spatial-statistics","Load when running spatial autocorrelation \u002F hotspot \u002F co-occurrence \u002F neighbourhood-enrichment \u002F Ripley K stats on a clustered spatial AnnData via squidpy. Skip when ranking spatially variable genes (use spatial-genes); tissue domain detection (use spatial-domains).","https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fspatial\u002Fspatial-statistics\u002FSKILL.md",[],[206,207,162,169,208,209,210,211,212,213,131,214,215,216,217,122,198,218,219,220],"spatial statistics","statistics","nhood-enrichment","co-occurrence","ripley","geary","moran","neighbourhood","ranking","autocorrelation","local","domain","detection","enrichment","stats"]