Schemas¶
Auto-generated from docstrings. Typed Pydantic models used throughout the Functions API.
pandora.schemas.canonicalisation
¶
AltlocRules
¶
Bases: BaseModel
Policy for resolving altloc-disordered atoms to a single conformer.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
AltlocStrategy
|
Kept as-is, or resolved to the best-occupancy/first/ user-defined conformer. |
tie_breaker |
AltlocTieBreaker
|
How ties in |
user_defined_altloc |
str | None
|
The altloc code to select when
|
record_selection |
bool
|
Whether altloc selection diagnostics are recorded. |
AltlocSelectionMapping
¶
Bases: BaseModel
Every altloc selection made while canonicalising a structure.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
list[AltlocSelectionMappingItem]
|
One |
AltlocSelectionMappingItem
¶
Bases: BaseModel
Record of which altloc was selected for one residue, and why.
Attributes:
| Name | Type | Description |
|---|---|---|
canonical_chain_id |
str
|
The canonical chain id the residue belongs to. |
residue_id |
str
|
The residue's identifier ( |
selected_altloc |
str
|
The altloc code that was kept. |
available_altlocs |
list[str]
|
Every altloc code that was present before selection. |
selection_reason |
Literal['best_occupancy', 'first_alphabetical', 'last_alphabetical', 'user_defined']
|
Why this altloc was selected. |
AssemblyChainCopy
¶
Bases: BaseModel
One chain generated by expanding an assembly's symmetry operators.
Attributes:
| Name | Type | Description |
|---|---|---|
canonical_chain_id |
str
|
The id assigned to the generated chain. |
source_chain_id |
str
|
The original (asymmetric-unit) chain id the copy was generated from. |
operator_id |
str
|
The id of the symmetry operator applied to produce this copy. |
AssemblyIdRules
¶
Bases: BaseModel
Policy for how assembly ids are canonicalised.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
AssemblyIdStrategy
|
Kept as-is, remapped sequentially, or standardized. |
AssemblyMapping
¶
Bases: BaseModel
Original-to-canonical id mapping for every assembly.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
list[AssemblyMappingItem]
|
One |
AssemblyMappingItem
¶
Bases: BaseModel
Original-to-canonical id mapping for one assembly.
Attributes:
| Name | Type | Description |
|---|---|---|
canonical_assembly_id |
str
|
The canonicalised assembly id. |
original_assembly_id |
str
|
The assembly id as originally deposited. |
chain_copies |
list[AssemblyChainCopy]
|
Chains generated by expanding this assembly's
symmetry operators, if |
AssemblyRules
¶
Bases: BaseModel
Policy for selecting/standardizing which assemblies are kept.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
AssemblyStrategy
|
Kept as reported, standardized to the biological assembly, or only the first assembly. |
preferred_assembly_source |
PreferredAssemblySource
|
Which source's "preferred assembly" flag to trust when standardizing. |
record_original_assembly_mapping |
bool
|
Whether assembly id mappings are recorded. |
CanonicalMappings
¶
Bases: BaseModel
Every id/numbering mapping produced by one canonicalisation run.
Attributes:
| Name | Type | Description |
|---|---|---|
chain_id_mapping |
ChainIdMapping
|
The chain id mapping produced by this run. |
residue_number_mapping |
ResidueNumberMapping
|
The residue number mapping produced by this run. |
assembly_mapping |
AssemblyMapping
|
The assembly id mapping produced by this run. |
entity_mapping |
EntityMapping
|
The entity id mapping produced by this run. |
altloc_selection_mapping |
AltlocSelectionMapping
|
The altloc selections made during this run. |
modified_residue_mapping |
ModifiedResidueMapping
|
The modified residues renamed during this run. |
ChainIdMapping
¶
Bases: BaseModel
Original-to-canonical id mapping for every chain.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
list[ChainIdMappingItem]
|
One |
ChainIdMappingItem
¶
Bases: BaseModel
Original-to-canonical id mapping for one chain.
Attributes:
| Name | Type | Description |
|---|---|---|
canonical_chain_id |
str
|
The canonicalised chain id. |
original_chain_id |
str
|
The |
original_auth_chain_id |
str
|
The |
ChainIdRules
¶
Bases: BaseModel
Policy for how chain ids are canonicalised.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
ChainIdStrategy
|
Kept as-is, remapped sequentially, or replaced by the author chain id. |
EntityMapping
¶
Bases: BaseModel
Original-to-canonical id mapping for every entity.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
list[EntityMappingItem]
|
One |
EntityMappingItem
¶
Bases: BaseModel
Original-to-canonical id mapping for one entity (possibly merging several original ids into one).
Attributes:
| Name | Type | Description |
|---|---|---|
canonical_entity_id |
str
|
The canonicalised entity id. |
original_entity_ids |
list[str]
|
The original entity id(s) merged into this canonical id. |
EntityRules
¶
Bases: BaseModel
Policy for standardizing or merging entity ids.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
EntityStrategy
|
Kept as-is, standardized to sequential ids, or merged when sequence-identical. |
preserve_original_entity_ids |
bool
|
Whether original entity ids are kept in the mapping when merging. |
IdentifierRules
¶
Bases: BaseModel
Bundles the chain id, residue numbering, and assembly id policies.
Attributes:
| Name | Type | Description |
|---|---|---|
chain_id |
ChainIdRules
|
The chain id canonicalisation policy. |
residue_numbering |
ResidueNumberingRules
|
The residue numbering canonicalisation policy. |
assembly_id |
AssemblyIdRules
|
The assembly id canonicalisation policy. |
IncompleteChainRules
¶
Bases: BaseModel
Policy for handling chains with non-contiguous residue numbering.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
IncompleteChainStrategy
|
Kept as-is, excluded, or truncated to the longest contiguous region. |
LigandRules
¶
Bases: BaseModel
Policy for filtering non-polymer ligands, waters, and ions.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
LigandStrategy
|
Kept as-is, filtered by |
keep_waters |
bool
|
Whether water molecules are kept. |
keep_ions |
bool
|
Whether ions are kept. |
keep_nonpolymer_ligands |
bool
|
Whether other non-polymer ligands are kept. |
MissingAtomsRules
¶
Bases: BaseModel
Policy for handling polymer residues missing backbone atoms.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
MissingAtomsStrategy
|
Kept as-is, flagged, dropped, or imputed. |
allow_imputation |
bool
|
Whether missing atoms may be imputed (not yet implemented). |
record_missingness |
bool
|
Whether missing-atom diagnostics are recorded. |
MissingDataRules
¶
Bases: BaseModel
Bundles the missing-atoms, missing-residues, and incomplete-chain policies.
Attributes:
| Name | Type | Description |
|---|---|---|
missing_atoms |
MissingAtomsRules
|
The missing-atoms policy. |
missing_residues |
MissingResiduesRules
|
The missing-residues (sequence gap) policy. |
incomplete_chains |
IncompleteChainRules
|
The incomplete-chain policy. |
MissingResiduesRules
¶
Bases: BaseModel
Policy for handling sequence gaps within a chain.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
MissingResiduesStrategy
|
Kept as-is, flagged, dropped, or imputed. |
record_gaps |
bool
|
Whether sequence-gap diagnostics are recorded. |
ModifiedResidueMapping
¶
Bases: BaseModel
Every modified residue renamed during one canonicalisation run.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
list[ModifiedResidueMappingItem]
|
One entry per renamed residue. |
ModifiedResidueMappingItem
¶
Bases: BaseModel
One modified residue renamed to its parent.
Attributes:
| Name | Type | Description |
|---|---|---|
chain_id |
str
|
The residue's original |
seq_id |
int | None
|
The residue's |
auth_seq_id |
str | None
|
The residue's |
original_comp_id |
str
|
The modified residue's comp_id (e.g. "MSE"). |
parent_comp_id |
str
|
The standard parent it was renamed to (e.g. "MET"). |
ModifiedResidueRules
¶
Bases: BaseModel
Canonicalisation policy for modified polymer residues.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
ModifiedResidueStrategy
|
Kept as-is, or renamed to the parent residue given by
|
comp_ids |
list[str]
|
Which modified residues to map. Empty means every modified residue with a known parent. |
ResidueNumberMapping
¶
Bases: BaseModel
Original-to-canonical residue numbering for every residue.
Attributes:
| Name | Type | Description |
|---|---|---|
items |
list[ResidueNumberMappingItem]
|
One |
ResidueNumberMappingItem
¶
Bases: BaseModel
Original-to-canonical residue numbering for one residue.
Attributes:
| Name | Type | Description |
|---|---|---|
canonical_chain_id |
str
|
The canonical chain id the residue belongs to. |
canonical_seq_id |
int
|
The residue's canonicalised sequence number. |
original_chain_id |
str
|
The chain id as originally deposited. |
original_seq_id |
int | None
|
The |
original_auth_seq_id |
str
|
The |
original_insertion_code |
str | None
|
The insertion code as originally deposited, if any. |
ResidueNumberingRules
¶
Bases: BaseModel
Policy for how residue numbering is canonicalised.
Attributes:
| Name | Type | Description |
|---|---|---|
strategy |
ResidueNumberingStrategy
|
Kept as-is, replaced by the author numbering, or renumbered sequentially. |
preserve_insertion_codes |
bool
|
Whether insertion codes are kept
when |
ValidationRules
¶
Bases: BaseModel
Policy for how canonicalisation validation issues are treated.
Attributes:
| Name | Type | Description |
|---|---|---|
strictness |
ValidationStrictness
|
How strictly validation issues are treated ("permissive" is not yet fully implemented). |
fail_on_unresolved_issues |
bool
|
Whether an unresolved validation error raises instead of just being recorded. |
warnings_as_errors |
bool
|
Whether warnings are promoted to errors. |
canonicalisationPolicy
¶
Bases: BaseModel
The full, named policy governing one canonicalisation run: every rule group plus provenance settings.
Attributes:
| Name | Type | Description |
|---|---|---|
policy_id |
str
|
A unique identifier for this policy. |
policy_name |
str
|
A human-readable name for this policy. |
policy_version |
str
|
The policy's version string. |
description |
str
|
A free-text description of the policy. |
identifier_rules |
IdentifierRules
|
The chain id / residue numbering / assembly id rules. |
missing_data_rules |
MissingDataRules
|
The missing-atoms / missing-residues / incomplete-chain rules. |
altloc_rules |
AltlocRules
|
The altloc resolution rules. |
assembly_rules |
AssemblyRules
|
The assembly selection rules. |
entity_rules |
EntityRules
|
The entity id rules. |
ligand_rules |
LigandRules
|
The ligand/water/ion filtering rules. |
modified_residue_rules |
ModifiedResidueRules
|
The modified-residue mapping rules. |
validation_rules |
ValidationRules
|
The validation strictness rules. |
provenance_rules |
canonicalisationProvenanceRules
|
Which provenance is recorded for this run. |
canonicalisationProvenance
¶
Bases: BaseModel
Record of one canonicalisation run: which policy ran, what it changed, and (optionally) a diagnostics summary.
Attributes:
| Name | Type | Description |
|---|---|---|
canonicalised_at |
str
|
When this canonicalisation run completed, as an ISO 8601 timestamp. |
policy_id |
str
|
The id of the policy that ran. |
policy_name |
str
|
The name of the policy that ran. |
policy_version |
str
|
The version of the policy that ran. |
transforms |
list[str]
|
The transform labels applied (e.g. "chain_id:remap"), one per rule group that deviated from "preserve". |
report |
dict[str, Any]
|
A summary of warning/error counts, if
|
dropped_raw_categories |
list[str]
|
The verbatim mmCIF categories removed
from |
canonicalisationProvenanceRules
¶
Bases: BaseModel
Policy for which canonicalisation provenance is recorded.
Attributes:
| Name | Type | Description |
|---|---|---|
record_original_mappings |
bool
|
Whether id/numbering mappings are recorded. |
record_transforms |
bool
|
Whether the list of applied transforms is recorded. |
record_policy_application |
bool
|
Whether the policy id/name/version is recorded. |
emit_canonicalisation_report |
bool
|
Whether a warning/error count summary is recorded in provenance. |
pandora.schemas.structure
¶
AssemblyGenRecord
¶
Bases: BaseModel
One assembly-generation instruction: which operators apply to which asym units.
Attributes:
| Name | Type | Description |
|---|---|---|
assembly_id |
str
|
The assembly this generator instruction belongs to. |
oper_expression |
str
|
The comma-separated operator ids to apply. |
asym_id_list |
list[str]
|
The asym units (chains) the operators are applied to. |
AssemblyOperRecord
¶
Bases: BaseModel
One symmetry operator (rotation matrix + translation vector) used to generate an assembly.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The operator's id. |
type |
str | None
|
The operator type (e.g. "identity operation", "crystal symmetry operation"). |
matrix |
list[list[float]] | None
|
The 3x3 rotation matrix. |
vector |
list[float] | None
|
The 3-element translation vector. |
AssemblyRecord
¶
Bases: BaseModel
One biological/crystallographic assembly, from
_pdbx_struct_assembly and its generators/operators.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The assembly's id. |
details |
str | None
|
Free-text details about the assembly. |
method_details |
str | None
|
The method used to determine the assembly. |
oligomeric_details |
str | None
|
A description of the oligomeric state (e.g. "dimeric"). |
oligomeric_count |
int | None
|
The number of polymer chains in the assembly. |
generators |
list[AssemblyGenRecord]
|
The generator instructions (which operators apply to which chains) that build this assembly. |
operators |
list[AssemblyOperRecord]
|
The symmetry operators referenced by |
author_determined |
bool
|
Whether the depositing author flagged this as the biological assembly. |
software_determined |
bool
|
Whether assembly-detection software (e.g. PISA) flagged this as the biological assembly. |
AsymRecord
¶
Bases: BaseModel
One asym unit (label_asym_id), mapping a chain to its entity.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The |
entity_id |
str
|
The id of the entity this asym unit belongs to. |
auth_id |
str | None
|
The |
AtomSiteRecord
¶
Bases: BaseModel
One row from _atom_site: a single atom's identity, position, and
metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
group_PDB |
Literal['ATOM', 'HETATM']
|
"ATOM" for polymer residues, "HETATM" for everything else. |
id |
int
|
The atom's serial number. |
type_symbol |
str
|
The element symbol. |
label_atom_id |
str
|
The atom's name within its residue (e.g. "CA"). |
label_alt_id |
str | None
|
The alternate location (altloc) identifier, if the atom has alternate conformers. |
label_comp_id |
str
|
The residue/component id (e.g. "ALA"). |
label_asym_id |
str
|
The asym unit (chain) this atom belongs to. |
label_entity_id |
str
|
The entity this atom belongs to. |
label_seq_id |
int | None
|
The residue's sequence position within its
entity; |
pdbx_PDB_ins_code |
str | None
|
The insertion code, if any. |
Cartn_x |
float
|
The atom's x coordinate, in angstroms. |
Cartn_y |
float
|
The atom's y coordinate, in angstroms. |
Cartn_z |
float
|
The atom's z coordinate, in angstroms. |
occupancy |
float
|
The atom's occupancy (fraction of the site it's present at). |
B_iso_or_equiv |
float
|
The atom's isotropic (or equivalent) B-factor. |
auth_seq_id |
str | None
|
The author-assigned residue sequence number. |
auth_comp_id |
str | None
|
The author-assigned residue/component id. |
auth_asym_id |
str | None
|
The author-assigned chain id. |
auth_atom_id |
str | None
|
The author-assigned atom name. |
pdbx_PDB_model_num |
int
|
Which model this atom belongs to, for multi-model entries. |
ConfRecord
¶
Bases: BaseModel
One row from _struct_conf (HELX_P, TURN_P, STRN, etc.).
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The secondary structure element's id. |
conf_type_id |
str
|
The secondary structure type (e.g. "HELX_P", "TURN_P", "STRN"). |
beg_label_asym_id |
str
|
The chain the element starts in. |
beg_label_seq_id |
int | None
|
The residue sequence position the element starts at. |
end_label_asym_id |
str
|
The chain the element ends in. |
end_label_seq_id |
int | None
|
The residue sequence position the element ends at. |
beg_auth_asym_id |
str | None
|
The author-assigned chain id the element starts in. |
beg_auth_seq_id |
str | None
|
The author-assigned residue number the element starts at. |
end_auth_asym_id |
str | None
|
The author-assigned chain id the element ends in. |
end_auth_seq_id |
str | None
|
The author-assigned residue number the element ends at. |
ConnPartner
¶
Bases: BaseModel
One side of a _struct_conn connection (bond/contact).
Attributes:
| Name | Type | Description |
|---|---|---|
label_asym_id |
str
|
The chain of this side of the connection. |
label_comp_id |
str
|
The residue/component id of this side of the connection. |
label_seq_id |
int | None
|
The residue sequence position of this side of the connection, if polymeric. |
label_atom_id |
str | None
|
The atom name of this side of the connection. |
auth_asym_id |
str | None
|
The author-assigned chain id of this side of the connection. |
auth_seq_id |
str | None
|
The author-assigned residue sequence number of this side of the connection. |
pdbx_PDB_ins_code |
str | None
|
The insertion code of this side of the connection, if any. |
symmetry |
str | None
|
The symmetry operation applied to this side of the connection, if any. |
ConnRecord
¶
Bases: BaseModel
One row from _struct_conn: a bond or non-bonded connection
between two atoms.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The connection's id. |
conn_type_id |
ConnType | str
|
The connection type: "disulf", "covale", "hydrog", or "metalc". |
ptnr1 |
ConnPartner
|
The first atom in the connection. |
ptnr2 |
ConnPartner
|
The second atom in the connection. |
pdbx_dist_value |
float | None
|
The measured distance between the two atoms, in angstroms. |
details |
str | None
|
Free-text details about the connection. |
EntityPolyRecord
¶
Bases: BaseModel
Polymer-specific entity fields, from _entity_poly.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
str | None
|
The polymer type (e.g. "polypeptide(L)",
"polyribonucleotide"), from |
pdbx_seq_one_letter_code |
str | None
|
The one-letter sequence as deposited, including any non-standard residue codes in parentheses. |
pdbx_seq_one_letter_code_can |
str | None
|
The canonicalized one-letter sequence (non-standard residues mapped to their closest standard equivalent). |
pdbx_strand_id |
str | None
|
The comma-separated auth chain ids this entity spans. |
EntityRecord
¶
Bases: BaseModel
One entity (molecule) in the structure, from _entity.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The entity id ( |
type |
EntityType | str
|
The entity type: "polymer", "non-polymer", "water", or "branched". |
pdbx_description |
str | None
|
A free-text description of the entity (e.g. protein name). |
formula_weight |
float | None
|
The entity's molecular formula weight, in daltons. |
src_method |
str | None
|
How the entity was produced (e.g. "man" for genetically manipulated, "nat" for natural, "syn" for synthetic). |
poly |
EntityPolyRecord | None
|
Polymer-specific fields, if this entity is a polymer. |
EntryRecord
¶
Bases: BaseModel
Entry-level identity and title, from _struct.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The entry's PDB/PDBe identifier (the mmCIF data block name). |
title |
str | None
|
The entry's title ( |
SSRecord
¶
Bases: BaseModel
A structure's secondary structure: helix/turn/strand records and sheet strand ranges.
Attributes:
| Name | Type | Description |
|---|---|---|
conf_records |
list[ConfRecord]
|
The helix/turn/strand elements from
|
sheet_strands |
list[SheetStrandRecord]
|
The individual beta-sheet strand ranges from
|
SheetStrandRecord
¶
Bases: BaseModel
One row from _struct_sheet_range: one strand of a beta sheet.
Attributes:
| Name | Type | Description |
|---|---|---|
sheet_id |
str
|
The beta sheet this strand belongs to. |
id |
str
|
The strand's id. |
beg_label_asym_id |
str
|
The chain the strand starts in. |
beg_label_seq_id |
int | None
|
The residue sequence position the strand starts at. |
end_label_asym_id |
str
|
The chain the strand ends in. |
end_label_seq_id |
int | None
|
The residue sequence position the strand ends at. |
beg_auth_asym_id |
str | None
|
The author-assigned chain id the strand starts in. |
beg_auth_seq_id |
str | None
|
The author-assigned residue number the strand starts at. |
end_auth_asym_id |
str | None
|
The author-assigned chain id the strand ends in. |
end_auth_seq_id |
str | None
|
The author-assigned residue number the strand ends at. |
Structure
¶
Bases: BaseModel
Pandora's typed mmCIF data model: one parsed structure, with
everything not promoted to a typed field kept verbatim in raw.
Attributes:
| Name | Type | Description |
|---|---|---|
entry_id |
str
|
The structure's PDB/PDBe entry identifier. |
entry |
EntryRecord
|
Entry-level identity and title. |
entities |
list[EntityRecord]
|
Every entity (molecule) in the structure. |
asym_units |
list[AsymRecord]
|
Every asym unit (chain), mapping chains to entities. |
atoms |
list[AtomSiteRecord]
|
Every atom in the structure. |
connections |
list[ConnRecord]
|
Every bond/contact connection between atoms. |
assemblies |
list[AssemblyRecord]
|
Every biological/crystallographic assembly. |
secondary_structure |
SSRecord
|
The structure's secondary structure elements. |
raw |
dict[str, list[dict[str, str | None]]]
|
Every other mmCIF category not promoted to a typed field, keyed by category name, preserved verbatim. |
pandora.schemas.metadata
¶
AnnotationLayer
¶
Bases: BaseModel
One derived annotation result (counts, contacts, identity, etc.) for an entry, pair, or other scope.
Attributes:
| Name | Type | Description |
|---|---|---|
layer_name |
str
|
A human-readable name for the layer. |
layer_type |
str
|
A machine-readable type identifying the layer (e.g. "structure_counts"). |
scope |
AnnotationScope
|
What the layer describes: an entry, a pair, an interface, etc. |
method |
str
|
The identifier of the method/algorithm used to compute the layer. |
target_ids |
list[str]
|
The entry id(s) the layer applies to. |
parameters |
dict[str, Any]
|
The parameters the layer was computed with. |
data |
dict[str, Any]
|
The layer's actual computed output. |
provenance |
dict[str, Any]
|
Additional provenance details about how the layer was computed. |
EntityMetadataRecord
¶
Bases: BaseModel
Descriptions, sequence, and chain membership for one entity.
Attributes:
| Name | Type | Description |
|---|---|---|
entity_id |
str
|
The entity's id. |
entity_type |
str | None
|
The entity type (e.g. "polymer"). |
description |
str | None
|
A free-text description of the entity. |
formula_weight |
float | None
|
The entity's molecular formula weight, in daltons. |
source_method |
str | None
|
How the entity was produced. |
ec_number |
str | None
|
The entity's Enzyme Commission number, if applicable. |
mutation |
str | None
|
A description of any mutation(s), if applicable. |
fragment |
str | None
|
A description of the fragment represented, if applicable. |
polymer_type |
str | None
|
The polymer type, if this entity is a polymer. |
sequence |
str | None
|
The entity's deposited one-letter sequence. |
canonical_sequence |
str | None
|
The entity's canonicalized one-letter sequence. |
chain_ids |
list[str]
|
The chain (asym) ids belonging to this entity. |
provenance |
MetadataProvenance
|
Where this record's data came from. |
EntryMetadataRecord
¶
Bases: BaseModel
Entry-level source-backed metadata: title, keywords, and citation details.
Attributes:
| Name | Type | Description |
|---|---|---|
entry_id |
str
|
The structure's entry id. |
title |
str | None
|
The entry's title. |
keywords |
str | None
|
The entry's keywords. |
citation_title |
str | None
|
The primary citation's title. |
doi |
str | None
|
The primary citation's DOI. |
pubmed_id |
str | None
|
The primary citation's PubMed id. |
provenance |
MetadataProvenance
|
Where this record's data came from. |
LigandMetadataRecord
¶
Bases: BaseModel
Name, formula, and chain membership for one non-polymer ligand.
Attributes:
| Name | Type | Description |
|---|---|---|
entity_id |
str | None
|
The id of the entity this ligand belongs to, if known. |
comp_id |
str
|
The ligand's component id (e.g. "ZN"). |
name |
str | None
|
The ligand's full chemical name. |
formula |
str | None
|
The ligand's chemical formula. |
formula_weight |
float | None
|
The ligand's molecular formula weight, in daltons. |
chain_ids |
list[str]
|
The chain (asym) ids this ligand appears in. |
provenance |
MetadataProvenance
|
Where this record's data came from. |
MetadataProvenance
¶
Bases: BaseModel
Record of which source (and, for mmCIF, which category/record) one metadata value came from.
Attributes:
| Name | Type | Description |
|---|---|---|
source |
MetadataSource | str
|
Which source database the value came from. |
source_category |
str | None
|
The mmCIF category the value was read from,
if |
source_record_id |
str | None
|
The id of the specific record within
|
MetadataRecord
¶
Bases: BaseModel
Every source-backed metadata collected for one structure: entry, quality, taxonomy, entities, ligands, and UniProt mappings.
Attributes:
| Name | Type | Description |
|---|---|---|
entry_id |
str
|
The structure's entry id. |
entry |
EntryMetadataRecord | None
|
Entry-level metadata (title, keywords, citation). |
quality |
QualityRecord | None
|
Experimental quality metrics. |
taxonomies |
list[TaxonomyRecord]
|
Source organism and expression host metadata. |
entities |
list[EntityMetadataRecord]
|
Per-entity metadata. |
ligands |
list[LigandMetadataRecord]
|
Per-ligand metadata. |
uniprot_mappings |
list[UniProtMappingRecord]
|
UniProt/SIFTS sequence mappings. |
raw_categories |
list[str]
|
The mmCIF categories that were consulted to build this record. |
QualityRecord
¶
Bases: BaseModel
Experimental quality metrics (resolution, R-factors, reflection counts) for one entry.
Attributes:
| Name | Type | Description |
|---|---|---|
experimental_method |
str | None
|
The experimental method(s) used (e.g. "X-RAY DIFFRACTION"). |
resolution |
float | None
|
The structure's resolution, in angstroms, from
|
r_work |
float | None
|
The working set R-factor. |
r_free |
float | None
|
The free set R-factor. |
r_sym |
float | None
|
The merging R-factor as Rsym ( |
r_merge |
float | None
|
The merging R-factor as Rmerge
( |
observed_reflections |
int | None
|
The number of observed reflections. |
percent_possible_observed |
float | None
|
The percentage of possible reflections that were observed. |
mean_b_factor |
float | None
|
The mean isotropic B-factor. |
provenance |
MetadataProvenance
|
Where this record's data came from. |
TaxonomyRecord
¶
Bases: BaseModel
Source organism and expression host metadata for one entity.
Attributes:
| Name | Type | Description |
|---|---|---|
entity_id |
str | None
|
The entity this taxonomy applies to. |
ncbi_taxon_id |
int | None
|
The source organism's NCBI taxonomy id. |
organism_scientific |
str | None
|
The source organism's scientific name. |
organism_common |
str | None
|
The source organism's common name. |
host_ncbi_taxon_id |
int | None
|
The expression host's NCBI taxonomy id, if genetically manipulated. |
host_scientific |
str | None
|
The expression host's scientific name. |
host_common |
str | None
|
The expression host's common name. |
expression_system |
str | None
|
The expression system or plasmid used. |
provenance |
MetadataProvenance
|
Where this record's data came from. |
UniProtMappingRecord
¶
Bases: BaseModel
One UniProt/SIFTS sequence mapping segment for an entity or chain.
Attributes:
| Name | Type | Description |
|---|---|---|
entity_id |
str | None
|
The entity this mapping applies to, if known. |
asym_id |
str | None
|
The chain this mapping applies to, if known. |
accession |
str
|
The UniProt accession. |
db_name |
str | None
|
The reference database name. |
db_code |
str | None
|
The reference database entry code. |
seq_id_start |
int | None
|
The mapping's start position in the structure's sequence numbering. |
seq_id_end |
int | None
|
The mapping's end position in the structure's sequence numbering. |
uniprot_start |
int | None
|
The mapping's start position in the UniProt sequence. |
uniprot_end |
int | None
|
The mapping's end position in the UniProt sequence. |
identity |
float | None
|
The sequence identity of the mapped segment, if reported (SIFTS mappings only). |
provenance |
MetadataProvenance
|
Where this record's data came from. |
pandora.schemas.annotation
¶
ContactAtomSet = Literal['all', 'heavy', 'backbone', 'ca']
module-attribute
¶
Atoms that count towards a chain-chain contact: every atom, heavy (non-H/D) atoms, backbone atoms (protein N/CA/C/O, nucleic-acid O5'/C5'/C4'/C3'/O3'), or CA atoms only.
AnnotationLayer
¶
Bases: BaseModel
One derived annotation result (counts, contacts, identity, etc.) for an entry, pair, or other scope.
Attributes:
| Name | Type | Description |
|---|---|---|
layer_name |
str
|
A human-readable name for the layer. |
layer_type |
str
|
A machine-readable type identifying the layer (e.g. "structure_counts"). |
scope |
AnnotationScope
|
What the layer describes: an entry, a pair, an interface, etc. |
method |
str
|
The identifier of the method/algorithm used to compute the layer. |
target_ids |
list[str]
|
The entry id(s) the layer applies to. |
parameters |
dict[str, Any]
|
The parameters the layer was computed with. |
data |
dict[str, Any]
|
The layer's actual computed output. |
provenance |
dict[str, Any]
|
Additional provenance details about how the layer was computed. |
pandora.schemas.ingestion
¶
FetchOptions
¶
Bases: BaseModel
Caching and decompression options for fetching one mmCIF file.
Attributes:
| Name | Type | Description |
|---|---|---|
allow_partial |
bool
|
Whether a batch fetch continues past individual failures instead of raising. |
use_cache |
bool
|
Whether an existing cached file is reused instead of refetching. |
decompress |
bool
|
Whether a gzip-compressed response is decompressed before writing. |
max_age_seconds |
int | None
|
How old a cached file may be before it's
considered stale; |
stale_behavior |
StaleBehavior
|
What to do with a stale cached file: use it anyway, warn and refetch, or raise. |
IngestionProvenance
¶
Bases: BaseModel
Record of where one structure's raw mmCIF file came from and when it was retrieved.
Attributes:
| Name | Type | Description |
|---|---|---|
provider |
str
|
Which provider the file was fetched from ("pdbe" or "pdb"). |
source_uri |
str | None
|
The exact URL the file was fetched from. |
retrieved_at |
str | None
|
When the file was retrieved, as an ISO 8601 timestamp. |
from_cache |
bool
|
Whether the file came from the local cache rather than a fresh download. |
revision_date |
str | None
|
The entry's own most recent revision date (ISO
"YYYY-MM-DD"), when the provider exposes one. Lets a caller
detect drift on a later re-fetch of the same entry_id
without Pandora computing a content checksum. |
pandora.schemas.common
¶
AppliedPolicyRef
¶
Bases: BaseModel
Compact reference to a policy that was applied at a pipeline stage.
Attributes:
| Name | Type | Description |
|---|---|---|
policy_id |
str
|
The policy's unique identifier. |
policy_name |
str
|
The policy's human-readable name. |
policy_version |
str
|
The policy's version string. |
Diagnostic
¶
Bases: BaseModel
One warning or error raised during parsing/canonicalisation, with its code, message, and context.
Attributes:
| Name | Type | Description |
|---|---|---|
code |
str
|
A short machine-readable code identifying the issue (e.g. "RESIDUE_NUMBER_COLLISION"). |
severity |
Severity
|
"warning" or "error". |
message |
str
|
A human-readable description of the issue. |
entry_id |
str | None
|
The entry this diagnostic applies to, if known. |
field |
str | None
|
The field/category this diagnostic relates to, if applicable. |
context |
dict[str, Any] | None
|
Additional structured details about the issue. |
DiagnosticBundle
¶
Bases: BaseModel
Every warning and error collected during one parsing/ canonicalisation run.
Attributes:
| Name | Type | Description |
|---|---|---|
warnings |
list[Diagnostic]
|
Every warning-level diagnostic collected. |
errors |
list[Diagnostic]
|
Every error-level diagnostic collected. |
pandora.schemas.dataset
¶
ChainCompleteness
¶
Bases: BaseModel
How much of one polymer chain's SEQRES has coordinates.
Attributes:
| Name | Type | Description |
|---|---|---|
entry_id |
str
|
The structure's entry id. |
chain_id |
str
|
The chain's |
seqres_length |
int
|
The number of positions in the chain entity's
|
missing_n_term |
int
|
Missing positions before the first present residue. |
missing_c_term |
int
|
Missing positions after the last present residue. |
missing_middle |
int
|
Missing positions between the first and last present residue. |
ChainRecord
¶
Bases: BaseModel
One polymer chain, reshaped from a canonical Structure for
dataset export.
Attributes:
| Name | Type | Description |
|---|---|---|
entry_id |
str
|
The structure's entry id. |
chain_id |
str
|
The chain's |
auth_chain_id |
str | None
|
The chain's |
entity_id |
str
|
The id of the entity this chain belongs to. |
sequence |
str | None
|
The chain's polymer sequence, if any. |
residue_count |
int
|
The number of distinct residues in the chain. |
atom_count |
int
|
The number of atoms in the chain. |
ContentRules
¶
Bases: BaseModel
Curation policy for which ligand/water/ion content is kept.
Attributes:
| Name | Type | Description |
|---|---|---|
keep_ligands |
bool
|
Whether non-polymer ligands are kept in curated structures. |
keep_waters |
bool
|
Whether water molecules are kept in curated structures. |
keep_ions |
bool
|
Whether ions are kept in curated structures. |
CurationProvenance
¶
Bases: BaseModel
Record of which curation policy ran on one structure, and when.
Attributes:
| Name | Type | Description |
|---|---|---|
curated_at |
str
|
When this curation run completed, as an ISO 8601 timestamp. |
policy_id |
str
|
The id of the policy that ran. |
policy_name |
str
|
The name of the policy that ran. |
policy_version |
str
|
The version of the policy that ran. |
dropped_raw_categories |
list[str]
|
The verbatim mmCIF categories removed
from |
DatasetCurationPolicy
¶
Bases: BaseModel
The full, named policy governing dataset curation: quality, organism, and content rules.
Attributes:
| Name | Type | Description |
|---|---|---|
policy_id |
str
|
A unique identifier for this policy. |
policy_name |
str
|
A human-readable name for this policy. |
policy_version |
str
|
The policy's version string. |
description |
str
|
A free-text description of the policy. |
quality_rules |
QualityRules
|
The resolution/method/chain-length rules. |
organism_rules |
OrganismRules
|
The organism taxon inclusion/exclusion rules. |
content_rules |
ContentRules
|
The ligand/water/ion content rules. |
DeduplicationProvenance
¶
Bases: BaseModel
Record of one deduplication run: whether it was enabled and how many duplicates it found.
Attributes:
| Name | Type | Description |
|---|---|---|
deduplicated_at |
str
|
When this deduplication run completed, as an ISO 8601 timestamp. |
enabled |
bool
|
Whether deduplication was actually applied. |
duplicates_found |
int
|
How many structures were removed as duplicates. |
DeduplicationRules
¶
Bases: BaseModel
Policy for whether duplicate entry_ids are removed.
Attributes:
| Name | Type | Description |
|---|---|---|
enabled |
bool
|
Whether structures sharing the same |
ExclusionRecord
¶
Bases: BaseModel
Record of why one structure, or one chain of it, was excluded during curation or deduplication.
Attributes:
| Name | Type | Description |
|---|---|---|
entry_id |
str
|
The excluded structure's entry id. |
chain_id |
str | None
|
The excluded chain's |
reason_code |
ExclusionReason
|
A machine-readable reason the structure was excluded. |
message |
str
|
A human-readable description of the exclusion. |
InterfaceRecord
¶
Bases: BaseModel
One polymer chain pair in contact, reshaped from a chain-interfaces annotation layer.
Attributes:
| Name | Type | Description |
|---|---|---|
entry_id |
str
|
The structure's entry id. |
chain_id_1 |
str
|
The first chain in the interface. |
chain_id_2 |
str
|
The second chain in the interface. |
distance_cutoff |
float
|
The contact distance cutoff used, in angstroms. |
atom_set |
ContactAtomSet
|
Which atoms counted towards contacts ("all", "heavy", "backbone" or "ca"). Records written before this field existed load as "all", which is what they used. |
interface_residues_chain_1 |
list[str]
|
Contacting residue ids on
|
interface_residues_chain_2 |
list[str]
|
Contacting residue ids on
|
contact_count |
int
|
The total number of contacting residues on both sides. |
residue_pairs |
list[tuple[str, str]]
|
Contacting |
OrganismRules
¶
Bases: BaseModel
Curation policy for including/excluding structures by source organism taxon.
Attributes:
| Name | Type | Description |
|---|---|---|
include_taxa |
list[str]
|
If non-empty, only these NCBI taxon ids are allowed. |
exclude_taxa |
list[str]
|
NCBI taxon ids that are always excluded. |
QualityRules
¶
Bases: BaseModel
Curation policy for resolution, R-factors, experimental method, residue content, size, and chain counts.
Attributes:
| Name | Type | Description |
|---|---|---|
max_resolution |
float | None
|
The maximum resolution (in angstroms) allowed; structures coarser than this are excluded. |
null_resolution_behavior |
Literal['exclude', 'include']
|
Whether a structure with no
resolution is excluded or included when |
min_chain_length |
int | None
|
The minimum residue count a structure's longest chain must reach, checked after chain rules remove chains. |
min_polymer_chains |
int | None
|
The minimum number of polymer chains (asym units) a structure must have, checked after chain rules remove chains. |
include_experimental_methods |
list[str]
|
If non-empty, only these experimental methods are allowed. |
exclude_experimental_methods |
list[str]
|
Experimental methods that are always excluded. |
max_resolution_by_method |
dict[str, float]
|
Resolution limits per experimental
method, overriding |
rfactor_methods |
list[str]
|
The methods the R-factor rules apply to. |
max_r_free |
float | None
|
The maximum Rfree. |
max_r_free_gap |
float | None
|
The maximum |Rfree - Rwork|. |
max_r_sym |
float | None
|
The maximum Rsym, or Rmerge when Rsym is missing. |
null_rfactor_behavior |
Literal['exclude', 'include']
|
Whether an entry missing a value an active R-factor rule needs is excluded or included. |
exclude_nonstandard_residues |
bool
|
Whether an entry with any non-standard polymer residue is excluded. |
allowed_nonstandard_residues |
list[str]
|
Non-standard residues that don't
trigger |
max_atoms |
int | None
|
The maximum number of atoms an entry may have. |
missing_residue_definition |
MissingResidueDefinition
|
What counts as a missing residue
for the missing-fraction rules (see |
max_missing_tail_fraction |
float | None
|
Chains whose missing N- plus C-terminal residues exceed this fraction of SEQRES are removed. |
max_missing_middle_fraction |
float | None
|
Chains whose missing middle residues exceed this fraction of SEQRES minus the missing tails are removed. |
max_chain_length |
int | None
|
Chains with more observed residues than this are removed. |
ResidueRecord
¶
Bases: BaseModel
One polymer residue and its atoms, reshaped from a canonical
Structure for dataset export.
Attributes:
| Name | Type | Description |
|---|---|---|
entry_id |
str
|
The structure's entry id. |
chain_id |
str
|
The residue's |
seq_id |
int | None
|
The residue's |
auth_seq_id |
str | None
|
The residue's |
comp_id |
str
|
The residue's component id (e.g. "ALA"). |
atoms |
list[AtomSiteRecord]
|
Every atom belonging to this residue. |
pandora.schemas.provenance
¶
AnnotationProvenanceRecord
¶
Bases: BaseModel
Record of one annotation layer's method and parameters, for reproducing it later.
Attributes:
| Name | Type | Description |
|---|---|---|
layer_name |
str
|
The annotation layer's human-readable name. |
layer_type |
str
|
The annotation layer's machine-readable type (e.g. "ligand_contacts"). |
method |
str
|
The identifier of the method/algorithm used to compute the layer. |
target_ids |
list[str]
|
The entry id(s) the layer applies to. |
parameters |
dict[str, Any]
|
The parameters the layer was computed with. |
provenance |
dict[str, Any]
|
Additional provenance details about how the layer was computed. |
DatasetManifest
¶
Bases: BaseModel
A single-file report of how a dataset was built: policies,
exclusions, dedup/clustering/partition provenance, splits, and every
retained structure's ProvenanceBundle.
Attributes:
| Name | Type | Description |
|---|---|---|
dataset_id |
str
|
A unique identifier for the dataset. |
dataset_name |
str
|
A human-readable name for the dataset. |
dataset_version |
str
|
The dataset's version string. |
pandora_version |
str
|
The Pandora version that produced this manifest. |
generated_at |
str
|
When this manifest was assembled, as an ISO 8601 timestamp. |
curation_policy |
DatasetCurationPolicy | None
|
The curation policy applied, if any. |
canonicalisation_policy |
canonicalisationPolicy | None
|
The canonicalisation policy applied, if any. |
excluded |
list[ExclusionRecord]
|
Every structure excluded during curation or deduplication. |
deduplication |
DeduplicationProvenance | None
|
How deduplication was applied, if any. |
clustering |
ClusteringProvenance | None
|
How similarity clustering was applied, if any. |
partition |
PartitionProvenance | None
|
How the train/val/test split was computed, if any. |
splits |
dict[str, list[str]]
|
The resulting split assignment, keyed by split name. |
structures |
list[ProvenanceBundle]
|
The |
ProvenanceBundle
¶
Bases: BaseModel
Every provenance collected for one structure: ingestion, canonicalisation, metadata sources, and annotations.
Attributes:
| Name | Type | Description |
|---|---|---|
entry_id |
str
|
The structure's entry id. |
pandora_version |
str
|
The Pandora version that produced this bundle. |
generated_at |
str
|
When this bundle was assembled, as an ISO 8601 timestamp. |
ingestion |
IngestionProvenance | None
|
How the structure's raw file was fetched, if known. |
canonicalisation |
canonicalisationProvenance | None
|
How the structure was canonicalised, if known. |
metadata_sources |
list[MetadataProvenance]
|
Which sources the structure's metadata came from. |
annotations |
list[AnnotationProvenanceRecord]
|
Every annotation layer computed for this structure. |
pandora.schemas.similarity
¶
ClusteringProvenance
¶
Bases: BaseModel
Record of one clustering run: which search and filter produced the edges, and how many edges and clusters resulted.
Attributes:
| Name | Type | Description |
|---|---|---|
clustered_at |
str
|
When this clustering run completed, as an ISO 8601 timestamp. |
hit_filter |
HitFilter | None
|
The filter that turned hits into edges, or None
for hand-built edges ( |
search |
SimilaritySearch | None
|
The search whose hit file was clustered, or None for hand-built edges. |
n_edges |
int
|
How many edges were read (duplicates included). |
n_edges_unknown_ids |
int
|
How many of those named an id outside
|
n_clusters |
int
|
How many clusters resulted. |
Edge
¶
Bases: NamedTuple
One hit row that passed a HitFilter (source_id < target_id).
A plain tuple, not a pydantic model, so streaming millions of edges stays cheap.
Attributes:
| Name | Type | Description |
|---|---|---|
source_id |
str
|
The lexicographically smaller item id. |
target_id |
str
|
The lexicographically larger item id. |
score |
float
|
The row's score, as selected by the filter. |
identity |
float
|
The row's fraction of identical aligned residues. |
coverage |
float
|
The row's coverage, as selected by |
interface_coverage |
float | None
|
Interface-restricted coverage, or None if not computed for this pair. |
HitFilter
¶
Bases: BaseModel
Policy deciding which hit rows become similarity edges.
A pair of items is an edge if any single hit row passes every
threshold. None thresholds are not applied; the others are
inclusive (>=).
Attributes:
| Name | Type | Description |
|---|---|---|
min_score |
float | None
|
Minimum score: TM-score for Foldseek (see
|
min_identity |
float | None
|
Minimum fraction of identical aligned residues. |
min_coverage |
float | None
|
Minimum alignment coverage (see |
coverage_of |
Literal['both', 'query', 'target', 'either']
|
Which coverage is tested: "both" (the smaller of query and target), "query", "target", or "either" (the larger). |
min_interface_coverage |
float | None
|
Minimum fraction of each side's
interface residues inside the alignment (Foldseek only;
needs |
tm_normalisation |
Literal['alignment', 'query', 'target', 'max']
|
Foldseek TM-score used as the score: "alignment" (alntmscore), "query" (qtmscore), "target" (ttmscore), or "max" (the larger of the two). |
PartitionProvenance
¶
Bases: BaseModel
Record of one train/val/test partition run: target fractions, mode, and resulting split sizes.
Attributes:
| Name | Type | Description |
|---|---|---|
partitioned_at |
str
|
When this partition run completed, as an ISO 8601 timestamp. |
pct_train |
float
|
The target fraction of items assigned to train. |
pct_val |
float
|
The target fraction of items assigned to val. |
pct_test |
float
|
The target fraction of items assigned to test. |
keep_similar_items |
bool
|
Whether each cluster was kept whole in one split (leakage-safe) or divided proportionally. |
split_sizes |
dict[str, int]
|
The resulting number of items per split. |
SimilarityCluster
¶
Bases: BaseModel
One connected-component cluster of similar items.
Attributes:
| Name | Type | Description |
|---|---|---|
components |
list[str]
|
Every item id in this cluster. |
n_components |
int
|
The number of items in this cluster. |
SimilarityMethod
¶
Bases: BaseModel
Which similarity engine (and version/parameters) produced a similarity network.
Attributes:
| Name | Type | Description |
|---|---|---|
engine |
str
|
The similarity engine used (e.g. "MMseqs2", "Foldseek"). |
version |
str | None
|
The engine's version string, if determined. |
parameters |
dict[str, Any] | None
|
The parameters the engine was run with. |
SimilarityRelationship
¶
Bases: BaseModel
One pairwise similarity score between two items (source_id < target_id).
Attributes:
| Name | Type | Description |
|---|---|---|
source_id |
str
|
The lexicographically smaller of the two item ids. |
target_id |
str
|
The lexicographically larger of the two item ids. |
similarity_type |
SimilarityType
|
What kind of similarity this measures. |
score |
float
|
The relationship's primary similarity score. |
coverage |
float | None
|
The alignment coverage between the two items, if reported. |
interface_coverage |
float | None
|
The alignment coverage restricted to each
item's interface residues, if computed (see
|
identity |
float | None
|
The sequence/structural identity between the two items, if reported. |
method |
SimilarityMethod
|
Which engine/parameters produced this relationship. |
provenance |
SimilarityRelationshipProvenance
|
When and for which dataset this relationship was computed. |
SimilarityRelationshipProvenance
¶
Bases: BaseModel
When (and from which source dataset) one similarity relationship was computed.
Attributes:
| Name | Type | Description |
|---|---|---|
computed_at |
str | None
|
When this relationship was computed, as an ISO 8601 timestamp. |
source_dataset_id |
str | None
|
The dataset this relationship was computed for, if known. |
SimilaritySearch
¶
Bases: BaseModel
One all-vs-all search: where its hit file is and how it was run.
The hit file is the tool's raw TSV with Pandora's fixed
--format-output columns; it stays on disk and is streamed by
iter_edges(), never loaded whole.
Attributes:
| Name | Type | Description |
|---|---|---|
engine |
SimilarityEngine
|
Which tool produced the hits. |
version |
str | None
|
The tool's version string, if determined. |
hits_path |
str
|
Absolute path to the hit TSV, so the record works from any working directory. |
columns |
list[str]
|
The TSV's columns, in order. |
parameters |
dict[str, Any]
|
The search settings (binary, sensitivity, max_seqs, extra options, ...), as passed to the search function, so the search can be re-run. |
origin |
Literal['computed', 'precomputed']
|
"computed" if Pandora ran the search, "precomputed" if
an existing file was wrapped with |
searched_at |
str | None
|
When the search ran, as an ISO 8601 timestamp. |