Loading...
Loading...
Compare original and translation side by side
Note: This is an Example SkillThis skill demonstrates how skills can support your data engineering tasks—automating schema transformations, parsing instrument outputs, and generating production-ready code.To customize for your organization:
- Modify the
files to include your company's specific schemas or ontology mappingsreferences/- Use an MCP server to connect to systems that define your schemas (e.g., your LIMS, data catalog, or schema registry)
- Extend the
to handle proprietary instrument formats or internal data standardsscripts/This pattern can be adapted for any data transformation workflow where you need to convert between formats or validate against organizational standards.
注意:这是一个示例技能本技能展示了技能如何支持你的数据工程任务——自动化 schema 转换、解析仪器输出,以及生成可用于生产环境的代码。为你的组织自定义:
- 修改
文件夹中的文件,加入公司特定的 schema 或本体映射references/- 使用MCP服务器连接定义你方 schema 的系统(如LIMS、数据目录或schema注册中心)
- 扩展
脚本以处理专有仪器格式或内部数据标准scripts/此模式可适配任何需要在格式间转换或根据组织标准验证的数据转换工作流。
When Uncertain: If you're unsure how to map a field to ASM (e.g., is this raw data or calculated? device setting or environmental condition?), ask the user for clarification. Refer tofor guidance, but when ambiguity remains, confirm with the user rather than guessing.references/field_classification_guide.md
存在疑问时: 如果你不确定如何将某个字段映射到ASM(例如:这是原始数据还是计算值?是设备设置还是环境条件?),请向用户确认。可参考获取指导,但如果仍存在歧义,请与用户确认,不要猜测。references/field_classification_guide.md
undefinedundefinedundefinedundefinedmeasurement-documentcalculated-data-aggregate-documentdata-source-aggregate-document"calculated-data-aggregate-document": {
"calculated-data-document": [{
"calculated-data-identifier": "SAMPLE_B1_DIN_001",
"calculated-data-name": "DNA integrity number",
"calculated-result": {"value": 9.5, "unit": "(unitless)"},
"data-source-aggregate-document": {
"data-source-document": [{
"data-source-identifier": "SAMPLE_B1_MEASUREMENT",
"data-source-feature": "electrophoresis trace"
}]
}
}]
}| Instrument | Calculated Fields |
|---|---|
| Cell counter | Viability %, cell density dilution-adjusted values |
| Spectrophotometer | Concentration (from absorbance), 260/280 ratio |
| Plate reader | Concentrations from standard curve, %CV |
| Electrophoresis | DIN/RIN, region concentrations, average sizes |
| qPCR | Relative quantities, fold change |
references/field_classification_guide.mdmeasurement-documentcalculated-data-aggregate-documentdata-source-aggregate-document"calculated-data-aggregate-document": {
"calculated-data-document": [{
"calculated-data-identifier": "SAMPLE_B1_DIN_001",
"calculated-data-name": "DNA完整性数值",
"calculated-result": {"value": 9.5, "unit": "(无单位)"},
"data-source-aggregate-document": {
"data-source-document": [{
"data-source-identifier": "SAMPLE_B1_MEASUREMENT",
"data-source-feature": "电泳轨迹"
}]
}
}]
}| 仪器类型 | 计算字段 |
|---|---|
| 细胞计数器 | 存活率百分比、经稀释调整的细胞密度值 |
| 分光光度计 | 浓度(来自吸光度)、260/280比值 |
| 酶标仪 | 标准曲线计算浓度、%CV |
| 电泳仪 | DIN/RIN值、区域浓度、平均大小 |
| qPCR | 相对定量值、倍数变化 |
references/field_classification_guide.mdpython scripts/validate_asm.py output.json
python scripts/validate_asm.py output.json --reference known_good.json # Compare to reference
python scripts/validate_asm.py output.json --strict # Treat warnings as errors--strictdata-source-aggregate-documentpython scripts/validate_asm.py output.json
python scripts/validate_asm.py output.json --reference known_good.json # 与参考文件对比
python scripts/validate_asm.py output.json --strict # 将警告视为错误--strictdata-source-aggregate-documentreferences/supported_instruments.md| Category | Instruments |
|---|---|
| Cell Counting | Vi-CELL BLU, Vi-CELL XR, NucleoCounter |
| Spectrophotometry | NanoDrop One/Eight/8000, Lunatic |
| Plate Readers | SoftMax Pro, EnVision, Gen5, CLARIOstar |
| ELISA | SoftMax Pro, BMG MARS, MSD Workbench |
| qPCR | QuantStudio, Bio-Rad CFX |
| Chromatography | Empower, Chromeleon |
references/supported_instruments.md| 类别 | 仪器 |
|---|---|
| 细胞计数 | Vi-CELL BLU、Vi-CELL XR、NucleoCounter |
| 分光光度法 | NanoDrop One/Eight/8000、Lunatic |
| 酶标仪 | SoftMax Pro、EnVision、Gen5、CLARIOstar |
| ELISA | SoftMax Pro、BMG MARS、MSD Workbench |
| qPCR | QuantStudio、Bio-Rad CFX |
| 色谱法 | Empower、Chromeleon |
from allotropy.parser_factory import Vendorfrom allotropy.parser_factory import Vendor
**When the user provides a file, check if allotropy supports it before falling back to manual parsing.** The `scripts/convert_to_asm.py` auto-detection only covers a subset of allotropy vendors.
**当用户提供文件时,在使用手动解析作为备用方案之前,请先检查allotropy是否支持该仪器。** `scripts/convert_to_asm.py` 的自动检测仅覆盖allotropy供应商的一个子集。calculated-data-aggregate-documentcalculated-data-aggregate-documentreferences/examples/references/instrument_guides/validate_asm.py --reference <file>references/examples/references/instrument_guides/validate_asm.py --reference <file>| Mistake | Correct Approach |
|---|---|
| Manifest as object | Use URL string |
| Lowercase detection types | Use "Absorbance" not "absorbance" |
| "emission wavelength setting" | Use "detector wavelength setting" for emission |
| All measurements in one document | Group by well/sample location |
| Missing procedure metadata | Extract ALL device settings per measurement |
| 错误 | 正确做法 |
|---|---|
| 将清单作为对象 | 使用URL字符串 |
| 检测类型使用小写 | 使用“Absorbance”而非“absorbance” |
| 使用“emission wavelength setting” | 对于发射光,使用“detector wavelength setting” |
| 所有测量值放在一个文档中 | 按孔/样本位置分组 |
| 缺少实验流程元数据 | 提取每次测量的所有设备设置 |
undefinedundefined
The exported script:
- Has no external dependencies beyond pandas/allotropy
- Includes inline documentation
- Can run in Jupyter notebooks
- Is production-ready for data pipelines
导出的脚本:
- 除了pandas和allotropy之外,无其他外部依赖
- 包含内联文档
- 可在Jupyter笔记本中运行
- 可直接用于生产数据流水线instrument-data-to-allotrope/
├── SKILL.md # This file
├── scripts/
│ ├── convert_to_asm.py # Main conversion script
│ ├── flatten_asm.py # ASM → 2D CSV conversion
│ ├── export_parser.py # Generate standalone parser code
│ └── validate_asm.py # Validate ASM output quality
└── references/
├── supported_instruments.md # Full instrument list with Vendor enums
├── asm_schema_overview.md # ASM structure reference
├── field_classification_guide.md # Where to put different field types
└── flattening_guide.md # How flattening worksinstrument-data-to-allotrope/
├── SKILL.md # 本文件
├── scripts/
│ ├── convert_to_asm.py # 主转换脚本
│ ├── flatten_asm.py # ASM → 二维CSV转换脚本
│ ├── export_parser.py # 生成独立解析器代码
│ └── validate_asm.py # 验证ASM输出质量
└── references/
├── supported_instruments.md # 完整仪器列表及Vendor枚举
├── asm_schema_overview.md # ASM结构参考
├── field_classification_guide.md # 不同字段类型的放置指导
└── flattening_guide.md # 扁平化规则说明User: "Convert this cell counting data to Allotrope format"
[uploads viCell_Results.xlsx]
Claude:
1. Detects Vi-CELL BLU (95% confidence)
2. Converts using allotropy native parser
3. Outputs:
- viCell_Results_asm.json (full ASM)
- viCell_Results_flat.csv (2D format)
- viCell_parser.py (exportable code)用户:“将这份细胞计数数据转换为Allotrope格式”
[上传viCell_Results.xlsx]
Claude操作:
1. 检测到Vi-CELL BLU(95%置信度)
2. 使用allotropy原生解析器进行转换
3. 输出:
- viCell_Results_asm.json(完整ASM)
- viCell_Results_flat.csv(二维格式)
- viCell_parser.py(可导出代码)User: "I need to give our data engineer code to parse NanoDrop files"
Claude:
1. Generates self-contained Python script
2. Includes sample input/output
3. Documents all assumptions
4. Provides Jupyter notebook version用户:“我需要给我们的数据工程师提供解析NanoDrop文件的代码”
Claude操作:
1. 生成独立的Python脚本
2. 包含示例输入/输出
3. 记录所有假设
4. 提供Jupyter笔记本版本User: "Convert this ELISA data to a CSV I can upload to our LIMS"
Claude:
1. Parses plate reader data
2. Generates flattened CSV with columns:
- sample_identifier, well_position, measurement_value, measurement_unit
- instrument_serial_number, analysis_datetime, assay_type
3. Validates against common LIMS import requirements用户:“将这份ELISA数据转换为可上传至我们LIMS的CSV格式”
Claude操作:
1. 解析酶标仪数据
2. 生成包含以下列的扁平化CSV:
- sample_identifier, well_position, measurement_value, measurement_unit
- instrument_serial_number, analysis_datetime, assay_type
3. 根据常见LIMS导入要求进行验证pip install allotropy --break-system-packagespip install allotropy --break-system-packagesimport jsonschemaimport jsonschemaundefinedundefined