Skip to main content

Crate molframe_cif

Crate molframe_cif 

Source
Expand description

Reading and writing PDBx/mmCIF.

The format the archive actually distributes, and the one every other structural format is now defined against. Reading it happens in two steps that are deliberately separate: a document that preserves what the file said, and a structure that says what it means. Keeping them apart is what lets a file survive a round trip through categories this library has no interpretation for.

Re-exports§

pub use document::Category;
pub use document::CifValue;
pub use document::Column;
pub use document::DataBlock;
pub use document::Document;
pub use write::CanonicalAtomRow;
pub use write::CanonicalProjection;
pub use write::CanonicalValue;
pub use write::canonical_projection;

Modules§

document
Lossless, order-preserving CIF document model.
lexer
CIF lexical analysis.

Structs§

CanonicalAtomRow
One allocation-free atom-site row over a borrowed model snapshot.
CanonicalProjection
A validated semantic projection that can be consumed without text or a DOM.
CifReader
The reader for PDBx/mmCIF.
CifWriteOptions
Decisions that cannot be recovered from a lowered structure.
MmcifBatchSource
Incremental mmCIF coordinate rows.
Rows
The rows of one category, as a cursor a caller can walk.
SmallCifAtom
One crystallographic atom site from core CIF.
SmallCifBond
One geometric bond record with resolved atom indices.
SmallCifOptions
Explicit decisions for lowering a small-molecule CIF.
SmallCifStructure
One core-CIF crystal model.

Enums§

CanonicalValue
A typed canonical value with CIF’s two distinct missing-value states.
CifWriteError
A missing or invalid value that prevents canonical output.
CifWriteToError
A canonical projection or output-stream failure.
PdbmlError
Malformed or unsupported PDBML framing.
PdbmlReadError
Failure either in XML conversion or existing mmCIF semantic lowering.
SmallCifDialect
Dictionary dialect used to resolve core-CIF item names.
SmallCifError
Invalid core-CIF small-molecule model.

Functions§

canonical_projection
Validates and borrows the canonical structure projection.
lower
Builds a structure from the first block of a document.
lower_small_cif
Lowers the first core-CIF data block to a small-molecule crystal model. Current DDL2 category/item names are used. Legacy DDL1 tags require lower_small_cif_with_options and SmallCifOptions::ddl1.
lower_small_cif_with_options
Lowers the first core-CIF block under an explicit dictionary dialect.
parse
Reads a document.
parse_pdbml_document
Parses PDBML/XML into the same lossless document used by mmCIF. Unknown categories and items are retained in source order.
quote_text
Quotes arbitrary text without changing its value when reparsed.
read
Reads a structure.
read_pdbml
Parses and semantically lowers PDBML through the existing mmCIF lowering.
read_with_document
Reads both the lossless document and its normalised structure in one parse.
render_value
Renders a typed value as one CIF token or text field.
split_tag
Splits an item name into its category and its item.
write_canonical
Writes a structure using only identifiers retained in the structure.
write_canonical_to
Streams canonical mmCIF directly to a byte destination.
write_canonical_with_options
Writes a structure with explicit choices for identities not retained by the graph.
write_pdbml
Writes one lossless document as PDBML/XML.
write_preserving
Writes a document back out, preserving what it held.
write_preserving_to
Streams a document while preserving its retained category/value order.
write_quoted
Appends arbitrary text as one CIF token or text field without a temporary allocation.

Type Aliases§

ParseResult
A document and everything that was wrong with the file it came from.