Document¶
The top-level JSON object of a KET file.
A document is one JSON object. root.nodes lists what the document shows. Molecules, R-groups and monomers are stored next to root under keys of their own (mol0, rg1, monomer3) and referenced from root.nodes; arrows, pluses, shapes, texts and images sit inline in root.nodes. Monomer templates are stored the same way and listed in root.templates.
Appears in¶
The whole file.
Identified by¶
A JSON object with a root key whose value has a nodes array.
Attributes¶
ket_version¶
Type: string
Required: no
Values: a version,
MAJOR.MINOR.PATCH, such as"2.0.0"Pattern:
^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$Since: 2.0.0
Version of the format the document follows.
A document without ket_version follows version 1.0.0. Versioning says what the number means, when it changes and what a reader does with a version it does not know.
root¶
Type: Root
Required: yes
What the document contains: its nodes, and the connections and templates they use.
header¶
Type: object
Required: no
Metadata of the document.
header.moleculeName¶
Type: string
Required: no
Name of the structure the document holds.
mol<N>¶
Type: Molecule
Required: no
Key pattern:
^mol\d+$
A molecule, referenced from root.nodes as {"$ref": "mol<N>"}.
Molecules are numbered from mol0 in the order in which root.nodes lists them.
rg<N>¶
Type: R-group
Required: no
Key pattern:
^rg([1-9]|[12][0-9]|3[0-2])$
An R-group definition; N is the R-group number, so rg1 holds R1.
N is from 1 to 32 and equals the R-group number given in the definition’s rlogic.
monomer<N>¶
Type: one of Monomer, Ambiguous monomer
Required: no
Key pattern:
^monomer\d+$
A monomer or an ambiguous monomer placed on the canvas, referenced from root.nodes.
monomerTemplate-<id>¶
Type: Monomer template
Required: no
Key pattern:
^monomerTemplate-.+$
A monomer template, listed in root.templates; <id> is the template’s id.
ambiguousMonomerTemplate-<id>¶
Required: no
Key pattern:
^ambiguousMonomerTemplate-.+$
An ambiguous monomer template, listed in root.templates.
monomerShape-<id>¶
Type: Monomer shape
Required: no
Key pattern:
^monomerShape-.+$
A monomer shape, referenced from root.nodes.
monomerGroupTemplate-<id>¶
Type: Monomer group template
Required: no
Key pattern:
^monomerGroupTemplate-.+$
A monomer group template of a monomer library, listed in root.templates.
Rules¶
rootis required.The top-level keys are
ket_version,root,headerand the keys listed here for objects thatrootreferences.Every
$refnames a top-level key of the document.Every molecule, R-group, monomer and monomer shape is referenced from
root.nodes, and every template fromroot.templates.