Models¶
Every record the API returns is a pydantic model; fields the SDK does not know
are kept (model_extra). The full list is in plasticdb.models.
models ¶
Typed response models. Every model keeps fields it does not declare.
AnnotatedTaxon ¶
Bases: PlasticDBModel
One row of an annotate_list result: your columns, then PlasticDB's.
The fields are the downloaded table's own column names (row["Genus"]).
BindingAssay ¶
Bases: PlasticDBModel
A binding (adsorption) assay of a protein on a plastic, with its measurements.
Change ¶
Construct ¶
Bases: PlasticDBModel
An expressed construct: the sequence a paper actually assayed (tags, fusions, frames).
CurrentRelease ¶
DegradationLink ¶
EngineeringLineage ¶
Experiment ¶
ExperimentRecord ¶
GenomeComparison ¶
GenomeComparisonRow ¶
Bases: PlasticDBModel
One genome of a comparison: hit counts per plastic, raw and normalised.
As a table row, counts and normalised become counts.<plastic> /
normalised.<plastic> columns.
GroupedSearch ¶
HitEvidence ¶
Interaction ¶
Bases: PlasticDBModel
One actor tested on one plastic in one paper, with its outcome (result).
InteractionRecord ¶
Bases: PlasticDBModel
One interaction as a flat row (the release table's columns), without its children.
actor_type says which of the actor columns are set (a microorganism strain,
a protein or an engineered variant). Experiments and observations are listed
separately (client.evidence.experiments, .observations).
JobHit ¶
Bases: PlasticDBModel
One hit of a search job (annotate, compare genomes, HMM screen).
For compare_genomes source_label names the genome. For
hmm_screen the subject is a profile (subject_seq_id is its NAME,
profile_accession its ACC) and calibration_status says whether its
cut-off separates the polymer classes.
HMM hits are not alignments: pident, length, qcov and scov
are always None (never 0), old jobs included, so identity or coverage
filters do not apply to them. evalue and bitscore are the
full-sequence values; domain_score is the best domain's bit score,
hmm_from/hmm_to its span on the profile and env_from/env_to
its envelope on the submitted sequence (1-based, inclusive). The HMM fields
are None on DIAMOND hits and on HMM jobs run before server 2.90.0.
evidence summarises,
per plastic, the evidence on the protein (or variant) the hit landed on; as
a table row it becomes plastics_positive / _negative /
_inconclusive.
protein_plastics
property
¶
protein_plastics: dict[str, list[str]]
The hit protein's own per-plastic outcome lists (its degradation_links).
JobHitOrganism ¶
JobHitProtein ¶
JobHitVariant ¶
JobInfo ¶
Bases: PlasticDBModel
A job as the API describes it (JobRead, or JobDetail with its hits).
release / release_source / reference_sha256 / tool_versions
are the provenance to report with the results; result_metadata holds the
job type's own summary (polymer_hits, step_table, taxa, …) and
the full provenance record under provenance.
JobShare ¶
JobShareCreated ¶
Bases: JobShare
A new share link. token is shown once only: keep url now.
url is the results page anyone with the link can open; pass it (or the
token) to client.jobs.shared() to read the job without a key.
Kinetics ¶
Microorganism ¶
Bases: MicroorganismSummary
One microorganism with its evidence (GET /microorganisms/{ref}).
lineage_ranks ¶
lineage_ranks() -> dict[str, str]
lineage (rank:name; …) as {rank: name}; a repeated rank keeps its first.
MicroorganismSummary ¶
NamedRef ¶
Observation ¶
ObservationRecord ¶
Paper ¶
Bases: PaperSummary
One paper (GET /papers/{id}) with the organisms, proteins and variants it reports.
PaperFootprint ¶
PaperRef ¶
PaperSummary ¶
Pathway ¶
Bases: PlasticDBModel
A curated degradation pathway: ordered reaction steps from polymer to metabolites.
PathwayGraph ¶
Bases: PlasticDBModel
Cytoscape-style {nodes, edges}: each element's attributes are under data.
to_networkx ¶
to_networkx() -> Any
A networkx.DiGraph (needs networkx); compartments become node attributes.
PathwayStep ¶
Bases: PlasticDBModel
One step of a pathway analysis: whether your proteins cover it, and the best hit.
Plastic ¶
Bases: PlasticSummary
One plastic (GET /plastics/{id}), with one page of its organisms and proteins.
The embedded microorganisms and proteins are paged by the server
(microorganism_limit / protein_limit); the *_count fields are the totals.
PlasticDBModel ¶
Bases: BaseModel
Base for response models. Unknown fields are kept: the API only ever adds them.
to_row ¶
to_row() -> dict[str, Any]
One flat table row: nested objects become parent.child columns.
Lists of plain values stay lists; lists of objects are kept as lists of
dicts unless the model summarises them (for example a protein's
degradation_links become plastics_positive / plastics_negative).
PlasticRef ¶
PlasticSummary ¶
Preparation ¶
Properties ¶
Bases: PlasticDBModel
Enzyme properties: optimal pH and temperature, Tm, half-life, specific activity.
Protein ¶
Bases: ProteinSummary
One protein (GET /proteins/{accession}), in the summary or full view.
view says which. The summary (the default) leaves interactions,
indirect_interactions, variants, kinetics and properties
empty and gives their sizes in counts; view="full" fills the lists
(counts is then empty).
to_fasta ¶
to_fasta() -> str
This protein as one FASTA record (>accession name); empty without a sequence.
ProteinSummary ¶
Bases: PlasticDBModel
A /proteins list item (ProteinListItem): a wild type or an engineered variant.
List items carry no sequence unless the list asked for
include_sequence=True (to_fasta() does that itself).
Release ¶
ReleaseArtefacts ¶
ReleaseStatus ¶
SearchHit ¶
SequenceHit ¶
SequenceSearchResult ¶
Stats ¶
Structure ¶
StructureLink ¶
TaxonomyGroup ¶
TaxonomyTree ¶
Bases: PlasticDBModel
A build_tree result: a Newick cladogram and the organism x plastic matrix.
data maps each organism name to {plastic: "yes" | "no"} over
columns. to_pandas() gives it as a table; to_biopython() parses
the Newick with Bio.Phylo (needs plasticdb[bio]).
Variant ¶
VariantSummary ¶
Bases: PlasticDBModel
An engineered variant as listed under its parent (ProteinVariantRead).
Unlike a ProteinSummary, it carries its sequence.