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

asm_schema_overview.md

226 lines · bio-research/skills/instrument-data-to-allotrope/references/asm_schema_overview.md at 2574e29

Open on GitHub
1# ASM Schema Overview
2
3The Allotrope Simple Model (ASM) is a JSON-based standard for representing laboratory instrument data with semantic consistency.
4

ASM Schema Overview

The Allotrope Simple Model (ASM) is a JSON-based standard for representing laboratory instrument data with semantic consistency.

Raw lines 1 to 4
5## Core Concepts
6

Core Concepts

Raw lines 5 to 6
7### Structure
8ASM uses a hierarchical document structure:
9- **Manifest** - Links to ontologies and schemas
10- **Data** - The actual measurement data organized by technique

Structure

ASM uses a hierarchical document structure:

  • Manifest - Links to ontologies and schemas
  • Data - The actual measurement data organized by technique
Raw lines 7 to 11
12### Key Components
14```json
16 "$asm.manifest": {
17 "vocabulary": ["http://purl.allotrope.org/voc/afo/REC/2023/09/"],
18 "contexts": ["http://purl.allotrope.org/json-ld/afo-context-REC-2023-09.jsonld"]
19 },
20 "<technique>-aggregate-document": {
21 "device-system-document": { ... },
22 "<technique>-document": [
23 {
24 "measurement-aggregate-document": {
25 "measurement-document": [ ... ]
26 }
27 }
28 ]
29 }
31```

Key Components

{
  "$asm.manifest": {
    "vocabulary": ["http://purl.allotrope.org/voc/afo/REC/2023/09/"],
    "contexts": ["http://purl.allotrope.org/json-ld/afo-context-REC-2023-09.jsonld"]
  },
  "<technique>-aggregate-document": {
    "device-system-document": { ... },
    "<technique>-document": [
      {
        "measurement-aggregate-document": {
          "measurement-document": [ ... ]
        }
      }
    ]
  }
}
Raw lines 12 to 32
33## Required Metadata Documents

Required Metadata Documents

Raw lines 33 to 34
35### data system document
36Every ASM output MUST include this document with:
37- `ASM file identifier`: Output filename
38- `data system instance identifier`: System ID or "N/A"
39- `file name`: Source input filename
40- `UNC path`: Path to source file
41- `ASM converter name`: Parser identifier (e.g., "allotropy_beckman_coulter_biomek")
42- `ASM converter version`: Version string
43- `software name`: Instrument software that generated the source file

data system document

Every ASM output MUST include this document with:

  • ASM file identifier: Output filename
  • data system instance identifier: System ID or "N/A"
  • file name: Source input filename
  • UNC path: Path to source file
  • ASM converter name: Parser identifier (e.g., "allotropy_beckman_coulter_biomek")
  • ASM converter version: Version string
  • software name: Instrument software that generated the source file
Raw lines 35 to 44
45### device system document
46Every ASM output MUST include this document with:
47- `equipment serial number`: Main instrument serial
48- `product manufacturer`: Vendor name
49- `device document`: Array of sub-components (probes, pods, etc.)
50 - `device type`: Standardized type (e.g., "liquid handler probe head")
51 - `device identifier`: Logical name (e.g., "Pod1", not serial number)
52 - `equipment serial number`: Component serial
53 - `product manufacturer`: Component vendor

device system document

Every ASM output MUST include this document with:

  • equipment serial number: Main instrument serial
  • product manufacturer: Vendor name
  • device document: Array of sub-components (probes, pods, etc.)
  • device type: Standardized type (e.g., "liquid handler probe head")
  • device identifier: Logical name (e.g., "Pod1", not serial number)
  • equipment serial number: Component serial
  • product manufacturer: Component vendor
Raw lines 45 to 54
55## Available ASM Techniques
57The official ASM repository includes **65 technique schemas**:
59```
60absorbance, automated-reactors, balance, bga, binding-affinity, bulk-density,
61cell-counting, cell-culture-analyzer, chromatography, code-reader, conductance,
62conductivity, disintegration, dsc, dvs, electronic-lab-notebook,
63electronic-spectrometry, electrophoresis, flow-cytometry, fluorescence,
64foam-height, foam-qualification, fplc, ftir, gas-chromatography, gc-ms, gloss,
65hot-tack, impedance, lc-ms, light-obscuration, liquid-chromatography,
66loss-on-drying, luminescence, mass-spectrometry, metabolite-analyzer,
67multi-analyte-profiling, nephelometry, nmr, optical-imaging, optical-microscopy,
68osmolality, oven-kf, pcr, ph, plate-reader, pressure-monitoring, psd, pumping,
69raman, rheometry, sem, solution-analyzer, specific-rotation, spectrophotometry,
70stirring, surface-area-analysis, tablet-hardness, temperature-monitoring,
71tensile-test, thermogravimetric-analysis, titration, ultraviolet-absorbance,
72x-ray-powder-diffraction
73```
75See: https://gitlab.com/allotrope-public/asm/-/tree/main/json-schemas/adm

Available ASM Techniques

The official ASM repository includes 65 technique schemas:

absorbance, automated-reactors, balance, bga, binding-affinity, bulk-density,
cell-counting, cell-culture-analyzer, chromatography, code-reader, conductance,
conductivity, disintegration, dsc, dvs, electronic-lab-notebook,
electronic-spectrometry, electrophoresis, flow-cytometry, fluorescence,
foam-height, foam-qualification, fplc, ftir, gas-chromatography, gc-ms, gloss,
hot-tack, impedance, lc-ms, light-obscuration, liquid-chromatography,
loss-on-drying, luminescence, mass-spectrometry, metabolite-analyzer,
multi-analyte-profiling, nephelometry, nmr, optical-imaging, optical-microscopy,
osmolality, oven-kf, pcr, ph, plate-reader, pressure-monitoring, psd, pumping,
raman, rheometry, sem, solution-analyzer, specific-rotation, spectrophotometry,
stirring, surface-area-analysis, tablet-hardness, temperature-monitoring,
tensile-test, thermogravimetric-analysis, titration, ultraviolet-absorbance,
x-ray-powder-diffraction

See: https://gitlab.com/allotrope-public/asm/-/tree/main/json-schemas/adm

Raw lines 55 to 76
77## Common ASM Schemas by Technique
79Below are details for frequently-used techniques:

Common ASM Schemas by Technique

Below are details for frequently-used techniques:

Raw lines 77 to 80
81### Cell Counting
82Schema: `cell-counting/REC/2024/09/cell-counting.schema.json`
84Key fields:
85- `viable-cell-density` (cells/mL)
86- `viability` (percentage)
87- `total-cell-count`
88- `dead-cell-count`
89- `cell-diameter-distribution-datum`

Cell Counting

Schema: cell-counting/REC/2024/09/cell-counting.schema.json

Key fields:

  • viable-cell-density (cells/mL)
  • viability (percentage)
  • total-cell-count
  • dead-cell-count
  • cell-diameter-distribution-datum
Raw lines 81 to 90
91### Spectrophotometry (UV-Vis)
92Schema: `spectrophotometry/REC/2024/06/spectrophotometry.schema.json`
94Key fields:
95- `absorbance` (dimensionless)
96- `wavelength` (nm)
97- `transmittance` (percentage)
98- `pathlength` (cm)
99- `concentration` with units

Spectrophotometry (UV-Vis)

Schema: spectrophotometry/REC/2024/06/spectrophotometry.schema.json

Key fields:

  • absorbance (dimensionless)
  • wavelength (nm)
  • transmittance (percentage)
  • pathlength (cm)
  • concentration with units
Raw lines 91 to 100
101### Plate Reader
102Schema: `plate-reader/REC/2024/06/plate-reader.schema.json`
104Key fields:
105- `absorbance`
106- `fluorescence`
107- `luminescence`
108- `well-location` (A1-H12)
109- `plate-identifier`

Plate Reader

Schema: plate-reader/REC/2024/06/plate-reader.schema.json

Key fields:

  • absorbance
  • fluorescence
  • luminescence
  • well-location (A1-H12)
  • plate-identifier
Raw lines 101 to 110
111### qPCR
112Schema: `pcr/REC/2024/06/pcr.schema.json`
114Key fields:
115- `cycle-threshold-result`
116- `amplification-efficiency`
117- `melt-curve-datum`
118- `target-DNA-description`

qPCR

Schema: pcr/REC/2024/06/pcr.schema.json

Key fields:

  • cycle-threshold-result
  • amplification-efficiency
  • melt-curve-datum
  • target-DNA-description
Raw lines 111 to 119
120### Chromatography
121Schema: `liquid-chromatography/REC/2023/09/liquid-chromatography.schema.json`
123Key fields:
124- `retention-time` (minutes)
125- `peak-area`
126- `peak-height`
127- `peak-width`
128- `chromatogram-data-cube`

Chromatography

Schema: liquid-chromatography/REC/2023/09/liquid-chromatography.schema.json

Key fields:

  • retention-time (minutes)
  • peak-area
  • peak-height
  • peak-width
  • chromatogram-data-cube
Raw lines 120 to 129
130## Data Patterns
132### Value Datum
133Simple value with unit:
134```json
136 "value": 1.5,
137 "unit": "mL"
139```

Value Datum

Simple value with unit:

{
  "value": 1.5,
  "unit": "mL"
}
Raw lines 132 to 140
141### Aggregate Datum
142Collection of related values:
143```json
145 "measurement-aggregate-document": {
146 "measurement-document": [
147 { "viable-cell-density": {"value": 2.5e6, "unit": "(cell/mL)"} },
148 { "viability": {"value": 95.2, "unit": "%"} }
149 ]
150 }
152```

Aggregate Datum

Collection of related values:

{
  "measurement-aggregate-document": {
    "measurement-document": [
      { "viable-cell-density": {"value": 2.5e6, "unit": "(cell/mL)"} },
      { "viability": {"value": 95.2, "unit": "%"} }
    ]
  }
}
Raw lines 141 to 153
154### Data Cube
155Multi-dimensional array data:
156```json
158 "cube-structure": {
159 "dimensions": [{"@componentDatatype": "double", "concept": "elapsed time"}],
160 "measures": [{"@componentDatatype": "double", "concept": "absorbance"}]
161 },
162 "data": {
163 "dimensions": [[0, 1, 2, 3, 4]],
164 "measures": [[0.1, 0.2, 0.3, 0.4, 0.5]]
165 }
167```

Data Cube

Multi-dimensional array data:

{
  "cube-structure": {
    "dimensions": [{"@componentDatatype": "double", "concept": "elapsed time"}],
    "measures": [{"@componentDatatype": "double", "concept": "absorbance"}]
  },
  "data": {
    "dimensions": [[0, 1, 2, 3, 4]],
    "measures": [[0.1, 0.2, 0.3, 0.4, 0.5]]
  }
}
Raw lines 154 to 168
169## Validation
171Validate ASM output against official schemas:
173```python
174import json
175import jsonschema
176from urllib.request import urlopen
178# Load ASM output
179with open("output.json") as f:
180 asm = json.load(f)
182# Get schema URL from manifest
183schema_url = asm.get("$asm.manifest", {}).get("$ref")
185# Validate (simplified - real validation more complex)
186# Note: Full validation requires resolving $ref references
187```

Validation

Validate ASM output against official schemas:

import json
import jsonschema
from urllib.request import urlopen

# Load ASM output
with open("output.json") as f:
    asm = json.load(f)

# Get schema URL from manifest
schema_url = asm.get("$asm.manifest", {}).get("$ref")

# Validate (simplified - real validation more complex)
# Note: Full validation requires resolving $ref references
Raw lines 169 to 188
189## Schema Repository
191Official schemas: https://gitlab.com/allotrope-public/asm/-/tree/main/json-schemas/adm
193Schema structure:
194```
195json-schemas/adm/
196├── cell-counting/
197│ └── REC/2024/09/
198│ └── cell-counting.schema.json
199├── spectrophotometry/
200│ └── REC/2024/06/
201│ └── spectrophotometry.schema.json
202├── plate-reader/
203│ └── REC/2024/06/
204│ └── plate-reader.schema.json
205└── ...
206```

Schema Repository

Official schemas: https://gitlab.com/allotrope-public/asm/-/tree/main/json-schemas/adm

Schema structure:

json-schemas/adm/
├── cell-counting/
│   └── REC/2024/09/
│       └── cell-counting.schema.json
├── spectrophotometry/
│   └── REC/2024/06/
│       └── spectrophotometry.schema.json
├── plate-reader/
│   └── REC/2024/06/
│       └── plate-reader.schema.json
└── ...
Raw lines 189 to 207
208## Common Issues
210### Missing Fields
211Not all instrument exports contain all ASM fields. Report completeness:
212```python
213def report_completeness(asm, expected_fields):
214 found = set(extract_all_fields(asm))
215 missing = expected_fields - found
216 return len(found) / len(expected_fields) * 100
217```

Missing Fields

Not all instrument exports contain all ASM fields. Report completeness:

def report_completeness(asm, expected_fields):
    found = set(extract_all_fields(asm))
    missing = expected_fields - found
    return len(found) / len(expected_fields) * 100
Raw lines 210 to 218
219### Unit Variations
220Instruments may use different unit formats. The allotropy library normalizes these:
221- "cells/mL" → "(cell/mL)"
222- "%" → "%"
223- "nm" → "nm"

Unit Variations

Instruments may use different unit formats. The allotropy library normalizes these:

  • "cells/mL" → "(cell/mL)"
  • "%" → "%"
  • "nm" → "nm"
Raw lines 219 to 224
225### Date Formats
226ASM uses ISO 8601: `2024-01-15T10:30:00Z`

Date Formats

ASM uses ISO 8601: 2024-01-15T10:30:00Z

Raw lines 225 to 226