Skill Tracer
Skills › Knowledge Work Plugins › instrument-data-to-allotrope

instrument-data-to-allotrope

skill · 280 lines · Apache-2.0 · bio-research/skills/instrument-data-to-allotrope/SKILL.md

The facts

Its description

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full ASM JSON, flattened CSV for easy import, and exportable Python code for data engineers. Common triggers include converting instrument files, standardizing lab data, preparing data for upload to LIMS/ELN systems, or generating parser code for production pipelines.

The description the agent reads to decide when to use it.

From its settingsline 3

When it starts

A scientist or data engineer has raw laboratory instrument output files (PDF, CSV, Excel, TXT) and wants them standardized into Allotrope Simple Model JSON or flattened 2D CSV, usually for LIMS/ELN upload, a data lake, or a parser-code handoff to a data engineer. The agent picks it when the request is about converting or standardizing instrument files rather than analyzing the measurements themselves.

Things a person might say (the model's guesses)

  • “Convert this cell counting data to Allotrope format”
  • “I need to give our data engineer code to parse NanoDrop files”
  • “Convert this ELISA data to a CSV I can upload to our LIMS”

A model's summary of when it is used.

A model's reading

Runs scripts

python scripts/validate_asm.py, scripts/convert_to_asm.py, python scripts/export_parser.py

Scripts the text names. Found by matching words, so treat them as pointers.

Found by matching wordsline 100 line 101 line 102 line 155 line 196

Files it mentions

references/field_classification_guide.md, references/supported_instruments.md, scripts/convert_to_asm.py

Files the text names, such as ones to read or write. Found by matching words, so treat them as pointers.

Found by matching wordsline 31 line 93 line 123 line 155

Stops for a person

1 line stops to ask a person

Lines that stop and wait for a person before going on. Found by matching words, so treat them as pointers.

Found by matching wordsline 31

What leads to it

Other skills that hand off to this one, call it, require it or offer it instead, as a model read them.

A model's reading

Licence

Apache-2.0, from bio-research/skills/instrument-data-to-allotrope/LICENSE.txt

The terms its author shares it under, which let it be shown here.

Other files in this skill (10) Close

The text

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1---
2name: instrument-data-to-allotrope
3description: Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full ASM JSON, flattened CSV for easy import, and exportable Python code for data engineers. Common triggers include converting instrument files, standardizing lab data, preparing data for upload to LIMS/ELN systems, or generating parser code for production pipelines.
4---
5
6# Instrument Data to Allotrope Converter
7
8Convert instrument files into standardized Allotrope Simple Model (ASM) format for LIMS upload, data lakes, or handoff to data engineering teams.
9
10> **Note: This is an Example Skill**
12> This skill demonstrates how skills can support your data engineering tasks—automating schema transformations, parsing instrument outputs, and generating production-ready code.
14> **To customize for your organization:**
15> - Modify the `references/` files to include your company's specific schemas or ontology mappings
16> - Use an MCP server to connect to systems that define your schemas (e.g., your LIMS, data catalog, or schema registry)
17> - Extend the `scripts/` to handle proprietary instrument formats or internal data standards
19> This pattern can be adapted for any data transformation workflow where you need to convert between formats or validate against organizational standards.

Instrument Data to Allotrope Converter

Convert instrument files into standardized Allotrope Simple Model (ASM) format for LIMS upload, data lakes, or handoff to data engineering teams.

Note: This is an Example Skill This 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 references/ files to include your company's specific schemas or ontology mappings - Use an MCP server to connect to systems that define your schemas (e.g., your LIMS, data catalog, or schema registry) - Extend the scripts/ to handle proprietary instrument formats or internal data standards This pattern can be adapted for any data transformation workflow where you need to convert between formats or validate against organizational standards.
Raw lines 1 to 20
Uses an outside tool MCP :16
21## Workflow Overview
231. **Detect instrument type** from file contents (auto-detect or user-specified)
242. **Parse file** using allotropy library (native) or flexible fallback parser
253. **Generate outputs**:
26 - ASM JSON (full semantic structure)
27 - Flattened CSV (2D tabular format)
28 - Python parser code (for data engineer handoff)
294. **Deliver** files with summary and usage instructions
31> **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 to `references/field_classification_guide.md` for guidance, but when ambiguity remains, confirm with the user rather than guessing.

Workflow Overview

  1. Detect instrument type from file contents (auto-detect or user-specified)
  2. Parse file using allotropy library (native) or flexible fallback parser
  3. Generate outputs:
  4. ASM JSON (full semantic structure)
  5. Flattened CSV (2D tabular format)
  6. Python parser code (for data engineer handoff)
  7. Deliver files with summary and usage instructions
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 to references/field_classification_guide.md for guidance, but when ambiguity remains, confirm with the user rather than guessing.
Raw lines 21 to 32
Involves a person ask the user :31
Involves a person confirm with the user :31
33## Quick Start
35```python
36# Install requirements first
37pip install allotropy pandas openpyxl pdfplumber --break-system-packages
39# Core conversion
40from allotropy.parser_factory import Vendor
41from allotropy.to_allotrope import allotrope_from_file
43# Convert with allotropy
44asm = allotrope_from_file("instrument_data.csv", Vendor.BECKMAN_VI_CELL_BLU)
45```

Quick Start

# Install requirements first
pip install allotropy pandas openpyxl pdfplumber --break-system-packages

# Core conversion
from allotropy.parser_factory import Vendor
from allotropy.to_allotrope import allotrope_from_file

# Convert with allotropy
asm = allotrope_from_file("instrument_data.csv", Vendor.BECKMAN_VI_CELL_BLU)
Raw lines 33 to 46
47## Output Format Selection
49**ASM JSON (default)** - Full semantic structure with ontology URIs
50- Best for: LIMS systems expecting ASM, data lakes, long-term archival
51- Validates against Allotrope schemas
53**Flattened CSV** - 2D tabular representation
54- Best for: Quick analysis, Excel users, systems without JSON support
55- Each measurement becomes one row with metadata repeated
57**Both** - Generate both formats for maximum flexibility

Output Format Selection

ASM JSON (default) - Full semantic structure with ontology URIs

  • Best for: LIMS systems expecting ASM, data lakes, long-term archival
  • Validates against Allotrope schemas

Flattened CSV - 2D tabular representation

  • Best for: Quick analysis, Excel users, systems without JSON support
  • Each measurement becomes one row with metadata repeated

Both - Generate both formats for maximum flexibility

Raw lines 47 to 58
59## Calculated Data Handling
61**IMPORTANT:** Separate raw measurements from calculated/derived values.
63- **Raw data** → `measurement-document` (direct instrument readings)
64- **Calculated data** → `calculated-data-aggregate-document` (derived values)
66Calculated values MUST include traceability via `data-source-aggregate-document`:
68```json
69"calculated-data-aggregate-document": {
70 "calculated-data-document": [{
71 "calculated-data-identifier": "SAMPLE_B1_DIN_001",
72 "calculated-data-name": "DNA integrity number",
73 "calculated-result": {"value": 9.5, "unit": "(unitless)"},
74 "data-source-aggregate-document": {
75 "data-source-document": [{
76 "data-source-identifier": "SAMPLE_B1_MEASUREMENT",
77 "data-source-feature": "electrophoresis trace"
78 }]
79 }
80 }]
82```
84**Common calculated fields by instrument type:**
85| Instrument | Calculated Fields |
86|------------|-------------------|
87| Cell counter | Viability %, cell density dilution-adjusted values |
88| Spectrophotometer | Concentration (from absorbance), 260/280 ratio |
89| Plate reader | Concentrations from standard curve, %CV |
90| Electrophoresis | DIN/RIN, region concentrations, average sizes |
91| qPCR | Relative quantities, fold change |
93See `references/field_classification_guide.md` for detailed guidance on raw vs. calculated classification.

Calculated Data Handling

IMPORTANT: Separate raw measurements from calculated/derived values.

  • Raw data → measurement-document (direct instrument readings)
  • Calculated data → calculated-data-aggregate-document (derived values)

Calculated values MUST include traceability via data-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"
      }]
    }
  }]
}

Common calculated fields by instrument type:

InstrumentCalculated Fields
Cell counterViability %, cell density dilution-adjusted values
SpectrophotometerConcentration (from absorbance), 260/280 ratio
Plate readerConcentrations from standard curve, %CV
ElectrophoresisDIN/RIN, region concentrations, average sizes
qPCRRelative quantities, fold change

See references/field_classification_guide.md for detailed guidance on raw vs. calculated classification.

Raw lines 59 to 94
95## Validation
97Always validate ASM output before delivering to the user:
99```bash
100python scripts/validate_asm.py output.json
101python scripts/validate_asm.py output.json --reference known_good.json # Compare to reference
102python scripts/validate_asm.py output.json --strict # Treat warnings as errors
103```
105**Validation Rules:**
106- Based on Allotrope ASM specification (December 2024)
107- Last updated: 2026-01-07
108- Source: https://gitlab.com/allotrope-public/asm
110**Soft Validation Approach:**
111Unknown techniques, units, or sample roles generate **warnings** (not errors) to allow for forward compatibility. If Allotrope adds new values after December 2024, the validator won't block them—it will flag them for manual verification. Use `--strict` mode to treat warnings as errors if you need stricter validation.
113**What it checks:**
114- Correct technique selection (e.g., multi-analyte profiling vs plate reader)
115- Field naming conventions (space-separated, not hyphenated)
116- Calculated data has traceability (`data-source-aggregate-document`)
117- Unique identifiers exist for measurements and calculated values
118- Required metadata present
119- Valid units and sample roles (with soft validation for unknown values)

Validation

Always validate ASM output before delivering to the user:

python 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

Validation Rules:

  • Based on Allotrope ASM specification (December 2024)
  • Last updated: 2026-01-07
  • Source: https://gitlab.com/allotrope-public/asm

Soft Validation Approach: Unknown techniques, units, or sample roles generate warnings (not errors) to allow for forward compatibility. If Allotrope adds new values after December 2024, the validator won't block them—it will flag them for manual verification. Use --strict mode to treat warnings as errors if you need stricter validation.

What it checks:

  • Correct technique selection (e.g., multi-analyte profiling vs plate reader)
  • Field naming conventions (space-separated, not hyphenated)
  • Calculated data has traceability (data-source-aggregate-document)
  • Unique identifiers exist for measurements and calculated values
  • Required metadata present
  • Valid units and sample roles (with soft validation for unknown values)
Raw lines 95 to 120
Runs code python scripts/validate_asm.py :100
121## Supported Instruments
123See `references/supported_instruments.md` for complete list. Key instruments:
125| Category | Instruments |
126|----------|-------------|
127| Cell Counting | Vi-CELL BLU, Vi-CELL XR, NucleoCounter |
128| Spectrophotometry | NanoDrop One/Eight/8000, Lunatic |
129| Plate Readers | SoftMax Pro, EnVision, Gen5, CLARIOstar |
130| ELISA | SoftMax Pro, BMG MARS, MSD Workbench |
131| qPCR | QuantStudio, Bio-Rad CFX |
132| Chromatography | Empower, Chromeleon |

Supported Instruments

See references/supported_instruments.md for complete list. Key instruments:

CategoryInstruments
Cell CountingVi-CELL BLU, Vi-CELL XR, NucleoCounter
SpectrophotometryNanoDrop One/Eight/8000, Lunatic
Plate ReadersSoftMax Pro, EnVision, Gen5, CLARIOstar
ELISASoftMax Pro, BMG MARS, MSD Workbench
qPCRQuantStudio, Bio-Rad CFX
ChromatographyEmpower, Chromeleon
Raw lines 121 to 133
134## Detection & Parsing Strategy

Detection & Parsing Strategy

Raw lines 134 to 135
136### Tier 1: Native allotropy parsing (PREFERRED)
137**Always try allotropy first.** Check available vendors directly:
139```python
140from allotropy.parser_factory import Vendor
142# List all supported vendors
143for v in Vendor:
144 print(f"{v.name}")
146# Common vendors:
147# AGILENT_TAPESTATION_ANALYSIS (for TapeStation XML)
148# BECKMAN_VI_CELL_BLU
149# THERMO_FISHER_NANODROP_EIGHT
150# MOLDEV_SOFTMAX_PRO
151# APPBIO_QUANTSTUDIO
152# ... many more
153```
155**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.

Tier 1: Native allotropy parsing (PREFERRED)

Always try allotropy first. Check available vendors directly:

from allotropy.parser_factory import Vendor

# List all supported vendors
for v in Vendor:
    print(f"{v.name}")

# Common vendors:
# AGILENT_TAPESTATION_ANALYSIS  (for TapeStation XML)
# BECKMAN_VI_CELL_BLU
# THERMO_FISHER_NANODROP_EIGHT
# MOLDEV_SOFTMAX_PRO
# APPBIO_QUANTSTUDIO
# ... many more

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.

Raw lines 136 to 156
Reads a file scripts/convert_to_asm.py :155
157### Tier 2: Flexible fallback parsing
158**Only use if allotropy doesn't support the instrument.** This fallback:
159- Does NOT generate `calculated-data-aggregate-document`
160- Does NOT include full traceability
161- Produces simplified ASM structure
163Use flexible parser with:
164- Column name fuzzy matching
165- Unit extraction from headers
166- Metadata extraction from file structure

Tier 2: Flexible fallback parsing

Only use if allotropy doesn't support the instrument. This fallback:

  • Does NOT generate calculated-data-aggregate-document
  • Does NOT include full traceability
  • Produces simplified ASM structure

Use flexible parser with:

  • Column name fuzzy matching
  • Unit extraction from headers
  • Metadata extraction from file structure
Raw lines 157 to 167
168### Tier 3: PDF extraction
169For PDF-only files, extract tables using pdfplumber, then apply Tier 2 parsing.

Tier 3: PDF extraction

For PDF-only files, extract tables using pdfplumber, then apply Tier 2 parsing.

Raw lines 168 to 170
171## Pre-Parsing Checklist
173Before writing a custom parser, ALWAYS:
1751. **Check if allotropy supports it** - Use native parser if available
1762. **Find a reference ASM file** - Check `references/examples/` or ask user
1773. **Review instrument-specific guide** - Check `references/instrument_guides/`
1784. **Validate against reference** - Run `validate_asm.py --reference <file>`

Pre-Parsing Checklist

Before writing a custom parser, ALWAYS:

  1. Check if allotropy supports it - Use native parser if available
  2. Find a reference ASM file - Check references/examples/ or ask user
  3. Review instrument-specific guide - Check references/instrument_guides/
  4. Validate against reference - Run validate_asm.py --reference <file>
Raw lines 171 to 179
180## Common Mistakes to Avoid
182| Mistake | Correct Approach |
183|---------|------------------|
184| Manifest as object | Use URL string |
185| Lowercase detection types | Use "Absorbance" not "absorbance" |
186| "emission wavelength setting" | Use "detector wavelength setting" for emission |
187| All measurements in one document | Group by well/sample location |
188| Missing procedure metadata | Extract ALL device settings per measurement |

Common Mistakes to Avoid

MistakeCorrect Approach
Manifest as objectUse URL string
Lowercase detection typesUse "Absorbance" not "absorbance"
"emission wavelength setting"Use "detector wavelength setting" for emission
All measurements in one documentGroup by well/sample location
Missing procedure metadataExtract ALL device settings per measurement
Raw lines 180 to 189
190## Code Export for Data Engineers
192Generate standalone Python scripts that scientists can hand off:
194```python
195# Export parser code
196python scripts/export_parser.py --input "data.csv" --vendor "VI_CELL_BLU" --output "parser_script.py"
197```
199The exported script:
200- Has no external dependencies beyond pandas/allotropy
201- Includes inline documentation
202- Can run in Jupyter notebooks
203- Is production-ready for data pipelines

Code Export for Data Engineers

Generate standalone Python scripts that scientists can hand off:

# Export parser code
python scripts/export_parser.py --input "data.csv" --vendor "VI_CELL_BLU" --output "parser_script.py"

The exported script:

  • Has no external dependencies beyond pandas/allotropy
  • Includes inline documentation
  • Can run in Jupyter notebooks
  • Is production-ready for data pipelines
Raw lines 190 to 204
Runs code python scripts/export_parser.py :196
205## File Structure
207```
208instrument-data-to-allotrope/
209├── SKILL.md # This file
210├── scripts/
211│ ├── convert_to_asm.py # Main conversion script
212│ ├── flatten_asm.py # ASM → 2D CSV conversion
213│ ├── export_parser.py # Generate standalone parser code
214│ └── validate_asm.py # Validate ASM output quality
215└── references/
216 ├── supported_instruments.md # Full instrument list with Vendor enums
217 ├── asm_schema_overview.md # ASM structure reference
218 ├── field_classification_guide.md # Where to put different field types
219 └── flattening_guide.md # How flattening works
220```

File Structure

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 works
Raw lines 205 to 221
222## Usage Examples

Usage Examples

Raw lines 222 to 223
224### Example 1: Vi-CELL BLU file
225```
226User: "Convert this cell counting data to Allotrope format"
227[uploads viCell_Results.xlsx]
229Claude:
2301. Detects Vi-CELL BLU (95% confidence)
2312. Converts using allotropy native parser
2323. Outputs:
233 - viCell_Results_asm.json (full ASM)
234 - viCell_Results_flat.csv (2D format)
235 - viCell_parser.py (exportable code)
236```

Example 1: Vi-CELL BLU file

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)
Raw lines 224 to 237
238### Example 2: Request for code handoff
239```
240User: "I need to give our data engineer code to parse NanoDrop files"
242Claude:
2431. Generates self-contained Python script
2442. Includes sample input/output
2453. Documents all assumptions
2464. Provides Jupyter notebook version
247```

Example 2: Request for code handoff

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
Raw lines 238 to 248
249### Example 3: LIMS-ready flattened output
250```
251User: "Convert this ELISA data to a CSV I can upload to our LIMS"
253Claude:
2541. Parses plate reader data
2552. Generates flattened CSV with columns:
256 - sample_identifier, well_position, measurement_value, measurement_unit
257 - instrument_serial_number, analysis_datetime, assay_type
2583. Validates against common LIMS import requirements
259```

Example 3: LIMS-ready flattened output

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
Raw lines 249 to 260
261## Implementation Notes

Implementation Notes

Raw lines 261 to 262
263### Installing allotropy
264```bash
265pip install allotropy --break-system-packages
266```

Installing allotropy

pip install allotropy --break-system-packages
Raw lines 263 to 267
268### Handling parse failures
269If allotropy native parsing fails:
2701. Log the error for debugging
2712. Fall back to flexible parser
2723. Report reduced metadata completeness to user
2734. Suggest exporting different format from instrument

Handling parse failures

If allotropy native parsing fails:

  1. Log the error for debugging
  2. Fall back to flexible parser
  3. Report reduced metadata completeness to user
  4. Suggest exporting different format from instrument
Raw lines 268 to 274
275### ASM Schema Validation
276Validate output against Allotrope schemas when available:
277```python
278import jsonschema
279# Schema URLs in references/asm_schema_overview.md
280```

ASM Schema Validation

Validate output against Allotrope schemas when available:

import jsonschema
# Schema URLs in references/asm_schema_overview.md
Raw lines 275 to 280

From anthropics/knowledge-work-plugins at 2574e29, 2026-10-27. Skills read by DeepSeek V4.1 Flash on 2026-11-04. Summary and techniques by Claude Opus 5.5 on 2026-11-06.