Skip to main content

Module sdf

Module sdf 

Source
Expand description

SDF (structure-data format) compound files, read into a table: one row per record, with the molecule’s name, its atom and bond counts, and every data item (> <FIELD>) as a column.

A record is a molfile header (name, program, comment, counts line), the connection table up to M END, then data items, and ends at $$$$. The connection table is passed over line by line and never held. The reader takes the file a piece at a time; a line, a value and the number of fields are bounded.

Structs§

FieldColumn
What one data field’s values were, for its type.
SdfReader
Reads an SDF file a piece at a time.
Stats
What reading noticed.

Constants§

BATCH_ROWS
Rows held before a batch is handed over.
BATCH_TEXT
Text held before a batch is handed over, whatever its rows. Each cell counts too, empty or not: every field is a column in every row, so a file of thousands of fields would otherwise hold gigabytes of empty cells in one batch.
CORE
The columns every SDF table starts with.
MAX_LINE
The longest line kept; the rest of a longer one is cut off.
MAX_NAME
The longest field name.
MAX_VALUE
The longest value kept, its lines together; the rest is cut off.

Functions§

detail
The SDF tab of the Info panel: the counts and each field’s type and coverage.
item_name
The field a data item header names: what is between < and >, or else the first word after the > (> DT12).
looks_like
Whether the first bytes look like an SDF file: a counts line (V2000 or V3000) on the fourth line, or M END followed by a data item or $$$$.