[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6DTA0MQ0CK81DQCTR30894T":3,"skill-same:01M6DTA0MQ0CK81DQCTR30894T":108},{"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":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M6DTA0MQ0CK81DQCTR30894T","bulkrna-batch-correction",null,"Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip single-batch inputs; use sc-batch-integration for single-cell data or spatial-integrate for spatial slices.","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-batch-correction\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"batch","bulkrna batch correction","cell","python","batch-effect","harmonization","ComBat","batch-correction","bulkrna","single-cell","expression","integration","Spatial","Legacy","integrate","use","cohort","effect","data","2026-11-10 10:12:30",false,"---\nname: bulkrna-batch-correction\ndescription: Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip single-batch inputs; use sc-batch-integration for single-cell data or spatial-integrate for spatial slices.\ntrigger: batch correction, ComBat, batch effect, harmonize, multi-cohort, batch removal\ntags:\n- bulkrna\n- batch-correction\n- ComBat\n- harmonization\n- batch-effect\n---\n\n# bulkrna-batch-correction\n\n## When to use\n\nLoad when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip single-batch inputs; use sc-batch-integration for single-cell data or spatial-integrate for spatial slices.\n\n## Use from a step\n\n```python\nfrom skills._sdk.notebook import load_skill, write_output\nlibrary = load_skill(\"bulkrna-batch-correction\")\nresult = library.correct(data, batches=batches, backend=\"python\")\nwrite_output(result, \"tables\u002Fresult.csv\")\nwrite_output(library.pca_figure(result, batches=batches), \"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### `correct(data: pd.DataFrame, *, batches: pd.DataFrame, mode: str='parametric', backend: str='auto') -> pd.DataFrame`\n\nReturn corrected expression, leaving the input unchanged.\n\n:param data: Finite nonnegative expression, features by samples; correction uses this scale directly.\n:param batches: Metadata with sample and batch columns, and optional biological condition.\n:param mode: CLI default parametric, or non-parametric (requires R sva).\n:param backend: auto prefers R as the CLI did; r requires R, python uses the legacy parametric approximation.\n:returns: Corrected DataFrame with run_info diagnostics; values can be negative.\n:raises ValueError: Data, metadata, mode or backend is invalid.\n:raises ImportError: An explicitly requested R backend is unavailable.\n:raises RuntimeError: R fails and the requested mode\u002Fdesign has no Python fallback.\n\n### `run_info(data: pd.DataFrame, *, keep: bool=True) -> dict`\n\nReturn backend diagnostics and before\u002Fafter batch metrics.\n\n:param data: Result of correct.\n:param keep: Keep diagnostics by default; the CLI passes False.\n:returns: Diagnostics dictionary.\n:raises ValueError: No correction diagnostics are attached.\n\n### `pca_figure(data: pd.DataFrame, *, batches: pd.DataFrame)`\n\nPlot PCA after signed log2(1+abs(x)), accepting negative corrections.\n\n:param data: Original or corrected feature-by-sample expression.\n:param batches: Metadata containing sample and batch.\n:returns: Matplotlib Figure.\n:raises ValueError: Samples lack batch metadata.\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- `correct(backend=\"auto\")` prefers R sva and warns\u002Frecords any Python fallback. `backend=\"r\"` requires R. The Python method is the legacy parametric approximation, not numerical equivalence to sva.\n- `correct` requires at least two batches and two samples per batch. Missing labels and single-batch inputs raise before any backend runs.\n- `correct` applies ComBat directly to the supplied scale, not to an automatic log transform. Outputs may be negative and are not integer counts for DESeq2.\n- `correct(mode=\"non-parametric\")` and condition covariates require R; Python cannot silently substitute a different design or mode.\n- `run_info()[\"summary\"]` contains before\u002Fafter PCA silhouette metrics using signed log2(1+abs(x)), so negative corrections remain finite. Inspect condition-by-batch balance before removing effects.\n\n## Inputs and outputs\n\nExpression CSV with feature identifiers in the first column; metadata CSV with sample and batch, plus optional condition.\n\nCLI outputs:\n\n- `tables\u002Fcorrected_expression.csv`\n- `tables\u002Fbatch_metrics.csv`\n- `figures\u002Fpca_before_correction.png`\n- `figures\u002Fpca_after_correction.png`\n- `figures\u002Fbatch_assessment.png`\n- `report.md`, `result.json`\n- `reproducibility\u002Fcommands.sh`\n\n## CLI\n\n```bash\npython skills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002Fbulkrna_batch_correction.py --demo --output \u002Ftmp\u002Fbulkrna_batch_correction_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`, `sva`, `Matrix`\n","# bulkrna-batch-correction\n\n## When to use\n\nLoad when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip single-batch inputs; use sc-batch-integration for single-cell data or spatial-integrate for spatial slices.\n\n## Use from a step\n\n```python\nfrom skills._sdk.notebook import load_skill, write_output\nlibrary = load_skill(\"bulkrna-batch-correction\")\nresult = library.correct(data, batches=batches, backend=\"python\")\nwrite_output(result, \"tables\u002Fresult.csv\")\nwrite_output(library.pca_figure(result, batches=batches), \"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### `correct(data: pd.DataFrame, *, batches: pd.DataFrame, mode: str='parametric', backend: str='auto') -> pd.DataFrame`\n\nReturn corrected expression, leaving the input unchanged.\n\n:param data: Finite nonnegative expression, features by samples; correction uses this scale directly.\n:param batches: Metadata with sample and batch columns, and optional biological condition.\n:param mode: CLI default parametric, or non-parametric (requires R sva).\n:param backend: auto prefers R as the CLI did; r requires R, python uses the legacy parametric approximation.\n:returns: Corrected DataFrame with run_info diagnostics; values can be negative.\n:raises ValueError: Data, metadata, mode or backend is invalid.\n:raises ImportError: An explicitly requested R backend is unavailable.\n:raises RuntimeError: R fails and the requested mode\u002Fdesign has no Python fallback.\n\n### `run_info(data: pd.DataFrame, *, keep: bool=True) -> dict`\n\nReturn backend diagnostics and before\u002Fafter batch metrics.\n\n:param data: Result of correct.\n:param keep: Keep diagnostics by default; the CLI passes False.\n:returns: Diagnostics dictionary.\n:raises ValueError: No correction diagnostics are attached.\n\n### `pca_figure(data: pd.DataFrame, *, batches: pd.DataFrame)`\n\nPlot PCA after signed log2(1+abs(x)), accepting negative corrections.\n\n:param data: Original or corrected feature-by-sample expression.\n:param batches: Metadata containing sample and batch.\n:returns: Matplotlib Figure.\n:raises ValueError: Samples lack batch metadata.\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- `correct(backend=\"auto\")` prefers R sva and warns\u002Frecords any Python fallback. `backend=\"r\"` requires R. The Python method is the legacy parametric approximation, not numerical equivalence to sva.\n- `correct` requires at least two batches and two samples per batch. Missing labels and single-batch inputs raise before any backend runs.\n- `correct` applies ComBat directly to the supplied scale, not to an automatic log transform. Outputs may be negative and are not integer counts for DESeq2.\n- `correct(mode=\"non-parametric\")` and condition covariates require R; Python cannot silently substitute a different design or mode.\n- `run_info()[\"summary\"]` contains before\u002Fafter PCA silhouette metrics using signed log2(1+abs(x)), so negative corrections remain finite. Inspect condition-by-batch balance before removing effects.\n\n## Inputs and outputs\n\nExpression CSV with feature identifiers in the first column; metadata CSV with sample and batch, plus optional condition.\n\nCLI outputs:\n\n- `tables\u002Fcorrected_expression.csv`\n- `tables\u002Fbatch_metrics.csv`\n- `figures\u002Fpca_before_correction.png`\n- `figures\u002Fpca_after_correction.png`\n- `figures\u002Fbatch_assessment.png`\n- `report.md`, `result.json`\n- `reproducibility\u002Fcommands.sh`\n\n## CLI\n\n```bash\npython skills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002Fbulkrna_batch_correction.py --demo --output \u002Ftmp\u002Fbulkrna_batch_correction_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`, `sva`, `Matrix`\n",{"name":5,"tags":42,"trigger":43,"description":7},[26,25,24,23,22],"batch correction, ComBat, batch effect, harmonize, multi-cohort, batch removal","main","90a3bec3e6549bc33dddbf67e4b23869736c49d1","skills\u002Fbulkrna\u002Fbulkrna-batch-correction",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":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add TianGzlab\u002FOmicsClaw --skill bulkrna-batch-correction",{"tool":58,"command":59},"bunx","bunx skills add TianGzlab\u002FOmicsClaw --skill bulkrna-batch-correction",{"tool":61,"command":62},"pnpm","pnpm dlx skills add TianGzlab\u002FOmicsClaw --skill bulkrna-batch-correction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002FSKILL.md",true,[66,72,76,80,86,90,94,98,104],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"_api.py","SCRIPT","脚本",6236,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002F_api.py",{"path":73,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":74,"sourceHtmlUrl":75},"bulkrna_batch_correction.py",11474,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002Fbulkrna_batch_correction.py",{"path":77,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":78,"sourceHtmlUrl":79},"examples\u002Fexample_step.py",892,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002Fexamples\u002Fexample_step.py",{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"index.json","REFERENCE","参考文档",668,"https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Flinux\u002Ffilesystem\u002Fntfs\u002Fusnjrnl\u002Fanalyze\u002Findex.json",{"path":87,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fmethodology.md",1072,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002Freferences\u002Fmethodology.md",{"path":91,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Foutput_contract.md",570,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002Freferences\u002Foutput_contract.md",{"path":95,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fparameters.md",234,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002Freferences\u002Fparameters.md",{"path":99,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"rscripts\u002Fcombat.R","OTHER","其他",749,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002Frscripts\u002Fcombat.R",{"path":105,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":106,"sourceHtmlUrl":107},"tests\u002Ftest_api.py",3336,"https:\u002F\u002Fgithub.com\u002FTianGzlab\u002FOmicsClaw\u002Fblob\u002Fmain\u002Fskills\u002Fbulkrna\u002Fbulkrna-batch-correction\u002Ftests\u002Ftest_api.py",[109,122,134,150,174,195],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":37},"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",[],[116,117,118,119,120,33,121],"demo skill","demo","tests","fixture","fixture skill","environment",{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":37},"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",[],[129,130,131,118,119,132,133],"domains","fake domains","deployment","never","test",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":37},"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",[],[141,142,143,144,145,146,147,148,149],"me","replace me skill","template","directory","skill template","existing skill","new skill","bootstrap","scaffold",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":37},"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",[],[157,158,30,159,160,161,162,163,164,165,166,167,168,169,170,171,172,33,21,173],"velocity","spatial velocity","scvelo","input","starsolo","time","deep","RNA","kb-python","via","velocyto","rna-velocity","velovi","dynamics","upstream","kb","deterministic",{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":180,"publishedAt":37},"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",[],[30,181,182,183,184,185,186,187,166,188,189,190,191,20,157,192,33,193,194,36],"trajectory","spatial trajectory","state","terminal","lineage","diffusion","cellrank","palantir","dpt","pseudotime","probability","default","branch","anndata",{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":199,"categories":200,"keywords":201,"publishedAt":37},"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",[],[202,203,30,166,204,205,206,207,208,209,129,210,211,212,213,33,194,214,215,216],"spatial statistics","statistics","nhood-enrichment","co-occurrence","ripley","geary","moran","neighbourhood","ranking","autocorrelation","local","domain","detection","enrichment","stats"]