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

field_classification_guide.md

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

Open on GitHub

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

1# Field Classification Guide
2
3This guide helps classify instrument data fields into the correct ASM document locations. Use this when mapping raw instrument output to Allotrope Simple Model structure.
4

Field Classification Guide

This guide helps classify instrument data fields into the correct ASM document locations. Use this when mapping raw instrument output to Allotrope Simple Model structure.

Raw lines 1 to 4
5## ASM Document Hierarchy
6
7```
8<technique>-aggregate-document
9├── device-system-document # Instrument hardware info
10├── data-system-document # Software/conversion info
11├── <technique>-document[] # Per-run/sequence data
12│ ├── analyst # Who performed the analysis
13│ ├── measurement-aggregate-document
14│ │ ├── measurement-time
15│ │ ├── measurement-document[] # Individual measurements
16│ │ │ ├── sample-document
17│ │ │ ├── device-control-aggregate-document
18│ │ │ └── [measurement fields]
19│ │ └── [aggregate-level metadata]
20│ ├── processed-data-aggregate-document
21│ │ └── processed-data-document[]
22│ │ ├── data-processing-document
23│ │ └── [processed results]
24│ └── calculated-data-aggregate-document
25│ └── calculated-data-document[]
26```

ASM Document Hierarchy

<technique>-aggregate-document
├── device-system-document          # Instrument hardware info
├── data-system-document            # Software/conversion info
├── <technique>-document[]          # Per-run/sequence data
│   ├── analyst                     # Who performed the analysis
│   ├── measurement-aggregate-document
│   │   ├── measurement-time
│   │   ├── measurement-document[]  # Individual measurements
│   │   │   ├── sample-document
│   │   │   ├── device-control-aggregate-document
│   │   │   └── [measurement fields]
│   │   └── [aggregate-level metadata]
│   ├── processed-data-aggregate-document
│   │   └── processed-data-document[]
│   │       ├── data-processing-document
│   │       └── [processed results]
│   └── calculated-data-aggregate-document
│       └── calculated-data-document[]
Raw lines 5 to 27
28## Field Classification Categories

Field Classification Categories

Raw lines 28 to 29
30### 1. Device/Instrument Information → `device-system-document`
32Hardware and firmware details about the physical instrument.
34| Field Type | ASM Field | Examples |
35|------------|-----------|----------|
36| Instrument name | `model-number` | "Vi-CELL BLU", "NanoDrop One" |
37| Serial number | `equipment-serial-number` | "VCB-12345", "SN001234" |
38| Manufacturer | `product-manufacturer` | "Beckman Coulter", "Thermo Fisher" |
39| Firmware version | `firmware-version` | "v2.1.3" |
40| Device ID | `device-identifier` | "Instrument_01" |
41| Brand | `brand-name` | "Beckman Coulter" |
43**Rule:** If the value describes the physical instrument and doesn't change between runs, it goes in `device-system-document`.
45---

1. Device/Instrument Information → device-system-document

Hardware and firmware details about the physical instrument.

Field TypeASM FieldExamples
Instrument namemodel-number"Vi-CELL BLU", "NanoDrop One"
Serial numberequipment-serial-number"VCB-12345", "SN001234"
Manufacturerproduct-manufacturer"Beckman Coulter", "Thermo Fisher"
Firmware versionfirmware-version"v2.1.3"
Device IDdevice-identifier"Instrument_01"
Brandbrand-name"Beckman Coulter"

Rule: If the value describes the physical instrument and doesn't change between runs, it goes in device-system-document.


Raw lines 30 to 46
47### 2. Software/Data System Information → `data-system-document`
49Information about software used for acquisition, analysis, or conversion.
51| Field Type | ASM Field | Examples |
52|------------|-----------|----------|
53| Software name | `software-name` | "Chromeleon", "Gen5" |
54| Software version | `software-version` | "7.3.2" |
55| File name | `file-name` | "experiment_001.xlsx" |
56| File path | `file-identifier` | "/data/runs/2024-01-15/" |
57| Database ID | `ASM-converter-name` | "allotropy v0.1.55" |
59**Rule:** If the value describes software, file metadata, or data provenance, it goes in `data-system-document`.
61---

2. Software/Data System Information → data-system-document

Information about software used for acquisition, analysis, or conversion.

Field TypeASM FieldExamples
Software namesoftware-name"Chromeleon", "Gen5"
Software versionsoftware-version"7.3.2"
File namefile-name"experiment_001.xlsx"
File pathfile-identifier"/data/runs/2024-01-15/"
Database IDASM-converter-name"allotropy v0.1.55"

Rule: If the value describes software, file metadata, or data provenance, it goes in data-system-document.


Raw lines 47 to 62
63### 3. Sample Information → `sample-document`
65Metadata about the biological/chemical sample being analyzed.
67| Field Type | ASM Field | Examples |
68|------------|-----------|----------|
69| Sample ID | `sample-identifier` | "Sample_A", "LIMS-001234" |
70| Sample name | `written-name` | "CHO Cell Culture Day 5" |
71| Sample type/role | `sample-role-type` | "unknown sample role", "control sample role" |
72| Batch ID | `batch-identifier` | "Batch-2024-001" |
73| Description | `description` | "Protein expression sample" |
74| Well position | `location-identifier` | "A1", "B3" |
76**Rule:** If the value identifies or describes what was measured (not how), it goes in `sample-document`.
78---

3. Sample Information → sample-document

Metadata about the biological/chemical sample being analyzed.

Field TypeASM FieldExamples
Sample IDsample-identifier"Sample_A", "LIMS-001234"
Sample namewritten-name"CHO Cell Culture Day 5"
Sample type/rolesample-role-type"unknown sample role", "control sample role"
Batch IDbatch-identifier"Batch-2024-001"
Descriptiondescription"Protein expression sample"
Well positionlocation-identifier"A1", "B3"

Rule: If the value identifies or describes what was measured (not how), it goes in sample-document.


Raw lines 63 to 79
80### 4. Device Control Settings → `device-control-aggregate-document`
82Instrument settings and parameters used during measurement.
84| Field Type | ASM Field | Examples |
85|------------|-----------|----------|
86| Injection volume | `sample-volume-setting` | 10 µL |
87| Wavelength | `detector-wavelength-setting` | 254 nm |
88| Temperature | `compartment-temperature` | 37°C |
89| Flow rate | `flow-rate` | 1.0 mL/min |
90| Exposure time | `exposure-duration-setting` | 500 ms |
91| Detector gain | `detector-gain-setting` | 1.5 |
92| Illumination | `illumination-setting` | 80% |
94**Rule:** If the value is a configurable instrument parameter that affects measurement, it goes in `device-control-aggregate-document`.
96---

4. Device Control Settings → device-control-aggregate-document

Instrument settings and parameters used during measurement.

Field TypeASM FieldExamples
Injection volumesample-volume-setting10 µL
Wavelengthdetector-wavelength-setting254 nm
Temperaturecompartment-temperature37°C
Flow rateflow-rate1.0 mL/min
Exposure timeexposure-duration-setting500 ms
Detector gaindetector-gain-setting1.5
Illuminationillumination-setting80%

Rule: If the value is a configurable instrument parameter that affects measurement, it goes in device-control-aggregate-document.


Raw lines 80 to 97
98### 5. Environmental Conditions → `device-control-document` or technique-specific
100Ambient or controlled environmental parameters during measurement.
102| Field Type | ASM Field | Examples |
103|------------|-----------|----------|
104| Ambient temperature | `ambient-temperature` | 22.5°C |
105| Humidity | `ambient-relative-humidity` | 45% |
106| Column temperature | `compartment-temperature` | 30°C |
107| Sample temperature | `sample-temperature` | 4°C |
108| Electrophoresis temp | (technique-specific) | 26.4°C |
110**Rule:** Environmental conditions that affect measurement quality go with device control or in technique-specific locations.
112---

5. Environmental Conditions → device-control-document or technique-specific

Ambient or controlled environmental parameters during measurement.

Field TypeASM FieldExamples
Ambient temperatureambient-temperature22.5°C
Humidityambient-relative-humidity45%
Column temperaturecompartment-temperature30°C
Sample temperaturesample-temperature4°C
Electrophoresis temp(technique-specific)26.4°C

Rule: Environmental conditions that affect measurement quality go with device control or in technique-specific locations.


Raw lines 98 to 113
114### 6. Raw Measurement Data → `measurement-document`
116Direct instrument readings - the "ground truth" data.
118| Field Type | ASM Field | Examples |
119|------------|-----------|----------|
120| Absorbance | `absorbance` | 0.523 AU |
121| Fluorescence | `fluorescence` | 12500 RFU |
122| Cell count | `total-cell-count` | 2.5e6 cells |
123| Peak area | `peak-area` | 1234.5 mAU·min |
124| Retention time | `retention-time` | 5.67 min |
125| Ct value | `cycle-threshold-result` | 24.5 |
126| Concentration (measured) | `mass-concentration` | 1.5 mg/mL |
128**Rule:** If the value is a direct instrument reading that wasn't computed from other values in this analysis, it goes in `measurement-document`.
130---

6. Raw Measurement Data → measurement-document

Direct instrument readings - the "ground truth" data.

Field TypeASM FieldExamples
Absorbanceabsorbance0.523 AU
Fluorescencefluorescence12500 RFU
Cell counttotal-cell-count2.5e6 cells
Peak areapeak-area1234.5 mAU·min
Retention timeretention-time5.67 min
Ct valuecycle-threshold-result24.5
Concentration (measured)mass-concentration1.5 mg/mL

Rule: If the value is a direct instrument reading that wasn't computed from other values in this analysis, it goes in measurement-document.


Raw lines 114 to 131
132### 7. Calculated/Derived Data → `calculated-data-aggregate-document`
134Values computed from raw measurements.
136| Field Type | ASM Field | Examples |
137|------------|-----------|----------|
138| Viability % | `calculated-result` | 95.2% |
139| Concentration (from std curve) | `calculated-result` | 125 ng/µL |
140| Ratio (260/280) | `calculated-result` | 1.89 |
141| Relative quantity | `calculated-result` | 2.5x |
142| % Recovery | `calculated-result` | 98.7% |
143| CV% | `calculated-result` | 2.3% |
145**Calculated data document structure:**
146```json
148 "calculated-data-name": "viability",
149 "calculated-result": {"value": 95.2, "unit": "%"},
150 "calculation-description": "viable cells / total cells * 100"
152```
154**Rule:** If the value was computed from other measurements in this analysis, it goes in `calculated-data-aggregate-document`. Include `calculation-description` when possible.
156---

7. Calculated/Derived Data → calculated-data-aggregate-document

Values computed from raw measurements.

Field TypeASM FieldExamples
Viability %calculated-result95.2%
Concentration (from std curve)calculated-result125 ng/µL
Ratio (260/280)calculated-result1.89
Relative quantitycalculated-result2.5x
% Recoverycalculated-result98.7%
CV%calculated-result2.3%

Calculated data document structure:

{
  "calculated-data-name": "viability",
  "calculated-result": {"value": 95.2, "unit": "%"},
  "calculation-description": "viable cells / total cells * 100"
}

Rule: If the value was computed from other measurements in this analysis, it goes in calculated-data-aggregate-document. Include calculation-description when possible.


Raw lines 132 to 157
158### 8. Processed/Analyzed Data → `processed-data-aggregate-document`
160Results from data processing algorithms (peak integration, cell classification, etc.).
162| Field Type | ASM Field | Examples |
163|------------|-----------|----------|
164| Peak list | `peak-list` | Integrated peak results |
165| Cell size distribution | `cell-diameter-distribution` | Histogram data |
166| Baseline-corrected data | (in processed-data-document) | Corrected spectra |
167| Fitted curve | (in processed-data-document) | Standard curve fit |
169**Associated `data-processing-document`:**
170```json
172 "cell-type-processing-method": "trypan blue exclusion",
173 "cell-density-dilution-factor": {"value": 2, "unit": "(unitless)"},
174 "minimum-cell-diameter-setting": {"value": 5, "unit": "µm"},
175 "maximum-cell-diameter-setting": {"value": 50, "unit": "µm"}
177```
179**Rule:** If the value results from an algorithm or processing method applied to raw data, it goes in `processed-data-aggregate-document` with its processing parameters in `data-processing-document`.
181---

8. Processed/Analyzed Data → processed-data-aggregate-document

Results from data processing algorithms (peak integration, cell classification, etc.).

Field TypeASM FieldExamples
Peak listpeak-listIntegrated peak results
Cell size distributioncell-diameter-distributionHistogram data
Baseline-corrected data(in processed-data-document)Corrected spectra
Fitted curve(in processed-data-document)Standard curve fit

**Associated data-processing-document:**

{
  "cell-type-processing-method": "trypan blue exclusion",
  "cell-density-dilution-factor": {"value": 2, "unit": "(unitless)"},
  "minimum-cell-diameter-setting": {"value": 5, "unit": "µm"},
  "maximum-cell-diameter-setting": {"value": 50, "unit": "µm"}
}

Rule: If the value results from an algorithm or processing method applied to raw data, it goes in processed-data-aggregate-document with its processing parameters in data-processing-document.


Raw lines 158 to 182
183### 9. Timing/Timestamps → Various locations
185| Timestamp Type | Location | ASM Field |
186|----------------|----------|-----------|
187| Measurement time | `measurement-document` | `measurement-time` |
188| Run start time | `analysis-sequence-document` | `analysis-sequence-start-time` |
189| Run end time | `analysis-sequence-document` | `analysis-sequence-end-time` |
190| Data export time | `data-system-document` | (custom) |
192**Rule:** Use ISO 8601 format: `2024-01-15T10:30:00Z`
194---

9. Timing/Timestamps → Various locations

Timestamp TypeLocationASM Field
Measurement timemeasurement-documentmeasurement-time
Run start timeanalysis-sequence-documentanalysis-sequence-start-time
Run end timeanalysis-sequence-documentanalysis-sequence-end-time
Data export timedata-system-document(custom)

Rule: Use ISO 8601 format: 2024-01-15T10:30:00Z


Raw lines 183 to 195
196### 10. Analyst/Operator Information → `<technique>-document`
198| Field Type | ASM Field | Examples |
199|------------|-----------|----------|
200| Operator name | `analyst` | "jsmith" |
201| Reviewer | (custom or extension) | "Pending" |
203**Rule:** Analyst goes at the technique-document level, not in individual measurements.
205---

10. Analyst/Operator Information → <technique>-document

Field TypeASM FieldExamples
Operator nameanalyst"jsmith"
Reviewer(custom or extension)"Pending"

Rule: Analyst goes at the technique-document level, not in individual measurements.


Raw lines 196 to 206
207## Decision Tree
209```
210Is this field about...
212THE INSTRUMENT ITSELF?
213├── Hardware specs → device-system-document
214└── Software/files → data-system-document
216THE SAMPLE?
217└── Sample ID, name, type, batch → sample-document
219INSTRUMENT SETTINGS?
220└── Configurable parameters → device-control-aggregate-document
222ENVIRONMENTAL CONDITIONS?
223└── Temp, humidity, etc. → device-control-document
225A DIRECT READING?
226└── Raw instrument output → measurement-document
228A COMPUTED VALUE?
229├── From other measurements → calculated-data-document
230└── From processing algorithm → processed-data-document
232TIMING?
233├── When measured → measurement-document.measurement-time
234└── When run started/ended → analysis-sequence-document
236WHO DID IT?
237└── Operator/analyst → <technique>-document.analyst
238```

Decision Tree

Is this field about...

THE INSTRUMENT ITSELF?
├── Hardware specs → device-system-document
└── Software/files → data-system-document

THE SAMPLE?
└── Sample ID, name, type, batch → sample-document

INSTRUMENT SETTINGS?
└── Configurable parameters → device-control-aggregate-document

ENVIRONMENTAL CONDITIONS?
└── Temp, humidity, etc. → device-control-document

A DIRECT READING?
└── Raw instrument output → measurement-document

A COMPUTED VALUE?
├── From other measurements → calculated-data-document
└── From processing algorithm → processed-data-document

TIMING?
├── When measured → measurement-document.measurement-time
└── When run started/ended → analysis-sequence-document

WHO DID IT?
└── Operator/analyst → <technique>-document.analyst
Raw lines 207 to 239
240## Common Instrument-to-ASM Mappings
242> **Note:** These mappings are derived from the [Benchling allotropy library](https://github.com/Benchling-Open-Source/allotropy/tree/main/src/allotropy/parsers). For authoritative mappings, consult the parser source code for your specific instrument.

Common Instrument-to-ASM Mappings

Note: These mappings are derived from the Benchling allotropy library. For authoritative mappings, consult the parser source code for your specific instrument.
Raw lines 240 to 243
244### Cell Counter (Vi-CELL BLU)
245*Source: `allotropy/parsers/beckman_vi_cell_blu/vi_cell_blu_structure.py`*
247| Instrument Field | ASM Field |
248|-----------------|-----------|
249| Sample ID | `sample_identifier` |
250| Analysis date/time | `measurement_time` |
251| Analysis by | `analyst` |
252| Viability (%) | `viability` |
253| Viable (x10^6) cells/mL | `viable_cell_density` |
254| Total (x10^6) cells/mL | `total_cell_density` |
255| Cell count | `total_cell_count` |
256| Viable cells | `viable_cell_count` |
257| Average diameter (μm) | `average_total_cell_diameter` |
258| Average viable diameter (μm) | `average_live_cell_diameter` |
259| Average circularity | `average_total_cell_circularity` |
260| Cell type | `cell_type_processing_method` (data-processing) |
261| Dilution | `cell_density_dilution_factor` (data-processing) |
262| Min/Max Diameter | `minimum/maximum_cell_diameter_setting` (data-processing) |

Cell Counter (Vi-CELL BLU)

*Source: allotropy/parsers/beckman_vi_cell_blu/vi_cell_blu_structure.py*

Instrument FieldASM Field
Sample IDsample_identifier
Analysis date/timemeasurement_time
Analysis byanalyst
Viability (%)viability
Viable (x10^6) cells/mLviable_cell_density
Total (x10^6) cells/mLtotal_cell_density
Cell counttotal_cell_count
Viable cellsviable_cell_count
Average diameter (μm)average_total_cell_diameter
Average viable diameter (μm)average_live_cell_diameter
Average circularityaverage_total_cell_circularity
Cell typecell_type_processing_method (data-processing)
Dilutioncell_density_dilution_factor (data-processing)
Min/Max Diameterminimum/maximum_cell_diameter_setting (data-processing)
Raw lines 244 to 263
264### Spectrophotometer (NanoDrop)
265| Instrument Field | ASM Field |
266|-----------------|-----------|
267| Sample Name | `sample_identifier` |
268| A260, A280 | `absorbance` (with wavelength) |
269| Concentration | `mass_concentration` |
270| 260/280 ratio | `a260_a280_ratio` |
271| Pathlength | `pathlength` |

Spectrophotometer (NanoDrop)

Instrument FieldASM Field
Sample Namesample_identifier
A260, A280absorbance (with wavelength)
Concentrationmass_concentration
260/280 ratioa260_a280_ratio
Pathlengthpathlength
Raw lines 264 to 272
273### Plate Reader
274| Instrument Field | ASM Field |
275|-----------------|-----------|
276| Well | `location_identifier` |
277| Sample Type | `sample_role_type` |
278| Absorbance/OD | `absorbance` |
279| Fluorescence | `fluorescence` |
280| Plate ID | `container_identifier` |

Plate Reader

Instrument FieldASM Field
Welllocation_identifier
Sample Typesample_role_type
Absorbance/ODabsorbance
Fluorescencefluorescence
Plate IDcontainer_identifier
Raw lines 273 to 281
282### Chromatography (HPLC)
283| Instrument Field | ASM Field |
284|-----------------|-----------|
285| Sample ID | `sample_identifier` |
286| Injection Volume | `injection_volume` |
287| Retention Time | `retention_time` |
288| Peak Area | `peak_area` |
289| Peak Height | `peak_height` |
290| Column Temp | `column_oven_temperature` |
291| Flow Rate | `flow_rate` |

Chromatography (HPLC)

Instrument FieldASM Field
Sample IDsample_identifier
Injection Volumeinjection_volume
Retention Timeretention_time
Peak Areapeak_area
Peak Heightpeak_height
Column Tempcolumn_oven_temperature
Flow Rateflow_rate
Raw lines 282 to 292
293## Unit Handling
295Only use units explicitly present in source data. If a value has no unit specified:
296- Use `(unitless)` as the unit value
297- Do NOT infer units based on domain knowledge

Unit Handling

Only use units explicitly present in source data. If a value has no unit specified:

  • Use (unitless) as the unit value
  • Do NOT infer units based on domain knowledge
Raw lines 293 to 298
299## Calculated Data Traceability
301When creating calculated values, always link them to their source data using `data-source-aggregate-document`:
303```json
305 "calculated-data-name": "DIN",
306 "calculated-result": {"value": 5.8, "unit": "(unitless)"},
307 "calculated-data-identifier": "TEST_ID_147",
308 "data-source-aggregate-document": {
309 "data-source-document": [{
310 "data-source-identifier": "TEST_ID_145",
311 "data-source-feature": "sample"
312 }]
313 }
315```
317This declares: "DIN 5.8 was calculated from the sample at `TEST_ID_145`."
319**Why this matters:**
320- **Audits**: Prove a value came from specific raw data
321- **Debugging**: Trace unexpected results back to their source
322- **Reprocessing**: Know which inputs to re-analyze if algorithms change
324**Assign unique IDs to:**
325- Measurements, peaks, regions, and calculated values
326- Use a consistent naming pattern (e.g., `INSTRUMENT_TYPE_TEST_ID_N`)
328This enables bidirectional traversal: trace from calculated → raw, or raw → all derived values.
330---

Calculated Data Traceability

When creating calculated values, always link them to their source data using data-source-aggregate-document:

{
    "calculated-data-name": "DIN",
    "calculated-result": {"value": 5.8, "unit": "(unitless)"},
    "calculated-data-identifier": "TEST_ID_147",
    "data-source-aggregate-document": {
        "data-source-document": [{
            "data-source-identifier": "TEST_ID_145",
            "data-source-feature": "sample"
        }]
    }
}

This declares: "DIN 5.8 was calculated from the sample at TEST_ID_145."

Why this matters:

  • Audits: Prove a value came from specific raw data
  • Debugging: Trace unexpected results back to their source
  • Reprocessing: Know which inputs to re-analyze if algorithms change

Assign unique IDs to:

  • Measurements, peaks, regions, and calculated values
  • Use a consistent naming pattern (e.g., INSTRUMENT_TYPE_TEST_ID_N)

This enables bidirectional traversal: trace from calculated → raw, or raw → all derived values.


Raw lines 299 to 331
332## Nested Document Structure (Critical)
334A common mistake is "flattening" fields directly onto measurement documents when they should be wrapped in nested structures. This breaks schema compliance and loses semantic context.

Nested Document Structure (Critical)

A common mistake is "flattening" fields directly onto measurement documents when they should be wrapped in nested structures. This breaks schema compliance and loses semantic context.

Raw lines 332 to 335
336### Why Nesting Matters
338ASM uses nested documents for semantic grouping:
340| Document | Purpose | Contains |
341|----------|---------|----------|
342| `sample document` | What was measured | Sample ID, locations, plate identifiers |
343| `device control aggregate document` | How instrument operated | Settings, parameters, techniques |
344| `custom information document` | Vendor-specific fields | Non-standard fields that don't map to ASM |

Why Nesting Matters

ASM uses nested documents for semantic grouping:

DocumentPurposeContains
sample documentWhat was measuredSample ID, locations, plate identifiers
device control aggregate documentHow instrument operatedSettings, parameters, techniques
custom information documentVendor-specific fieldsNon-standard fields that don't map to ASM
Raw lines 336 to 345
346### Sample Document Fields
348These fields MUST be inside `sample document`, not flattened on measurement:
350```json
351// ❌ WRONG - Fields flattened on measurement
353 "measurement identifier": "TEST_001",
354 "sample identifier": "Sample_A",
355 "location identifier": "A1",
356 "absorbance": {"value": 0.5, "unit": "(unitless)"}
359// ✅ CORRECT - Fields nested in sample document
361 "measurement identifier": "TEST_001",
362 "sample document": {
363 "sample identifier": "Sample_A",
364 "location identifier": "A1",
365 "well plate identifier": "96WP001"
366 },
367 "absorbance": {"value": 0.5, "unit": "(unitless)"}
369```
371**Fields belonging in sample document:**
372- `sample identifier` - Sample ID/name
373- `written name` - Descriptive sample name
374- `batch identifier` - Batch/lot number
375- `sample role type` - Standard, blank, control, unknown
376- `location identifier` - Well position (A1, B3, etc.)
377- `well plate identifier` - Plate barcode
378- `description` - Sample description

Sample Document Fields

These fields MUST be inside sample document, not flattened on measurement:

// ❌ WRONG - Fields flattened on measurement
{
  "measurement identifier": "TEST_001",
  "sample identifier": "Sample_A",
  "location identifier": "A1",
  "absorbance": {"value": 0.5, "unit": "(unitless)"}
}

// ✅ CORRECT - Fields nested in sample document
{
  "measurement identifier": "TEST_001",
  "sample document": {
    "sample identifier": "Sample_A",
    "location identifier": "A1",
    "well plate identifier": "96WP001"
  },
  "absorbance": {"value": 0.5, "unit": "(unitless)"}
}

Fields belonging in sample document:

  • sample identifier - Sample ID/name
  • written name - Descriptive sample name
  • batch identifier - Batch/lot number
  • sample role type - Standard, blank, control, unknown
  • location identifier - Well position (A1, B3, etc.)
  • well plate identifier - Plate barcode
  • description - Sample description
Raw lines 346 to 379
380### Device Control Document Fields
382Instrument settings MUST be inside `device control aggregate document`:
384```json
385// ❌ WRONG - Device settings flattened
387 "measurement identifier": "TEST_001",
388 "device identifier": "Pod1",
389 "technique": "Custom",
390 "volume": {"value": 26, "unit": "μL"}
393// ✅ CORRECT - Settings nested in device control
395 "measurement identifier": "TEST_001",
396 "device control aggregate document": {
397 "device control document": [{
398 "device type": "liquid handler",
399 "device identifier": "Pod1"
400 }]
401 },
402 "aspiration volume": {"value": 26, "unit": "μL"}
404```
406**Fields belonging in device control:**
407- `device type` - Type of device
408- `device identifier` - Device ID
409- `detector wavelength setting` - Wavelength for detection
410- `compartment temperature` - Temperature setting
411- `sample volume setting` - Volume setting
412- `flow rate` - Flow rate setting

Device Control Document Fields

Instrument settings MUST be inside device control aggregate document:

// ❌ WRONG - Device settings flattened
{
  "measurement identifier": "TEST_001",
  "device identifier": "Pod1",
  "technique": "Custom",
  "volume": {"value": 26, "unit": "μL"}
}

// ✅ CORRECT - Settings nested in device control
{
  "measurement identifier": "TEST_001",
  "device control aggregate document": {
    "device control document": [{
      "device type": "liquid handler",
      "device identifier": "Pod1"
    }]
  },
  "aspiration volume": {"value": 26, "unit": "μL"}
}

Fields belonging in device control:

  • device type - Type of device
  • device identifier - Device ID
  • detector wavelength setting - Wavelength for detection
  • compartment temperature - Temperature setting
  • sample volume setting - Volume setting
  • flow rate - Flow rate setting
Raw lines 380 to 413
414### Custom Information Document
416Vendor-specific fields that don't map to standard ASM terms go in `custom information document`:
418```json
419"device control document": [{
420 "device type": "liquid handler",
421 "custom information document": {
422 "probe": "2",
423 "pod": "Pod1",
424 "source labware name": "Inducer",
425 "destination labware name": "GRP1"
426 }
427}]
428```

Custom Information Document

Vendor-specific fields that don't map to standard ASM terms go in custom information document:

"device control document": [{
  "device type": "liquid handler",
  "custom information document": {
    "probe": "2",
    "pod": "Pod1",
    "source labware name": "Inducer",
    "destination labware name": "GRP1"
  }
}]
Raw lines 414 to 429
430### Liquid Handler: Transfer Pairing
432For liquid handlers, a measurement represents a complete transfer (aspirate + dispense), not separate operations:
434```json
435// ❌ WRONG - Separate records for aspirate and dispense
437 {"measurement identifier": "OP_001", "transfer type": "Aspirate", "volume": {"value": 26, "unit": "μL"}},
438 {"measurement identifier": "OP_002", "transfer type": "Dispense", "volume": {"value": 26, "unit": "μL"}}
441// ✅ CORRECT - Single record with source and destination
443 "measurement identifier": "TRANSFER_001",
444 "sample document": {
445 "source well location identifier": "1",
446 "destination well location identifier": "2",
447 "source well plate identifier": "96WP001",
448 "destination well plate identifier": "96WP002"
449 },
450 "aspiration volume": {"value": 26, "unit": "μL"},
451 "transfer volume": {"value": 26, "unit": "μL"}
453```
455**Pairing logic:**
4561. Match aspirate and dispense operations by probe number
4572. Create one measurement per matched pair
4583. Use `source_*` fields for aspirate location
4594. Use `destination_*` fields for dispense location
4605. Include both `aspiration volume` and `transfer volume`

Liquid Handler: Transfer Pairing

For liquid handlers, a measurement represents a complete transfer (aspirate + dispense), not separate operations:

// ❌ WRONG - Separate records for aspirate and dispense
[
  {"measurement identifier": "OP_001", "transfer type": "Aspirate", "volume": {"value": 26, "unit": "μL"}},
  {"measurement identifier": "OP_002", "transfer type": "Dispense", "volume": {"value": 26, "unit": "μL"}}
]

// ✅ CORRECT - Single record with source and destination
{
  "measurement identifier": "TRANSFER_001",
  "sample document": {
    "source well location identifier": "1",
    "destination well location identifier": "2",
    "source well plate identifier": "96WP001",
    "destination well plate identifier": "96WP002"
  },
  "aspiration volume": {"value": 26, "unit": "μL"},
  "transfer volume": {"value": 26, "unit": "μL"}
}

Pairing logic:

  1. Match aspirate and dispense operations by probe number
  2. Create one measurement per matched pair
  3. Use source_* fields for aspirate location
  4. Use destination_* fields for dispense location
  5. Include both aspiration volume and transfer volume
Raw lines 430 to 461
462### Quick Reference: Nesting Decision
464```
465Is this field about...
467THE SAMPLE BEING MEASURED?
468├── Sample ID, name, batch → sample document
469├── Well position → sample document.location identifier
470├── Plate barcode → sample document.well plate identifier
471└── Source/destination locations → sample document (with prefixes)
473INSTRUMENT SETTINGS?
474├── Standard settings → device control aggregate document
475└── Vendor-specific → custom information document
477A MEASUREMENT VALUE?
478└── Direct on measurement document (e.g., absorbance, volume)
480TRANSFER OPERATION TYPE?
481└── DON'T use "transfer type" - pair into single measurement
482 with source/destination fields instead
483```

Quick Reference: Nesting Decision

Is this field about...

THE SAMPLE BEING MEASURED?
├── Sample ID, name, batch → sample document
├── Well position → sample document.location identifier
├── Plate barcode → sample document.well plate identifier
└── Source/destination locations → sample document (with prefixes)

INSTRUMENT SETTINGS?
├── Standard settings → device control aggregate document
└── Vendor-specific → custom information document

A MEASUREMENT VALUE?
└── Direct on measurement document (e.g., absorbance, volume)

TRANSFER OPERATION TYPE?
└── DON'T use "transfer type" - pair into single measurement
    with source/destination fields instead
Raw lines 462 to 484
485### Validation
487Use `validate_asm.py` to check for nesting issues:
488```bash
489python scripts/validate_asm.py output.json --reference known_good.json
490```
492The validator checks for:
493- Fields incorrectly flattened on measurements
494- Missing `sample document` wrapper
495- Missing `device control aggregate document` wrapper
496- Missing `custom information document` for vendor fields
497- Liquid handler: separate transfer types instead of paired records

Validation

Use validate_asm.py to check for nesting issues:

python scripts/validate_asm.py output.json --reference known_good.json

The validator checks for:

  • Fields incorrectly flattened on measurements
  • Missing sample document wrapper
  • Missing device control aggregate document wrapper
  • Missing custom information document for vendor fields
  • Liquid handler: separate transfer types instead of paired records
Raw lines 485 to 498
Runs code python scripts/validate_asm.py :489
499## Sources
501- [Allotrope Simple Model Introduction](https://www.allotrope.org/introduction-to-allotrope-simple-model)
502- [Benchling allotropy library](https://github.com/Benchling-Open-Source/allotropy)
503- [Allotrope Foundation ASM Overview](https://www.allotrope.org/asm)