[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DTBC9EG8A9GF810HDBKAEG":3,"skill-same:01M6DTBC9EG8A9GF810HDBKAEG":102},{"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":17,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":47,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"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",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"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":40,"trigger":41,"description":7},[19,24,23,22,21,20],"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":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add TianGzlab\u002FOmicsClaw --skill bulkrna-survival",{"tool":56,"command":57},"bunx","bunx skills add TianGzlab\u002FOmicsClaw --skill bulkrna-survival",{"tool":59,"command":60},"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,[64,70,74,78,84,88,92,98],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"_api.py","SCRIPT","脚本",6617,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002F_api.py",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"bulkrna_survival.py",12643,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Fbulkrna_survival.py",{"path":75,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":76,"sourceHtmlUrl":77},"examples\u002Fexample_step.py",758,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Fexamples\u002Fexample_step.py",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fmethodology.md","REFERENCE","参考文档",1007,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Freferences\u002Fmethodology.md",{"path":85,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Foutput_contract.md",535,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Freferences\u002Foutput_contract.md",{"path":89,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Fparameters.md",253,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Freferences\u002Fparameters.md",{"path":93,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":96,"sourceHtmlUrl":97},"rscripts\u002Fbulkrna_survival.R","OTHER","其他",7280,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Frscripts\u002Fbulkrna_survival.R",{"path":99,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":100,"sourceHtmlUrl":101},"tests\u002Ftest_api.py",1867,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-survival\u002Ftests\u002Ftest_api.py",[103,116,128,144,168,190],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":35},"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",[],[110,111,28,112,113,114,115],"demo skill","demo","fixture","fixture skill","use","environment",{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":35},"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",[],[123,124,125,28,112,126,127],"domains","fake domains","deployment","never","test",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":35},"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",[],[135,136,137,138,139,140,141,142,143],"me","replace me skill","template","directory","skill template","existing skill","new skill","bootstrap","scaffold",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":35},"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",[],[151,152,153,154,155,156,29,157,158,159,160,161,162,163,164,165,166,114,27,167],"velocity","spatial velocity","Spatial","scvelo","input","starsolo","deep","RNA","kb-python","via","velocyto","rna-velocity","velovi","dynamics","upstream","kb","deterministic",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":35},"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",[],[153,175,176,177,178,179,180,181,160,182,183,184,185,186,151,187,114,188,189,34],"trajectory","spatial trajectory","state","terminal","lineage","diffusion","cellrank","palantir","dpt","pseudotime","probability","cell","default","branch","anndata",{"skillNo":191,"name":192,"nameZh":6,"description":193,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":194,"categories":195,"keywords":196,"publishedAt":35},"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",[],[197,198,153,160,199,200,201,202,203,204,123,205,206,207,208,114,189,209,210,211],"spatial statistics","statistics","nhood-enrichment","co-occurrence","ripley","geary","moran","neighbourhood","ranking","autocorrelation","local","domain","detection","enrichment","stats"]