feat: structure and sequence annotation bodies; paperspec.structures and paperspec.sequences

Chemical structures (spec/18 section 18.6) and biological sequences (18.7) tied to
the words of a paper. Minor change: two new body kinds, optional properties and
seven rules, with no valid file made invalid.

- annotation schema: structure (SMILES or SMARTS, role, identity, written, label,
  accessions, force-field terms) and sequence (alphabet, role, identity, start,
  organism, regions, variants); body_kind in sql/store.sql; nine terms in the
  JSON-LD context; rules layer.structure.{value,identity,term} and
  layer.sequence.{value,identity,region,variant}.
- paperspec.structures reads the atoms and bonds of a SMILES or SMARTS with the
  standard library, so a term's atoms are checked without a toolkit; checked against
  RDKit on a corpus and random texts. paperspec.sequences checks alphabets,
  identities, regions and variants.
- fixtures/records/chemistry (on the main example) and biology (on the draft, which
  gains a last sentence), vectors/structures.jsonl and vectors/sequences.jsonl;
  check.py runs both layers and the vectors; counts, guides and CHANGELOG updated.
- the prose check no longer takes organism for a UK spelling.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8cL4zN4XpaQF5cBtASzfq
This commit is contained in:
alexmandClaude committed 2026-10-18 15:38:31 -04:00
1 parent 7890fa1ad7
commit 3ab96d653f
36 files changed
+1488 -44

No files matched your search

@@ -0,0 +1,4 @@
{"@context":["http://www.w3.org/ns/anno.jsonld","https://paperspec.scient.ing/context/scienting-1.jsonld"],"body":{"accessions":[{"db":"pubchem","id":"6324"}],"format":"chemical/x-daylight-smiles","identity":"OTMSDBZUPAUEDD-UHFFFAOYSA-N","kind":"structure","label":"ethane","role":"names","type":"TextualBody","value":"CC"},"created":"2026-10-14T09:00:00Z","creator":{"id":"tag:scient.ing,2026:key:ana","name":"Ana Example","type":"Person"},"id":"tag:scient.ing,2026:annotation:smithlab/n0539sf2trjdn","layer":"tag:scient.ing,2026:layer:smithlab/cm7h4p2x","motivation":"identifying","receipt":"q9z9fee99g3cg","status":"confirmed","target":{"selector":[{"anchor":{"doc":"hale2026harmonic-damb","format":"scienting-anchor/1","kind":"sentence","node":"qwgfg51","node_hash":"4a3be03766323b3c88d5b43591b0f573823b89fe582f2c3a6f0b43474685a30d","own_hash":"04bd6d16a9310fa00dbf5d0930f4dbaca52b6bb58e76bb3cdd348bec73a27737","quote":{"exact":"ethane","prefix":"ws the scan for the C–C bond of ","suffix":".a"},"rev":12,"span":[44,50],"store":"smithlab"},"type":"AnchorSelector"},{"exact":"ethane","prefix":"ws the scan for the C–C bond of ","suffix":".a","type":"TextQuoteSelector"}],"source":"tag:scient.ing,2026:doc:smithlab/hale2026harmonic-damb","type":"SpecificResource"},"type":"Annotation"}
{"@context":["http://www.w3.org/ns/anno.jsonld","https://paperspec.scient.ing/context/scienting-1.jsonld"],"body":{"format":"chemical/x-daylight-smiles","identity":"XLYOFNOQVPJJNP-UHFFFAOYSA-N","kind":"structure","label":"water","role":"names","type":"TextualBody","value":"O"},"created":"2026-10-14T09:05:00Z","creator":{"id":"tag:scient.ing,2026:software:example-model","name":"A model (illustrative)","type":"Software"},"id":"tag:scient.ing,2026:annotation:smithlab/fdkfpz98yw4ae","layer":"tag:scient.ing,2026:layer:smithlab/cm7h4p2x","motivation":"identifying","status":"proposed","target":{"selector":[{"anchor":{"doc":"hale2026harmonic-damb","format":"scienting-anchor/1","kind":"sentence","node":"hca6dc5","node_hash":"8cfed5a34aab28517e89e8a164f0f96c14361de83ebc800439116e83ef479f34","own_hash":"c270571517825ceed31ca912b80ac76203effe47f1c84f8ee8962800d0afc92f","quote":{"exact":"Water","suffix":", H$_2$O, served as the first te"},"rev":12,"span":[0,5],"store":"smithlab"},"type":"AnchorSelector"},{"exact":"Water","prefix":"","suffix":", H$_2$O, served as the first te","type":"TextQuoteSelector"}],"source":"tag:scient.ing,2026:doc:smithlab/hale2026harmonic-damb","type":"SpecificResource"},"type":"Annotation"}
{"@context":["http://www.w3.org/ns/anno.jsonld","https://paperspec.scient.ing/context/scienting-1.jsonld"],"body":{"format":"chemical/x-daylight-smarts","identity":"smarts:2e2a923f840c","kind":"structure","label":"CT–CT","role":"parametrizes","terms":[{"atoms":[0,1],"kind":"bond","source":"Table 1, Set A","types":["CT","CT"],"units":{"k_r":"kcal mol-1 A-2","r_eq":"A"},"values":{"k_r":"310.0","r_eq":"1.526"}},{"atoms":[0,1],"kind":"bond","source":"Table 1, Set B","types":["CT","CT"],"units":{"k_r":"kcal mol-1 A-2","r_eq":"A"},"values":{"k_r":"305.2","r_eq":"1.5260"}}],"type":"TextualBody","value":"[CX4][CX4]","written":"CT–CT"},"created":"2026-10-14T09:10:00Z","creator":{"id":"tag:scient.ing,2026:key:ana","name":"Ana Example","type":"Person"},"id":"tag:scient.ing,2026:annotation:smithlab/p9kaa8djhezd2","layer":"tag:scient.ing,2026:layer:smithlab/cm7h4p2x","motivation":"identifying","receipt":"q9z9fee99g3cg","status":"confirmed","target":{"selector":[{"anchor":{"context":{"column_path":["Bond"],"row_path":["Bond parameters","CT–CT"],"table_label":"Table 1"},"doc":"hale2026harmonic-damb","format":"scienting-anchor/1","kind":"cell","node":"vd76637","node_hash":"33810e4da42f8e65a224b5369c06fe8db254890294b7b6760808fe6e039da21a","own_hash":"2ef085ec0ae741d540d9ace389393d02c30523a66f55648470404733c73ecde3","quote":{"exact":"CT–CT"},"rev":12,"store":"smithlab"},"type":"AnchorSelector"},{"exact":"CT–CT","prefix":"","suffix":"","type":"TextQuoteSelector"}],"source":"tag:scient.ing,2026:doc:smithlab/hale2026harmonic-damb","type":"SpecificResource"},"type":"Annotation"}
{"@context":["http://www.w3.org/ns/anno.jsonld","https://paperspec.scient.ing/context/scienting-1.jsonld"],"body":{"accessions":[{"db":"pubchem","id":"962"}],"format":"chemical/x-daylight-smiles","identity":"XLYOFNOQVPJJNP-UHFFFAOYSA-N","kind":"structure","label":"water","role":"parametrizes","terms":[{"atoms":[0,1],"kind":"bond","source":"Table 1, Set A","types":["OW","HW"],"units":{"k_r":"kcal mol-1 A-2","r_eq":"A"},"values":{"k_r":"553.0","r_eq":"0.9572"}},{"atoms":[0,1],"kind":"bond","source":"Table 1, Set B","types":["OW","HW"],"units":{"k_r":"kcal mol-1 A-2","r_eq":"A"},"values":{"k_r":"548.1","r_eq":"0.9570"}}],"type":"TextualBody","value":"O([H])[H]","written":"OW–HW"},"created":"2026-10-14T09:15:00Z","creator":{"id":"tag:scient.ing,2026:key:ana","name":"Ana Example","type":"Person"},"id":"tag:scient.ing,2026:annotation:smithlab/n0xj47295v5p3","layer":"tag:scient.ing,2026:layer:smithlab/cm7h4p2x","motivation":"identifying","receipt":"q9z9fee99g3cg","status":"confirmed","target":{"selector":[{"anchor":{"context":{"column_path":["Bond"],"row_path":["Bond parameters","OW–HW"],"table_label":"Table 1"},"doc":"hale2026harmonic-damb","format":"scienting-anchor/1","kind":"cell","node":"yvkd7xr","node_hash":"aab8791a24bc4067c7e37fc5f0244d2128205e0a169e65c2c0fad977aabce313","own_hash":"943ff2019857c2f6dc6d5c08bb0f4423bb31a8d2fac8951e3fa79c1e2ef9a736","quote":{"exact":"OW–HW"},"rev":12,"store":"smithlab"},"type":"AnchorSelector"},{"exact":"OW–HW","prefix":"","suffix":"","type":"TextQuoteSelector"}],"source":"tag:scient.ing,2026:doc:smithlab/hale2026harmonic-damb","type":"SpecificResource"},"type":"Annotation"}
+1
View File
@@ -0,0 +1 @@
{"@context":["http://www.w3.org/ns/anno.jsonld","https://paperspec.scient.ing/context/scienting-1.jsonld"],"audience":"expert","created":"2026-10-14T09:00:00Z","creator":{"id":"tag:scient.ing,2026:key:ana","name":"Ana Example","type":"Person"},"docs":["smithlab/hale2026harmonic-damb"],"format":"scienting-layer/1","id":"tag:scient.ing,2026:layer:smithlab/cm7h4p2x","label":"Structures in Hale and Osei","license":{"spdx":"CC-BY-4.0"},"project":"smithlab-charges","purpose":"The molecules the paper names and the force-field constants it gives for them.","total":4,"type":"AnnotationCollection","visibility":"team"}
+1
View File
@@ -0,0 +1 @@
{"at":"2026-10-14T09:30:00Z","by":"ana","doc":"hale2026harmonic-damb","evidence":[],"format":"scienting-receipt/1","id":"q9z9fee99g3cg","level":"F3","nodes":[],"records":[["annotation","n0539sf2trjdn","9a7b0badfa3bd023d24b6de3509523cbc6566bc82e8a17953ea4297987e0c560"],["annotation","n0xj47295v5p3","17ce7549a4c24f8e20b3b539b942436ecbde0e09f40c336ff5830f692226cbfc"],["annotation","p9kaa8djhezd2","239247de4906cabbf0da105ce026567646d15e2ca5988ad05d829f9378934a95"]],"rev":12,"root":"cf1d025838f64c48e2ae4260753735b9cb2a6e276fc7139d2ba5780a3067fa03","scope":"targeted:structures","signature":{"key":"ana","scheme":"ed25519","value":"PajQPzelH/egWsv4O8yja4acSnrwmWAHCwRRGxOEKHSkYamxaqORnLiKqSb5RFZf1V+x7Jzrk3ZGzHqEK4euCg=="}}