技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
combining-data【数据与研究】Combine AnnData objects in memory or on disk with concat, concat_on_disk, AnnCollection, merge strategies, batch labels, duplicate-name handling, and lazy collection guidance.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the task is to stack, merge, batch-label, lazily view, or write a combined result from multiple AnnData inputs. Typical prompts mention anndata.concat, partially overlapping genes, preserving dataset labels, duplicate observation names, .uns conflicts, .obsp/.varp pairwise arrays, memory pressure, experimental.concat_on_disk, experimental.AnnCollection, or loader-style access across batches.
references/api-reference.md for verified signatures and a parameter decision table for anndata.concat, anndata.experimental.concat_on_disk, and anndata.experimental.AnnCollection.references/concat-workflows.md for recipes covering inner/outer joins, labels and keys, recursive .uns merging, pairwise arrays, on-disk concat, and lazy collections.references/troubleshooting.md for duplicate names, mapping/keys conflicts, outer-join fill surprises, unsupported on-disk pairwise concat, AnnCollection variable mismatches, and memory pressure.scripts/plan_anndata_concat.py to turn simple JSON batch metadata into recommended concat parameters and risk warnings.AnnData objects, a mapping of named objects, file paths/stores for .h5ad or Zarr, or a need for lazy mini-batch access.axis="obs" stacks observations and aligns variables; axis="var" stacks variables and aligns observations.join: join="inner" keeps only shared labels on the non-concatenated axis; join="outer" keeps the union and introduces filled values.keys, plus label="batch" or another categorical column name.index_unique="-" when original indexes may overlap.merge and uns_merge: start with "same" for conservative shared metadata or "unique" for non-conflicting metadata; avoid "first" unless first-input-wins is intentional.pairwise=False unless block-diagonal .obsp or .varp arrays with zero cross-batch blocks are meaningful.anndata.concat for loaded objects, experimental.concat_on_disk for large existing stores, and experimental.AnnCollection for lazy observation-axis access.AnnData objects before combining, route to ../data-model/SKILL.md..h5ad or Zarr files, backed/lazy file lifecycle, or storage-format details around on-disk concat, route to ../storage-io/SKILL.md.AnnLoader requires optional PyTorch support and is deprecated in favor of annbatch.Loader; prefer AnnCollection guidance here and route PyTorch loader migration decisions outside this sub-skill.