class MediumCompound(TimestampMixin, db.Model): id = db.Column(db.Integer, primary_key=True) medium_id = db.Column( db.Integer, db.ForeignKey("medium.id", onupdate="CASCADE", ondelete="CASCADE"), nullable=False, ) medium = db.relationship( Medium, backref=db.backref("compounds", cascade="all, delete-orphan", lazy="dynamic"), ) compound_name = db.Column(db.Text()) compound_identifier = db.Column(db.Text()) compound_namespace = db.Column(db.Text()) mass_concentration = db.Column(db.Float()) # unit: mmol/l
class UptakeSecretionRates(TimestampMixin, db.Model): id = db.Column(db.Integer, primary_key=True) sample_id = db.Column( db.Integer, db.ForeignKey("sample.id", onupdate="CASCADE", ondelete="CASCADE"), nullable=False, ) sample = db.relationship( Sample, backref=db.backref("uptake_secretion_rates", cascade="all, delete-orphan", lazy="dynamic"), ) compound_name = db.Column(db.Text(), nullable=False) compound_identifier = db.Column(db.Text(), nullable=False) compound_namespace = db.Column(db.Text(), nullable=False) measurement = db.Column(db.Float, nullable=False) # unit: mmol/gDW/h uncertainty = db.Column(db.Float, nullable=True) # unit: mmol/gDW/h
class MolarYields(TimestampMixin, db.Model): id = db.Column(db.Integer, primary_key=True) sample_id = db.Column( db.Integer, db.ForeignKey("sample.id", onupdate="CASCADE", ondelete="CASCADE"), nullable=False, ) sample = db.relationship( Sample, backref=db.backref("molar_yields", cascade="all, delete-orphan", lazy="dynamic"), ) product_name = db.Column(db.Text(), nullable=False) product_identifier = db.Column(db.Text(), nullable=False) product_namespace = db.Column(db.Text(), nullable=False) substrate_name = db.Column(db.Text(), nullable=False) substrate_identifier = db.Column(db.Text(), nullable=False) substrate_namespace = db.Column(db.Text(), nullable=False) # Both in mmol-product / mmol-substrate measurement = db.Column(db.Float, nullable=False) uncertainty = db.Column(db.Float, nullable=True)
class Proteomics(TimestampMixin, db.Model): id = db.Column(db.Integer, primary_key=True) sample_id = db.Column( db.Integer, db.ForeignKey("sample.id", onupdate="CASCADE", ondelete="CASCADE"), nullable=False, ) sample = db.relationship( Sample, backref=db.backref("proteomics", cascade="all, delete-orphan", lazy="dynamic"), ) identifier = db.Column(db.Text(), nullable=False) name = db.Column(db.Text(), nullable=False) full_name = db.Column(db.Text(), nullable=False) gene = db.Column(postgresql.JSON, nullable=False) measurement = db.Column(db.Float, nullable=False) # unit: mmol/gDW uncertainty = db.Column(db.Float, nullable=True) # unit: mmol/gDW
class Strain(TimestampMixin, db.Model): id = db.Column(db.Integer, primary_key=True) project_id = db.Column(db.Integer) organism_id = db.Column( db.Integer, db.ForeignKey("organism.id", onupdate="CASCADE", ondelete="CASCADE"), nullable=False, ) organism = db.relationship(Organism) parent_id = db.Column( db.Integer, db.ForeignKey("strain.id", onupdate="CASCADE", ondelete="CASCADE")) parent = db.relationship("Strain", uselist=False) name = db.Column(db.String(256), nullable=False) genotype = db.Column(db.Text())
class Sample(TimestampMixin, db.Model): id = db.Column(db.Integer, primary_key=True) condition_id = db.Column( db.Integer, db.ForeignKey("condition.id", onupdate="CASCADE", ondelete="CASCADE"), nullable=False, ) condition = db.relationship( Condition, backref=db.backref("samples", cascade="all, delete-orphan", lazy="dynamic"), ) name = db.Column(db.Text(), nullable=False) # Datetime fields for when the sample was taken. `end_time` is optional, used for # interval measurements like uptake rates or fluxomics. start_time = db.Column(db.DateTime, nullable=False) end_time = db.Column(db.DateTime, nullable=True)
class Experiment(TimestampMixin, db.Model): id = db.Column(db.Integer, primary_key=True) project_id = db.Column(db.Integer) name = db.Column(db.String(256), nullable=False) description = db.Column(db.Text(), nullable=False)