forked from lars-kolbowski/xiSPEC_ms_parser
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from Rappsilber-Laboratory/fk-constraints
assign int IDs to SpectraData and SpectrumIdentificationProtocol
- Loading branch information
Showing
11 changed files
with
150 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from sqlalchemy.orm import Mapped, mapped_column | ||
from sqlalchemy import ForeignKey, Text, Integer, UniqueConstraint | ||
from models.base import Base | ||
|
||
|
||
class SpectraData(Base): | ||
__tablename__ = "spectradata" | ||
id: Mapped[int] = mapped_column(Integer, primary_key=True, nullable=False) | ||
upload_id: Mapped[int] = mapped_column(Integer, ForeignKey("upload.id"), primary_key=True, | ||
index=True, nullable=False) | ||
spectra_data_ref: Mapped[str] = mapped_column(Text, nullable=False) | ||
location: Mapped[str] = mapped_column(Text, nullable=False) | ||
name: Mapped[str] = mapped_column(Text, nullable=True) | ||
external_format_documentation: Mapped[str] = mapped_column(Text, nullable=True) | ||
file_format: Mapped[str] = mapped_column(Text, nullable=False) | ||
spectrum_id_format: Mapped[str] = mapped_column(Text, nullable=False) | ||
|
||
__table_args__ = ( | ||
UniqueConstraint("spectra_data_ref", "upload_id"), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
from sqlalchemy.orm import Mapped, mapped_column | ||
from sqlalchemy import ForeignKey, Text, JSON, Integer, Float | ||
from sqlalchemy import ForeignKey, Text, JSON, Integer, Float, UniqueConstraint | ||
from models.base import Base | ||
from typing import Optional, Any | ||
|
||
|
||
class SpectrumIdentificationProtocol(Base): | ||
__tablename__ = "spectrumidentificationprotocol" | ||
id: Mapped[str] = mapped_column(Text, primary_key=True, nullable=False) | ||
id: Mapped[int] = mapped_column(Integer, primary_key=True, nullable=False) | ||
upload_id: Mapped[str] = mapped_column(Integer, ForeignKey("upload.id"), index=True, | ||
primary_key=True, nullable=False) | ||
sip_ref: Mapped[str] = mapped_column(Text, primary_key=False, nullable=False) | ||
analysis_software: Mapped[Optional[dict[str, Any]]] = mapped_column(JSON, nullable=True) | ||
search_type: Mapped[Optional[dict[str, Any]]] = mapped_column(JSON, nullable=True) | ||
additional_search_params: Mapped[Optional[dict[str, Any]]] = mapped_column(JSON, nullable=True) | ||
threshold: Mapped[Optional[dict[str, Any]]] = mapped_column(JSON, nullable=True) | ||
frag_tol: Mapped[float] = mapped_column(Float, nullable=False) | ||
frag_tol_unit: Mapped[str] = mapped_column(Text, nullable=False) | ||
|
||
__table_args__ = ( | ||
UniqueConstraint("sip_ref", "upload_id"), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.