bigg.models

Contents

2.1.2. bigg.models#

Module to mimic the cobradb models

Attributes#

Classes#

Functions#

dummy_col_f(→ Mapped[T])

dummy_f(*args, **kwargs)

hybrid_property(f)

Module Contents#

bigg.models.OBJECT_CACHE#
bigg.models.LAZY_LOADING = True#
bigg.models.T#
class bigg.models.Mapped[source]#

Bases: Generic[T]

Makes it easier to reuse cobradb/sqlalchemy code.

class bigg.models.PropertyNotLoaded[source]#
class bigg.models.ORMDummy(*args, **kwargs)[source]#
args = ()#
kwargs#
bigg.models.ForeignKey#
bigg.models.UniqueConstraint#
bigg.models.Enum#
bigg.models.dummy_col_f(*args, obj_type: Type[T] = str, **kwargs) → Mapped[T][source]#
bigg.models.dummy_f(*args, **kwargs)[source]#
bigg.models.hybrid_property(f)[source]#
bigg.models.mapped_column#
bigg.models.relationship#
bigg.models.String#
bigg.models.DateTime#
bigg.models.HASH_STR_MAX_LEN = 5000#
bigg.models.custom_enums#
bigg.models.COMPOUND_TYPE_TO_SBO#
class bigg.models.DeclarativeMeta[source]#

Bases: type

class bigg.models.DeclarativeBase(**kwargs)[source]#
class bigg.models.Base(**kwargs)[source]#

Bases: DeclarativeBase

classmethod from_dict(d)[source]#
class bigg.models.BiGGBase[source]#
id: Mapped[int]#
bigg_id: Mapped[str]#
class bigg.models.InChI(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
formula: Mapped[str]#
c: Mapped[str | None]#
h: Mapped[str | None]#
q: Mapped[str | None]#
p: Mapped[str | None]#
b: Mapped[str | None]#
t: Mapped[str | None]#
m: Mapped[str | None]#
s: Mapped[str | None]#
key_major: Mapped[str]#
key_minor: Mapped[str]#
key_proton: Mapped[str]#
reference_compounds: Mapped[List[ReferenceCompound]]#
reference_reactive_parts: Mapped[List[ReferenceReactivePart]]#
key()[source]#
n_protons()[source]#
charge()[source]#
class bigg.models.TaxonomicRank(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
name: Mapped[str]#
taxons: Mapped[List[Taxon]]#
class bigg.models.Taxon(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
parent_id: Mapped[int | None]#
parent: Mapped[Taxon | None]#
children: Mapped[List[Taxon]]#
name: Mapped[str | None]#
rank_id: Mapped[int]#
rank: Mapped[TaxonomicRank]#
genomes: Mapped[List[Genome]]#
models: Mapped[List[Model]]#
collections: Mapped[List[ModelCollection]]#
class bigg.models.ModelCollection(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
oneliner: Mapped[str | None]#
description: Mapped[str | None]#
publication_id: Mapped[int | None]#
publication: Mapped[Publication | None]#
taxon_id: Mapped[int | None]#
taxon: Mapped[Taxon | None]#
models: Mapped[List[Model]]#
collection_namespace_components: Mapped[List[Component]]#
collection_namespace_universal_components: Mapped[List[UniversalComponent]]#
collection_namespace_universal_reactions: Mapped[List[UniversalReaction]]#
collection_namespace_reactions: Mapped[List[Reaction]]#
class bigg.models.Genome(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
accession_type: Mapped[str]#
accession_value: Mapped[str]#
organism: Mapped[str | None]#
taxon_id: Mapped[int | None]#
taxon: Mapped[Taxon | None]#
strain: Mapped[str | None]#
ncbi_assembly_id: Mapped[str | None]#
chromosomes: Mapped[List[Chromosome]]#
models: Mapped[List[Model]]#
class bigg.models.Chromosome(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
ncbi_accession: Mapped[str]#
genome_id: Mapped[int]#
genome: Mapped[Genome]#
genome_regions: Mapped[List[GenomeRegion]]#
class bigg.models.GenomeRegion(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
chromosome_id: Mapped[int | None]#
chromosome: Mapped[Chromosome | None]#
leftpos: Mapped[int | None]#
rightpos: Mapped[int | None]#
strand: Mapped[str | None]#
type: Mapped[str]#
dna_sequence: Mapped[str | None]#
protein_sequence: Mapped[str | None]#
class bigg.models.ReferenceCompound(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
name: Mapped[str]#
html_name: Mapped[str | None]#
compound_type#
charge: Mapped[str | None]#
formula: Mapped[str | None]#
inchi_id: Mapped[int | None]#
inchi: Mapped[InChI | None]#
reactive_part_matrix: Mapped[List[ReferenceReactivePartMatrix]]#
reaction_participants: Mapped[List[ReferenceReactionParticipant]]#
reference_mappings: Mapped[List[ComponentReferenceMapping]]#
annotation_mappings: Mapped[List[ReferenceCompoundAnnotationMapping]]#
get_sbo()[source]#
class bigg.models.UniversalComponent(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
default_component_id: Mapped[int | None]#
default_component: Mapped[Component | None]#
allow_flexible_variants: Mapped[bool]#
name: Mapped[str | None]#
components: Mapped[List[Component]]#
reference_mapping: Mapped[UniversalComponentReferenceMapping]#
collection_id: Mapped[int | None]#
collection: Mapped[ModelCollection | None]#
universal_compartmentalized_components: Mapped[List[UniversalCompartmentalizedComponent]]#
old_bigg_ids: Mapped[List[ComponentIDMapping]]#
reference_mappings: Mapped[List[ComponentReferenceMapping]]#
class bigg.models.Component(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
universal_component_id: Mapped[int]#
universal_component: Mapped[UniversalComponent]#
name: Mapped[str | None]#
formula: Mapped[str | None]#
charge: Mapped[int]#
variant: Mapped[int]#
collection_id: Mapped[int | None]#
collection: Mapped[ModelCollection | None]#
compartmentalized_components: Mapped[List[CompartmentalizedComponent]]#
reference_mappings: Mapped[List[ComponentReferenceMapping]]#
annotation_mappings: Mapped[List[ComponentAnnotationMapping]]#
static charge_to_string(coefficient)[source]#
class bigg.models.ComponentReferenceMapping(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
component_id: Mapped[int]#
component: Mapped[Component]#
universal_component_id: Mapped[int]#
universal_component: Mapped[UniversalComponent]#
reference_compound_id: Mapped[int]#
reference_compound: Mapped[ReferenceCompound]#
reference_n: Mapped[int | None]#
reference_formula_delta: Mapped[str | None]#
universal_component_reference_mapping: Mapped[UniversalComponentReferenceMapping | None]#
class bigg.models.UniversalComponentReferenceMapping(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
universal_component: Mapped[UniversalComponent]#
mapping_id: Mapped[int]#
mapping: Mapped[ComponentReferenceMapping]#
class bigg.models.DataSource(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
name: Mapped[str | None]#
url_prefix: Mapped[str | None]#
synonyms: Mapped[List[Synonym]]#
annotations: Mapped[List[Annotation]]#
class bigg.models.Annotation(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
type#
default_data_source_id: Mapped[int]#
default_data_source: Mapped[DataSource]#
is_obsolete: Mapped[bool]#
properties: Mapped[List[AnnotationProperty]]#
component_mappings: Mapped[List[ComponentAnnotationMapping]]#
reaction_mappings: Mapped[List[ReactionAnnotationMapping]]#
reference_compound_mappings: Mapped[List[ReferenceCompoundAnnotationMapping]]#
reference_reaction_mappings: Mapped[List[ReferenceReactionAnnotationMapping]]#
class bigg.models.AnnotationProperty(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
key: Mapped[str]#
value_str: Mapped[str | None]#
value_int: Mapped[int | None]#
value_float: Mapped[float | None]#
type#
annotation_id: Mapped[int]#
annotation: Mapped[Annotation]#
value()[source]#

Bases: Base

id: Mapped[int]#
identifier: Mapped[str]#
data_source_id: Mapped[int]#
data_source: Mapped[DataSource]#
annotation_id: Mapped[int]#
annotation: Mapped[Annotation]#
class bigg.models.ComponentAnnotationMapping(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
component_id: Mapped[int]#
component: Mapped[Component]#
annotation_id: Mapped[int]#
annotation: Mapped[Annotation]#
reference_match: Mapped[bool]#
bigg_id_match: Mapped[bool | None]#
inchi_match: Mapped[bool | None]#
class bigg.models.ReactionAnnotationMapping(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
reaction_id: Mapped[int]#
reaction: Mapped[Reaction]#
annotation_id: Mapped[int]#
annotation: Mapped[Annotation]#
bigg_id_match: Mapped[bool | None]#
pattern_match: Mapped[bool | None]#
class bigg.models.ReferenceCompoundAnnotationMapping(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
reference_compound_id: Mapped[int]#
reference_compound: Mapped[ReferenceCompound]#
annotation_id: Mapped[int]#
annotation: Mapped[Annotation]#
class bigg.models.ReferenceReactionAnnotationMapping(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
reference_reaction_id: Mapped[int]#
reference_reaction: Mapped[ReferenceReaction]#
annotation_id: Mapped[int]#
annotation: Mapped[Annotation]#
class bigg.models.Synonym(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
ome_id: Mapped[int]#
synonym: Mapped[str]#
type#
data_source_id: Mapped[int]#
data_source: Mapped[DataSource]#
class bigg.models.Publication(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
reference_type#
reference_id: Mapped[str]#
publication_models: Mapped[List[PublicationModel]]#
collections: Mapped[List[ModelCollection]]#
class bigg.models.PublicationModel(**kwargs)[source]#

Bases: Base

model_id: Mapped[int]#
model: Mapped[Model]#
publication_id: Mapped[int]#
publication: Mapped[Publication]#
class bigg.models.OldIDSynonym(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
type#
synonym_id: Mapped[int]#
ome_id: Mapped[int]#
class bigg.models.GenomeRegionMap(**kwargs)[source]#

Bases: Base

genome_region_id_1: Mapped[int]#
genome_region_1: Mapped[GenomeRegion]#
genome_region_id_2: Mapped[int]#
genome_region_2: Mapped[GenomeRegion]#
distance: Mapped[int]#
class bigg.models.DeprecatedID(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
type#
deprecated_id: Mapped[str]#
ome_id: Mapped[int]#
class bigg.models.Model(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
collection_id: Mapped[int]#
collection: Mapped[ModelCollection]#
base_filename: Mapped[str | None]#
genome_id: Mapped[int]#
genome: Mapped[Genome]#
organism: Mapped[str | None]#
taxon_id: Mapped[int | None]#
taxon: Mapped[Taxon | None]#
published_filename: Mapped[str | None]#
date_modified: Mapped[datetime.datetime]#
model_genes: Mapped[List[ModelGene]]#
model_reactions: Mapped[List[ModelReaction]]#
model_compartmentalized_components: Mapped[List[ModelCompartmentalizedComponent]]#
model_count: Mapped[ModelCount | None]#
publication_models: Mapped[List[PublicationModel]]#
escher_maps: Mapped[List[EscherMap]]#
memote_results: Mapped[List[MemoteResult]]#
class bigg.models.ModelGene(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
model_id: Mapped[int]#
model: Mapped[Model]#
gene_id: Mapped[int]#
gene: Mapped[Gene]#
reaction_matrix: Mapped[List[GeneReactionMatrix]]#
memote_results: Mapped[List[MemoteResult]]#
class bigg.models.ModelReaction(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
id_in_original_model: Mapped[str]#
reaction_id: Mapped[int]#
reaction: Mapped[Reaction]#
reversed: Mapped[bool]#
model_id: Mapped[int]#
model: Mapped[Model]#
copy_number: Mapped[int]#
objective_coefficient: Mapped[float]#
lower_bound: Mapped[float]#
upper_bound: Mapped[float]#
gene_reaction_rule: Mapped[str]#
original_gene_reaction_rule: Mapped[str | None]#
subsystem: Mapped[str | None]#
reaction_matrix: Mapped[List[GeneReactionMatrix]]#
memote_results: Mapped[List[MemoteResult]]#
escher_mappings: Mapped[List[ModelReactionEscherMapping]]#
static create_id(model_id, universal_reaction_id, copy_number)[source]#
static interpret_id(bigg_id)[source]#
class bigg.models.GeneReactionMatrix(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
model_gene_id: Mapped[int]#
model_gene: Mapped[ModelGene]#
model_reaction_id: Mapped[int]#
model_reaction: Mapped[ModelReaction]#
class bigg.models.UniversalCompartmentalizedComponent(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
universal_component_id: Mapped[int]#
universal_component: Mapped[UniversalComponent]#
compartment_id: Mapped[int]#
compartment: Mapped[Compartment]#
compartmentalized_components: Mapped[List[CompartmentalizedComponent]]#
matrix: Mapped[List[UniversalReactionMatrix]]#
class bigg.models.CompartmentalizedComponent(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
component_id: Mapped[int]#
component: Mapped[Component]#
compartment_id: Mapped[int]#
compartment: Mapped[Compartment]#
universal_compartmentalized_component_id: Mapped[int]#
universal_compartmentalized_component: Mapped[UniversalCompartmentalizedComponent]#
model_compartmentalized_components: Mapped[List[ModelCompartmentalizedComponent]]#
matrix: Mapped[List[ReactionMatrix]]#
class bigg.models.ModelCompartmentalizedComponent(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
bigg_id: Mapped[str]#
id_in_original_model: Mapped[str]#
model_id: Mapped[int]#
model: Mapped[Model]#
compartmentalized_component_id: Mapped[int]#
compartmentalized_component: Mapped[CompartmentalizedComponent]#
memote_results: Mapped[List[MemoteResult]]#
class bigg.models.Compartment(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
name: Mapped[str]#
universal_compartmentalized_components: Mapped[List[UniversalCompartmentalizedComponent]]#
compartmentalized_components: Mapped[List[CompartmentalizedComponent]]#
class bigg.models.EscherMap(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
map_name: Mapped[str]#
map_data: Mapped[str]#
model_id: Mapped[int]#
model: Mapped[Model]#
priority: Mapped[int]#
matrix: Mapped[List[EscherMapMatrix]]#
class bigg.models.EscherMapMatrix(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
ome_id: Mapped[int]#
type#
escher_map_id: Mapped[int]#
escher_map: Mapped[EscherMap]#
escher_map_element_id: Mapped[str]#
class bigg.models.ModelCount(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
model_id: Mapped[int]#
model: Mapped[Model]#
reaction_count: Mapped[int]#
gene_count: Mapped[int]#
metabolite_count: Mapped[int]#
class bigg.models.Gene(**kwargs)[source]#

Bases: GenomeRegion

id: Mapped[int]#
name: Mapped[str | None]#
locus_tag: Mapped[str | None]#
mapped_to_genbank: Mapped[bool]#
alternative_transcript_id: Mapped[int | None]#
alternative_transcript_of: Mapped[Gene | None]#
model_genes: Mapped[List[ModelGene]]#
class bigg.models.ReferenceReactivePart(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
name: Mapped[str]#
html_name: Mapped[str | None]#
formula: Mapped[str | None]#
charge: Mapped[str | None]#
inchi_id: Mapped[int | None]#
inchi: Mapped[InChI | None]#
matrix: Mapped[List[ReferenceReactivePartMatrix]]#
class bigg.models.ReferenceReactivePartMatrix(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
compound_id: Mapped[int]#
compound: Mapped[ReferenceCompound]#
reactive_part_id: Mapped[int]#
reactive_part: Mapped[ReferenceReactivePart]#
class bigg.models.ReferenceReaction(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
name: Mapped[str | None]#
equation: Mapped[str | None]#
hash: Mapped[str]#
reaction_participants: Mapped[List[ReferenceReactionParticipant]]#
universal_reactions: Mapped[List[UniversalReaction]]#
annotation_mappings: Mapped[List[ReferenceReactionAnnotationMapping]]#
static generate_hash(participants, pattern=False)[source]#
update_hash()[source]#
class bigg.models.ReferenceReactionParticipant(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
reaction_id: Mapped[int]#
reaction: Mapped[ReferenceReaction]#
compound_id: Mapped[int]#
compound: Mapped[ReferenceCompound]#
side#
coefficient: Mapped[str]#
compartment: Mapped[str]#
universal_reaction_matrix: Mapped[List[UniversalReactionMatrix]]#
class bigg.models.UniversalReaction(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
hash: Mapped[str]#
name: Mapped[str | None]#
is_exchange: Mapped[bool]#
is_transport: Mapped[bool]#
is_pseudo: Mapped[bool]#
collection_id: Mapped[int | None]#
collection: Mapped[ModelCollection | None]#
reference_id: Mapped[int | None]#
reference: Mapped[ReferenceReaction | None]#
reactions: Mapped[List[Reaction]]#
matrix: Mapped[List[UniversalReactionMatrix]]#
get_sbo(reference)[source]#
static generate_hash(components)[source]#
class bigg.models.Reaction(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
hash: Mapped[str]#
collection_id: Mapped[int | None]#
collection: Mapped[ModelCollection | None]#
copy_number: Mapped[int]#
universal_reaction_id: Mapped[int]#
universal_reaction: Mapped[UniversalReaction]#
matrix: Mapped[List[ReactionMatrix]]#
model_reactions: Mapped[List[ModelReaction]]#
annotation_mappings: Mapped[List[ReactionAnnotationMapping]]#
static create_id(universal_id, copy_number)[source]#
static coefficient_to_string(coefficient)[source]#
static generate_hash(components)[source]#
class bigg.models.UniversalReactionMatrix(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
universal_reaction_id: Mapped[int | None]#
universal_reaction: Mapped[UniversalReaction | None]#
reference_reaction_participant_id: Mapped[int | None]#
reference_reaction_participant: Mapped[ReferenceReactionParticipant | None]#
universal_compartmentalized_component_id: Mapped[int]#
universal_compartmentalized_component: Mapped[UniversalCompartmentalizedComponent]#
coefficient: Mapped[float]#
reaction_matrices: Mapped[List[ReactionMatrix]]#
class bigg.models.ReactionMatrix(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
reaction_id: Mapped[int]#
reaction: Mapped[Reaction]#
universal_reaction_matrix_id: Mapped[int]#
universal_reaction_matrix: Mapped[UniversalReactionMatrix]#
compartmentalized_component_id: Mapped[int]#
compartmentalized_component: Mapped[CompartmentalizedComponent]#
class bigg.models.ComponentIDMapping(**kwargs)[source]#

Bases: Base

old_bigg_id: Mapped[str]#
new_id: Mapped[int]#
new_universal_component: Mapped[UniversalComponent]#
class bigg.models.MemoteTest(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
name: Mapped[str]#
summary: Mapped[str | None]#
format_type: Mapped[str]#
invert: Mapped[bool | None]#
invert_result: Mapped[bool | None]#
field: Mapped[str | None]#
results: Mapped[List[MemoteResult]]#
class bigg.models.MemoteResult(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
model_id: Mapped[int]#
model: Mapped[Model]#
test_id: Mapped[int]#
test: Mapped[MemoteTest]#
model_reaction_id: Mapped[int | None]#
model_reaction: Mapped[ModelReaction | None]#
model_compartmentalized_component_id: Mapped[int | None]#
model_compartmentalized_component: Mapped[ModelCompartmentalizedComponent | None]#
model_gene_id: Mapped[int | None]#
model_gene: Mapped[ModelGene | None]#
message: Mapped[str | None]#
data: Mapped[float | None]#
duration: Mapped[float | None]#
metric: Mapped[float | None]#
result#
data_count: Mapped[int | None]#
class bigg.models.EscherModule(**kwargs)[source]#

Bases: Base, BiGGBase

id: Mapped[int]#
bigg_id: Mapped[str]#
name: Mapped[str]#
description: Mapped[str]#
model_reaction_mappings: Mapped[List[ModelReactionEscherMapping]]#
class bigg.models.ModelReactionEscherMapping(**kwargs)[source]#

Bases: Base

id: Mapped[int]#
model_reaction_id: Mapped[int]#
model_reaction: Mapped[ModelReaction]#
escher_module_id: Mapped[int]#
escher_module: Mapped[EscherModule]#