biggr.models

Contents

2.1.2. biggr.models#

Module to mimic the cobradb models

Attributes#

Classes#

Functions#

dummy_col_f(→ Mapped[T])

dummy_f(*args, **kwargs)

hybrid_property(f)

Module Contents#

biggr.models.OBJECT_CACHE#
biggr.models.LAZY_LOADING = True#
biggr.models.T#
class biggr.models.Mapped#

Bases: Generic[T]

Makes it easier to reuse cobradb/sqlalchemy code.

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

Bases: type

class biggr.models.DeclarativeBase(**kwargs)#
class biggr.models.Base(**kwargs)#

Bases: DeclarativeBase

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

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()#
n_protons()#
charge()#
class biggr.models.TaxonomicRank(**kwargs)#

Bases: Base

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

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 biggr.models.ModelCollection(**kwargs)#

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 biggr.models.Genome(**kwargs)#

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 biggr.models.Chromosome(**kwargs)#

Bases: Base

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

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 biggr.models.ReferenceCompound(**kwargs)#

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()#
class biggr.models.UniversalComponent(**kwargs)#

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 biggr.models.Component(**kwargs)#

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)#
class biggr.models.ComponentReferenceMapping(**kwargs)#

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 biggr.models.UniversalComponentReferenceMapping(**kwargs)#

Bases: Base

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

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 biggr.models.Annotation(**kwargs)#

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 biggr.models.AnnotationProperty(**kwargs)#

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()#

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 biggr.models.ComponentAnnotationMapping(**kwargs)#

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 biggr.models.ReactionAnnotationMapping(**kwargs)#

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 biggr.models.ReferenceCompoundAnnotationMapping(**kwargs)#

Bases: Base

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

Bases: Base

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

Bases: Base

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

Bases: Base

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

Bases: Base

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

Bases: Base

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

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 biggr.models.DeprecatedID(**kwargs)#

Bases: Base

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

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 biggr.models.ModelGene(**kwargs)#

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 biggr.models.ModelReaction(**kwargs)#

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)#
static interpret_id(bigg_id)#
class biggr.models.GeneReactionMatrix(**kwargs)#

Bases: Base

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

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 biggr.models.CompartmentalizedComponent(**kwargs)#

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 biggr.models.ModelCompartmentalizedComponent(**kwargs)#

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 biggr.models.Compartment(**kwargs)#

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 biggr.models.EscherMap(**kwargs)#

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 biggr.models.EscherMapMatrix(**kwargs)#

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 biggr.models.ModelCount(**kwargs)#

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 biggr.models.Gene(**kwargs)#

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 biggr.models.ReferenceReactivePart(**kwargs)#

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 biggr.models.ReferenceReactivePartMatrix(**kwargs)#

Bases: Base

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

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)#
update_hash()#
class biggr.models.ReferenceReactionParticipant(**kwargs)#

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 biggr.models.UniversalReaction(**kwargs)#

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)#
static generate_hash(components)#
class biggr.models.Reaction(**kwargs)#

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)#
static coefficient_to_string(coefficient)#
static generate_hash(components)#
class biggr.models.UniversalReactionMatrix(**kwargs)#

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 biggr.models.ReactionMatrix(**kwargs)#

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 biggr.models.ComponentIDMapping(**kwargs)#

Bases: Base

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

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 biggr.models.MemoteResult(**kwargs)#

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 biggr.models.EscherModule(**kwargs)#

Bases: Base, BiGGBase

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

Bases: Base

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