|
1 | | -__schema_version__ = "4.7.0" |
| 1 | +__schema_version__ = "4.8.0" |
2 | 2 | import datetime |
3 | 3 | import decimal |
4 | 4 | from typing import List, Optional |
@@ -776,6 +776,9 @@ class PDB(Base): |
776 | 776 | String(30), comment="Could be e.g. AlphaFold or RoseTTAFold" |
777 | 777 | ) |
778 | 778 |
|
| 779 | + Ligand: Mapped[List["Ligand"]] = relationship( |
| 780 | + "Ligand", secondary="Ligand_has_PDB", back_populates="PDB" |
| 781 | + ) |
779 | 782 | Protein_has_PDB: Mapped[List["ProteinHasPDB"]] = relationship( |
780 | 783 | "ProteinHasPDB", back_populates="PDB" |
781 | 784 | ) |
@@ -2252,6 +2255,7 @@ class Proposal(Base): |
2252 | 2255 | LabContact: Mapped[List["LabContact"]] = relationship( |
2253 | 2256 | "LabContact", back_populates="Proposal" |
2254 | 2257 | ) |
| 2258 | + Ligand: Mapped[List["Ligand"]] = relationship("Ligand", back_populates="Proposal") |
2255 | 2259 | ProposalHasPerson: Mapped[List["ProposalHasPerson"]] = relationship( |
2256 | 2260 | "ProposalHasPerson", back_populates="Proposal" |
2257 | 2261 | ) |
@@ -2492,6 +2496,9 @@ class BLSession(Base): |
2492 | 2496 | server_default=text("0"), |
2493 | 2497 | comment="Flag to indicate whether the processed folder in the associated visit directory has been purged", |
2494 | 2498 | ) |
| 2499 | + icatId: Mapped[Optional[int]] = mapped_column( |
| 2500 | + INTEGER(11), comment="The internal ICAT ID for this BLSession" |
| 2501 | + ) |
2495 | 2502 |
|
2496 | 2503 | Project: Mapped[List["Project"]] = relationship( |
2497 | 2504 | "Project", secondary="Project_has_Session", back_populates="BLSession" |
@@ -2918,6 +2925,51 @@ class LabContact(Base): |
2918 | 2925 | ) |
2919 | 2926 |
|
2920 | 2927 |
|
| 2928 | +class Ligand(Base): |
| 2929 | + __tablename__ = "Ligand" |
| 2930 | + __table_args__ = ( |
| 2931 | + ForeignKeyConstraint( |
| 2932 | + ["proposalId"], |
| 2933 | + ["Proposal.proposalId"], |
| 2934 | + ondelete="CASCADE", |
| 2935 | + onupdate="CASCADE", |
| 2936 | + name="Ligand_fk_proposalId", |
| 2937 | + ), |
| 2938 | + Index("Ligand_fk_proposalId", "proposalId"), |
| 2939 | + {"comment": "Ligands in biochemistry are substances that bind to biomolecules"}, |
| 2940 | + ) |
| 2941 | + |
| 2942 | + ligandId: Mapped[int] = mapped_column(INTEGER(11), primary_key=True) |
| 2943 | + proposalId: Mapped[int] = mapped_column( |
| 2944 | + INTEGER(10), comment="References Proposal table" |
| 2945 | + ) |
| 2946 | + name: Mapped[str] = mapped_column(String(30), comment="Ligand name") |
| 2947 | + SMILES: Mapped[Optional[str]] = mapped_column( |
| 2948 | + String(400), comment="Chemical structure" |
| 2949 | + ) |
| 2950 | + libraryName: Mapped[Optional[str]] = mapped_column( |
| 2951 | + String(30), comment="Name of ligand library, to preserve provenance" |
| 2952 | + ) |
| 2953 | + libraryBatchNumber: Mapped[Optional[str]] = mapped_column( |
| 2954 | + String(30), comment="Batch number of library, to preserve provenance" |
| 2955 | + ) |
| 2956 | + plateBarcode: Mapped[Optional[str]] = mapped_column( |
| 2957 | + String(30), |
| 2958 | + comment="Specific barcode of the plate it came from, to preserve provenance", |
| 2959 | + ) |
| 2960 | + sourceWell: Mapped[Optional[str]] = mapped_column( |
| 2961 | + String(30), comment="Location within that plate, to preserve provenance" |
| 2962 | + ) |
| 2963 | + |
| 2964 | + Proposal: Mapped["Proposal"] = relationship("Proposal", back_populates="Ligand") |
| 2965 | + PDB: Mapped[List["PDB"]] = relationship( |
| 2966 | + "PDB", secondary="Ligand_has_PDB", back_populates="Ligand" |
| 2967 | + ) |
| 2968 | + BLSample: Mapped[List["BLSample"]] = relationship( |
| 2969 | + "BLSample", secondary="BLSample_has_Ligand", back_populates="Ligand" |
| 2970 | + ) |
| 2971 | + |
| 2972 | + |
2921 | 2973 | class PhasingStatistics(Base): |
2922 | 2974 | __tablename__ = "PhasingStatistics" |
2923 | 2975 | __table_args__ = ( |
@@ -3549,6 +3601,9 @@ class DewarRegistry(Base): |
3549 | 3601 | bltimestamp: Mapped[datetime.datetime] = mapped_column( |
3550 | 3602 | DateTime, server_default=text("current_timestamp()") |
3551 | 3603 | ) |
| 3604 | + type: Mapped[str] = mapped_column( |
| 3605 | + Enum("Dewar", "Toolbox", "Thermal Shipper"), server_default=text("'Dewar'") |
| 3606 | + ) |
3552 | 3607 | proposalId: Mapped[Optional[int]] = mapped_column(INTEGER(11)) |
3553 | 3608 | labContactId: Mapped[Optional[int]] = mapped_column(INTEGER(11)) |
3554 | 3609 | purchaseDate: Mapped[Optional[datetime.datetime]] = mapped_column(DateTime) |
@@ -3597,6 +3652,30 @@ class ExperimentKindDetails(Base): |
3597 | 3652 | ) |
3598 | 3653 |
|
3599 | 3654 |
|
| 3655 | +t_Ligand_has_PDB = Table( |
| 3656 | + "Ligand_has_PDB", |
| 3657 | + Base.metadata, |
| 3658 | + Column("ligandId", INTEGER(11), primary_key=True, nullable=False), |
| 3659 | + Column("pdbId", INTEGER(11), primary_key=True, nullable=False), |
| 3660 | + ForeignKeyConstraint( |
| 3661 | + ["ligandId"], |
| 3662 | + ["Ligand.ligandId"], |
| 3663 | + ondelete="CASCADE", |
| 3664 | + onupdate="CASCADE", |
| 3665 | + name="Ligand_Has_PDB_fk1", |
| 3666 | + ), |
| 3667 | + ForeignKeyConstraint( |
| 3668 | + ["pdbId"], |
| 3669 | + ["PDB.pdbId"], |
| 3670 | + ondelete="CASCADE", |
| 3671 | + onupdate="CASCADE", |
| 3672 | + name="Ligand_Has_PDB_fk2", |
| 3673 | + ), |
| 3674 | + Index("Ligand_Has_PDB_fk2", "pdbId"), |
| 3675 | + comment="Junction table for Ligand and PDB", |
| 3676 | +) |
| 3677 | + |
| 3678 | + |
3600 | 3679 | t_Project_has_Protein = Table( |
3601 | 3680 | "Project_has_Protein", |
3602 | 3681 | Base.metadata, |
@@ -4671,6 +4750,9 @@ class BLSample(Base): |
4671 | 4750 | ScreenComponentGroup: Mapped["ScreenComponentGroup"] = relationship( |
4672 | 4751 | "ScreenComponentGroup", back_populates="BLSample" |
4673 | 4752 | ) |
| 4753 | + Ligand: Mapped[List["Ligand"]] = relationship( |
| 4754 | + "Ligand", secondary="BLSample_has_Ligand", back_populates="BLSample" |
| 4755 | + ) |
4674 | 4756 | Project: Mapped[List["Project"]] = relationship( |
4675 | 4757 | "Project", secondary="Project_has_BLSample", back_populates="BLSample" |
4676 | 4758 | ) |
@@ -4992,7 +5074,7 @@ class BLSamplePosition(Base): |
4992 | 5074 | posY: Mapped[Optional[decimal.Decimal]] = mapped_column(Double(asdecimal=True)) |
4993 | 5075 | posZ: Mapped[Optional[decimal.Decimal]] = mapped_column(Double(asdecimal=True)) |
4994 | 5076 | recordTimeStamp: Mapped[Optional[datetime.datetime]] = mapped_column( |
4995 | | - DateTime, comment="Creation or last update date/time" |
| 5077 | + DateTime, server_default=text("current_timestamp()") |
4996 | 5078 | ) |
4997 | 5079 | positionType: Mapped[Optional[str]] = mapped_column( |
4998 | 5080 | Enum("dispensing"), |
@@ -5032,6 +5114,30 @@ class BLSampleHasDataCollectionPlan(Base): |
5032 | 5114 | ) |
5033 | 5115 |
|
5034 | 5116 |
|
| 5117 | +t_BLSample_has_Ligand = Table( |
| 5118 | + "BLSample_has_Ligand", |
| 5119 | + Base.metadata, |
| 5120 | + Column("blSampleId", INTEGER(10), primary_key=True, nullable=False), |
| 5121 | + Column("ligandId", INTEGER(11), primary_key=True, nullable=False), |
| 5122 | + ForeignKeyConstraint( |
| 5123 | + ["blSampleId"], |
| 5124 | + ["BLSample.blSampleId"], |
| 5125 | + ondelete="CASCADE", |
| 5126 | + onupdate="CASCADE", |
| 5127 | + name="BLSample_has_Ligand_fk1", |
| 5128 | + ), |
| 5129 | + ForeignKeyConstraint( |
| 5130 | + ["ligandId"], |
| 5131 | + ["Ligand.ligandId"], |
| 5132 | + ondelete="CASCADE", |
| 5133 | + onupdate="CASCADE", |
| 5134 | + name="BLSample_has_Ligand_fk2", |
| 5135 | + ), |
| 5136 | + Index("BLSample_has_Ligand_fk2", "ligandId"), |
| 5137 | + comment="Junction table for BLSample and Ligand", |
| 5138 | +) |
| 5139 | + |
| 5140 | + |
5035 | 5141 | class BLSampleHasPositioner(Base): |
5036 | 5142 | __tablename__ = "BLSample_has_Positioner" |
5037 | 5143 | __table_args__ = ( |
@@ -7584,6 +7690,12 @@ class Tomogram(Base): |
7584 | 7690 | gridSquareId: Mapped[Optional[int]] = mapped_column( |
7585 | 7691 | INTEGER(11), comment="FK, references medium mag map in GridSquare" |
7586 | 7692 | ) |
| 7693 | + pixelLocationX: Mapped[Optional[int]] = mapped_column( |
| 7694 | + INTEGER(11), comment="pixel location of tomogram centre on search map image (x)" |
| 7695 | + ) |
| 7696 | + pixelLocationY: Mapped[Optional[int]] = mapped_column( |
| 7697 | + INTEGER(11), comment="pixel location of tomogram centre on search map image (y)" |
| 7698 | + ) |
7587 | 7699 |
|
7588 | 7700 | AutoProcProgram: Mapped["AutoProcProgram"] = relationship( |
7589 | 7701 | "AutoProcProgram", back_populates="Tomogram" |
|
0 commit comments