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,3 @@
{"@context":["http://www.w3.org/ns/anno.jsonld","https://paperspec.scient.ing/context/scienting-1.jsonld"],"body":{"alphabet":"protein","identity":"protein:5807fcbf6d5567ca","kind":"sequence","label":"HP35","organism":"Gallus gallus","role":"names","start":42,"type":"TextualBody","value":"LSDEDFKAVFGMTRSAFANLPLWKQQNLKKEKGLF"},"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/s05a5q9qa4bhj","layer":"tag:scient.ing,2026:layer:smithlab/bq5k8r3w","motivation":"identifying","receipt":"b09z8grf3mrs4","status":"confirmed","target":{"selector":[{"anchor":{"doc":"writer2027fixed-ynr7.v3","format":"scienting-anchor/1","kind":"sentence","node":"rh0yjt9","node_hash":"aae718e0ec1f295e43fe41852e01196f97a12da3b64b4999e99fdbbb15d7329c","own_hash":"ab86459ace3bcd986530476ff939befdc2fd0ffdca0d6979284b3d942169d8b2","quote":{"exact":"villin headpiece subdomain HP35","prefix":"We test the charges on the ","suffix":", LSDEDFKAVFGMTRSAFANLPLWKQQNLKK"},"rev":0,"span":[27,58],"store":"smithlab"},"type":"AnchorSelector"},{"exact":"villin headpiece subdomain HP35","prefix":"We test the charges on the ","suffix":", LSDEDFKAVFGMTRSAFANLPLWKQQNLKK","type":"TextQuoteSelector"}],"source":"tag:scient.ing,2026:doc:smithlab/writer2027fixed-ynr7.v3","type":"SpecificResource"},"type":"Annotation"}
{"@context":["http://www.w3.org/ns/anno.jsonld","https://paperspec.scient.ing/context/scienting-1.jsonld"],"body":{"alphabet":"protein","identity":"protein:5807fcbf6d5567ca","kind":"sequence","label":"HP35","regions":[{"end":51,"label":"helix 1","start":44},{"end":59,"label":"helix 2","start":55},{"end":74,"label":"helix 3","start":63}],"role":"depicts","start":42,"type":"TextualBody","value":"LSDEDFKAVFGMTRSAFANLPLWKQQNLKKEKGLF"},"created":"2026-10-14T09:05:00Z","creator":{"id":"tag:scient.ing,2026:key:ana","name":"Ana Example","type":"Person"},"id":"tag:scient.ing,2026:annotation:smithlab/s04e0n9y6wger","layer":"tag:scient.ing,2026:layer:smithlab/bq5k8r3w","motivation":"identifying","receipt":"b09z8grf3mrs4","status":"confirmed","target":{"selector":[{"anchor":{"doc":"writer2027fixed-ynr7.v3","format":"scienting-anchor/1","kind":"sentence","node":"rh0yjt9","node_hash":"aae718e0ec1f295e43fe41852e01196f97a12da3b64b4999e99fdbbb15d7329c","own_hash":"ab86459ace3bcd986530476ff939befdc2fd0ffdca0d6979284b3d942169d8b2","quote":{"exact":"LSDEDFKAVFGMTRSAFANLPLWKQQNLKKEKGLF","prefix":"illin headpiece subdomain HP35, ","suffix":", and on its N68H variant."},"rev":0,"span":[60,95],"store":"smithlab"},"type":"AnchorSelector"},{"exact":"LSDEDFKAVFGMTRSAFANLPLWKQQNLKKEKGLF","prefix":"illin headpiece subdomain HP35, ","suffix":", and on its N68H variant.","type":"TextQuoteSelector"}],"source":"tag:scient.ing,2026:doc:smithlab/writer2027fixed-ynr7.v3","type":"SpecificResource"},"type":"Annotation"}
{"@context":["http://www.w3.org/ns/anno.jsonld","https://paperspec.scient.ing/context/scienting-1.jsonld"],"body":{"alphabet":"protein","identity":"protein:5807fcbf6d5567ca","kind":"sequence","label":"HP35 N68H","role":"reports","start":42,"type":"TextualBody","value":"LSDEDFKAVFGMTRSAFANLPLWKQQNLKKEKGLF","variants":[{"alt":"H","position":68,"ref":"N"}]},"created":"2026-10-14T09:10:00Z","creator":{"id":"tag:scient.ing,2026:software:example-model","name":"A model (illustrative)","type":"Software"},"id":"tag:scient.ing,2026:annotation:smithlab/n8pvfne6pkb9z","layer":"tag:scient.ing,2026:layer:smithlab/bq5k8r3w","motivation":"identifying","status":"proposed","target":{"selector":[{"anchor":{"doc":"writer2027fixed-ynr7.v3","format":"scienting-anchor/1","kind":"sentence","node":"rh0yjt9","node_hash":"aae718e0ec1f295e43fe41852e01196f97a12da3b64b4999e99fdbbb15d7329c","own_hash":"ab86459ace3bcd986530476ff939befdc2fd0ffdca0d6979284b3d942169d8b2","quote":{"exact":"N68H","prefix":"FANLPLWKQQNLKKEKGLF, and on its ","suffix":" variant."},"rev":0,"span":[108,112],"store":"smithlab"},"type":"AnchorSelector"},{"exact":"N68H","prefix":"FANLPLWKQQNLKKEKGLF, and on its ","suffix":" variant.","type":"TextQuoteSelector"}],"source":"tag:scient.ing,2026:doc:smithlab/writer2027fixed-ynr7.v3","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/writer2027fixed-ynr7.v3"],"format":"scienting-layer/1","id":"tag:scient.ing,2026:layer:smithlab/bq5k8r3w","label":"Sequences in the draft","license":{"spdx":"CC-BY-4.0"},"project":"smithlab-charges","purpose":"The peptide the draft tests its charges on, its helices and its variant.","total":3,"type":"AnnotationCollection","visibility":"team"}
+1
View File
@@ -0,0 +1 @@
{"at":"2026-10-14T09:30:00Z","by":"ana","doc":"writer2027fixed-ynr7.v3","evidence":[],"format":"scienting-receipt/1","id":"b09z8grf3mrs4","level":"F3","nodes":[],"records":[["annotation","s04e0n9y6wger","bff8ef0d11e39c9aaffd0434a5f648d60ab05e876f5ff4c5ad31dff861196e8f"],["annotation","s05a5q9qa4bhj","81373fb287b77a6f523085bdc9647cc2d3c72f0d1fcbfa541ed074019f821db5"]],"rev":0,"root":"df2012c1d4da1f09d001e7595e7ff466aba7c915fc5e203624d274bafb83183e","scope":"targeted:sequences","signature":{"key":"ana","scheme":"ed25519","value":"TA4GpuntRYraJ/q3WdfPNWQfy5SlAxSrsTv+Wb1lH0TeH/QNSFWLU3FatOhhSYpgkbgkYTHBuCduODIr3dGPCQ=="}}
@@ -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=="}}
+5 -4
View File
@@ -1,5 +1,6 @@
{"id":"csgs20p","ord":0,"section":null,"text_hash":"d3c3de666d0290878de3949bc0e0ffcaef965c66d2b61e81a5e615e26a2997df"}
{"id":"zvt571v","ord":0,"section":"tqcsy8w","text_hash":"b605350bc00209520b7cd8f546322663356ba630708f71bbf30aead6b3dd608e"}
{"id":"kda5wym","ord":0,"section":"tqcsy8w","text_hash":"8f22f3f58beb618723a14dd8fee8caaeb5cef6b26f43d88a5ddb4ff42f86d63e"}
{"id":"qgh1k31","ord":1,"section":"tqcsy8w","text_hash":"0d5b27a20da22922ba0c5b65e06581a09d60b899e6daddc63b0e9c1dd3819055"}
{"id":"wbntyy4","ord":2,"pinned":"energy-sentence","section":"tqcsy8w","text_hash":"3873ff52fe20b52be605c10c11e78b24bcabb05c8f725aeb4820c23428631509"}
{"id":"zvt571v","ord":0,"section":"gmzn0mf","text_hash":"b605350bc00209520b7cd8f546322663356ba630708f71bbf30aead6b3dd608e"}
{"id":"kda5wym","ord":0,"section":"gmzn0mf","text_hash":"8f22f3f58beb618723a14dd8fee8caaeb5cef6b26f43d88a5ddb4ff42f86d63e"}
{"id":"qgh1k31","ord":1,"section":"gmzn0mf","text_hash":"0d5b27a20da22922ba0c5b65e06581a09d60b899e6daddc63b0e9c1dd3819055"}
{"id":"wbntyy4","ord":2,"section":"gmzn0mf","text_hash":"3873ff52fe20b52be605c10c11e78b24bcabb05c8f725aeb4820c23428631509"}
{"id":"rh0yjt9","ord":3,"pinned":"energy-sentence","section":"gmzn0mf","text_hash":"0d2c4ad8fc643245b3c0d6680110754f04ebca185a6c5ad9d0c2ddc1c473ea6b"}
+1 -1
View File
@@ -1 +1 @@
{"claims":{"paperclaim":"amber"},"datasets":["ds-hale-bond-params","ds-hale-ctct-scan"],"documents":[{"doc":"smithlab/hale2026harmonic-damb","reason":"The bond constants we start from.","status":{"Ben Example":"read","Cara Example":"reading"},"tags":["parameters"]},{"doc":"okafor2025solvent-acth","reason":"Solvent shifts for the validation set.","tags":["spectra"]}],"drafts":["smithlab/writer2027fixed-ynr7.v3"],"format":"scienting-project/1","key":"smithlab-charges","layers":["tag:scient.ing,2026:layer:smithlab/kp4m2x7q","tag:scient.ing,2026:layer:smithlab/tr6c3q8m"],"members":[{"keys":["ana"],"person":"Ana Example","role":"owner"},{"keys":["ben","ben-spot"],"person":"Ben Example","role":"editor"},{"keys":["cara"],"person":"Cara Example","role":"reader"}],"name":"Charges and bonds","paths":[{"id":"onboarding","steps":[{"note":"Read the introduction.","ref":"smithlab/hale2026harmonic-damb","type":"document"},{"note":"Then the table.","ref":"smithlab/hale2026harmonic-damb#hj4s7pb","type":"node"},{"note":"The bond force constant, amber/k-bond.","ref":"claim:272XTX7C","type":"claim"}],"title":"First week"}],"settings":{"digit_rule":"anchored-sections","drift_threshold":"0.25","log":{"origin":"scient.ing/log/smithlab","threshold":1,"witnesses":["wit"]},"rights_unknown":"refuse","spot_check":{"minimum":10,"rate":"0.05"},"stages":"scienting-stages-default"},"store":"smithlab","views":["ctct-scan"]}
{"claims":{"paperclaim":"amber"},"datasets":["ds-hale-bond-params","ds-hale-ctct-scan"],"documents":[{"doc":"smithlab/hale2026harmonic-damb","reason":"The bond constants we start from.","status":{"Ben Example":"read","Cara Example":"reading"},"tags":["parameters"]},{"doc":"okafor2025solvent-acth","reason":"Solvent shifts for the validation set.","tags":["spectra"]}],"drafts":["smithlab/writer2027fixed-ynr7.v3"],"format":"scienting-project/1","key":"smithlab-charges","layers":["tag:scient.ing,2026:layer:smithlab/kp4m2x7q","tag:scient.ing,2026:layer:smithlab/tr6c3q8m","tag:scient.ing,2026:layer:smithlab/cm7h4p2x","tag:scient.ing,2026:layer:smithlab/bq5k8r3w"],"members":[{"keys":["ana"],"person":"Ana Example","role":"owner"},{"keys":["ben","ben-spot"],"person":"Ben Example","role":"editor"},{"keys":["cara"],"person":"Cara Example","role":"reader"}],"name":"Charges and bonds","paths":[{"id":"onboarding","steps":[{"note":"Read the introduction.","ref":"smithlab/hale2026harmonic-damb","type":"document"},{"note":"Then the table.","ref":"smithlab/hale2026harmonic-damb#hj4s7pb","type":"node"},{"note":"The bond force constant, amber/k-bond.","ref":"claim:272XTX7C","type":"claim"}],"title":"First week"}],"settings":{"digit_rule":"anchored-sections","drift_threshold":"0.25","log":{"origin":"scient.ing/log/smithlab","threshold":1,"witnesses":["wit"]},"rights_unknown":"refuse","spot_check":{"minimum":10,"rate":"0.05"},"stages":"scienting-stages-default"},"store":"smithlab","views":["ctct-scan"]}