界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

io-metadata

io-metadata

【数据与研究】Use scikit-bio IO registry formats and metadata objects for reading, writing, validation, and serialization.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: io-metadata description: "Use scikit-bio IO registry formats and metadata objects for reading, writing, validation, and serialization." disable-model-invocation: true metadata: disco-role: operating license: BSD 3-Clause

scikit-bio IO and Metadata

Use this sub-skill when a task involves skbio.io.read, skbio.io.write, skbio.io.sniff, object-oriented .read() / .write(), supported file formats, QIIME-style sample metadata, metadata column validation, missing-value schemes, or interval metadata serialization.

Route Here For

  • Reading or writing FASTA, FASTQ, Newick, GFF3, GenBank, EMBL, CLUSTAL, PHYLIP, BIOM, ordination, distance-matrix, BLAST, taxonomy dump, embedding, Stockholm, QSeq, LSMat, or sample metadata files.
  • Choosing between procedural I/O (skbio.io.read(file, format=..., into=...)) and object-oriented I/O (SomeClass.read(file, format=...), obj.write(file, format=...)).
  • Streaming sequence records from large files or writing generators without loading a full object into memory.
  • Diagnosing format sniffing, UnrecognizedFormatError, FileFormatError, format-specific parse errors, compression/filehandle caveats, and reader/writer route mismatches.
  • Constructing, loading, saving, filtering, merging, and converting SampleMetadata, MetadataColumn, NumericMetadataColumn, and CategoricalMetadataColumn objects.
  • Validating sample/feature metadata ID headers, directives, duplicate IDs/columns, column types, and missing-data schemes.
  • Creating or attaching Interval and IntervalMetadata objects, especially for GFF3, GenBank, and EMBL feature annotations.

Start With

  • references/format-reference.md for supported formats, registry patterns, read/write routes, streaming, sniffing, and custom-format extension guidance.
  • references/metadata-reference.md for SampleMetadata, metadata columns, missing schemes, dataframe conversion, filtering, merging, ID-header rules, and interval metadata.
  • references/troubleshooting.md for compact diagnosis and repair patterns covering the common IO and metadata failures.
  • scripts/io_metadata_smoke.py for a deterministic public-API smoke check that reads/writes a Newick tree, streams FASTA records, builds sample metadata, and prints JSON.

Boundaries

  • For sequence construction, sequence validation, TabularMSA manipulation, alignment, translation, or per-sequence metadata after records are read, use ../sequences-alignment/SKILL.md.
  • For TreeNode editing, rooting, comparison, or phylogenetic algorithms after Newick parsing, use ../trees-phylogeny/SKILL.md.
  • For diversity metrics, BIOM-like count table analysis, distance-matrix statistics, or ordination interpretation after files are read, use ../diversity-tables/SKILL.md and ../statistics-ordination/SKILL.md when present.
  • Keep this sub-skill focused on serialization, registry route selection, metadata validation, metadata object transformations, and interval annotation attachment.
  • Do not depend on source repository examples, fixtures, or docs at runtime; the references and smoke script here are self-contained.

Quick Sanity Check

From any working directory with scikit-bio and its runtime dependencies installed, run:

python /path/to/skills/scikit-bio/sub-skills/io-metadata/scripts/io_metadata_smoke.py

The script also supports --help and --indent. It imports only public scikit-bio APIs, uses StringIO inputs, catches common import/format/metadata exceptions, and prints compact JSON on success.

我的收藏