Skip to content

About

Check a lab instrument export or an ASM JSON file against allotropy and the Allotrope Simple Model schemas, entirely in the browser.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

allotropy-frontdoor

A single web page that answers one question about a lab data file: is it standardized?

Drop an instrument export (a plate reader text file, a qPCR spreadsheet, a cell counter CSV) or an Allotrope Simple Model (ASM) JSON document. The page converts an export with allotropy and validates the result against the ASM schema it names. An ASM document is validated directly. If the file does not pass, the page lists each reason with its location in the document.

Everything runs in the browser. allotropy is loaded with Pyodide inside a web worker, so the file is never uploaded and there is no server to run.

Run it

npm install
npm run dev

npm run build writes a static site to dist/ that any static host can serve. The first visit downloads the Python runtime and allotropy from the Pyodide CDN and PyPI; the browser caches them after that.

How a file is checked

src/allotropy/check.py holds the logic and src/allotropy/worker.ts runs it.

  1. A .json file that carries $asm.manifest is treated as an ASM document and validated against the schema bundled with allotropy for that manifest.
  2. Anything else is treated as an instrument export. Every allotropy parser that reads the file's extension is asked whether it recognizes the contents.
  3. Each parser that claims the file converts it, and the output is validated against its schema. The first one that produces valid ASM is the answer.
  4. A schema failure inside an anyOf or oneOf is reported by the branch that got deepest into the document, which is the message a person can act on.

Three things differ from calling allotrope_from_file with no vendor:

  • allotropy picks the first parser that gets through its reader, which can be one that then fails to convert. Here the other claimants get their turn, so a Gen5 Image export is not failed as a broken Gen5 export.
  • Some exports are accepted by two parsers (the two Beckman Echo formats, xPONENT and INTELLIFLEX, VISIONlite and Genesys On-Board). For files up to 1 MB the page says so and lets the reader choose.
  • When no parser recognizes the contents, the page says the file was not recognized instead of reporting the errors of whichever parser was most lenient.

Limits

  • Files over 25 MB are refused.
  • A check is stopped after five minutes and the worker restarted. Large spreadsheets are the slow case.
  • A pass means the file converts with this version of allotropy and validates against the schemas it ships. It is not a certification by the Allotrope Foundation.

Versions

The versions in worker.ts are pinned on purpose.

Package Version Why
Pyodide 0.29.3 Ships pandas 2.3. Later releases ship pandas 3, on which allotropy's parsers fail.
allotropy 0.1.152
jsonschema 4.17.3 allotropy requires a release below 4.18.
rainbow-api 1.0.10 Pinned by allotropy.

Packages are installed without dependency resolution, so the list in worker.ts is the whole environment. tzdata has to be named explicitly under Pyodide.

Testing against allotropy's fixtures

scripts/corpus.mjs runs every fixture in an allotropy checkout through check.py on the same Pyodide stack and compares each output with the ASM allotropy expects.

git clone https://github.com/Benchling-Open-Source/allotropy
CORPUS=allotropy/tests/parsers npm run corpus

A full run takes about half an hour in one process. SHARDS=4 SHARD=0 through SHARD=3 split it across four.

With the versions above, on allotropy e634381a: 398 files, 5 skipped for size or time. All 352 fixtures that have an expected ASM pass, and 326 of the outputs are identical to it after generated identifiers are blanked. 21 of the rest convert under a sibling parser that also accepts the file. Of the 20 error fixtures, 19 are rejected.

License

MIT. The example files under src/allotropy/examples/ come from allotropy's test data; see the NOTICE.md there.

About

Check a lab instrument export or an ASM JSON file against allotropy and the Allotrope Simple Model schemas, entirely in the browser.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages