Main Class#
Bases: BaseModel
Microbial Strain - main class of the new microbial strain data standard.
Config:
strict:Trueextra:allowrevalidate_instances:alwaysstr_strip_whitespace:True
Fields:
-
version(Literal[1]) -
primaryId(str) -
organismType(OrganismType) -
morphType(Morph | None) -
typeStrain(list[TypeStrain]) -
taxon(list[TaxonWithSource]) -
identifier(list[IdentifierStrain]) -
origin(list[Origin]) -
legal(list[Legal]) -
pathogenicity(list[Pathogen]) -
bioSafety(list[BioSafety]) -
morphology(list[Morphology]) -
wallConstituents(list[CellWall]) -
staining(list[Staining]) -
sporeFormation(list[Spore]) -
growthConditions(list[GrowthCondition]) -
cultivationMedia(list[CultivationMedia]) -
sequences(list[Sequence]) -
gcContent(list[GCContent]) -
fattyAcidProfiles(list[FattyAcidProfile]) -
hemolysis(list[Hemolysis]) -
halophily(list[Halophil]) -
tolerances(list[Tolerance]) -
enzymes(list[Enzyme]) -
metabolites(list[Metabolite]) -
knownApplications(list[Application]) -
collections(list[Collection]) -
literature(list[Literature]) -
otherMedia(list[OtherMedia]) -
relatedData(list[RelatedData]) -
sources(list[Source])
growthConditions: list[GrowthCondition]
pydantic-field
#
Temperature and pH values
morphType: Morph | None = None
pydantic-field
#
Applicable and required for fungi only
morphology: list[Morphology]
pydantic-field
#
Morphology information
origin: list[Origin]
pydantic-field
#
Sample and isolation data
primaryId: str
pydantic-field
#
Primary Identifier for this dataset
check_constrains(r_mi: Self) -> bool
#
Hard constrains, add more if necessary
Source code in packages/microbial_strain_data_model/src/microbial_strain_data_model/strain.py
join(to_join: Self, re_validate: bool = False) -> Self
#
Joins this instance with another instance of the same type.
Combines data from two Strain instances by first validating constraints between instances, then merging source references and fixing related data, followed by merging related data references, and finally joining all other fields while maintaining uniqueness.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Self
|
Another Strain instance to join with this one |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Self |
Self
|
The modified instance with joined data |
Raises:
| Type | Description |
|---|---|
ValueError
|
If constraint validation fails |
Source code in packages/microbial_strain_data_model/src/microbial_strain_data_model/strain.py
split(to_split: int | Source, re_validate: bool = False) -> tuple[Self, Self]
#
Splits the Strain instance into two distinct instances based on a specific Source.
This method separates the data associated with a specific source (identified by index or object) from the rest of the data. It effectively creates two new strain records: one containing data linked to the specified source, and another containing the remaining data.
The method splits the strain instance into two by identifying a specific source, separating its associated data and links from the rest, and assigning a new UUID to the resulting instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int | Source
|
The source to split by. Can be the integer index of
the source in the |
required |
Returns:
| Type | Description |
|---|---|
tuple[Self, Self]
|
tuple[Self, Self]: A tuple containing two Strain instances. - The first element is the modified original instance (self), containing data not linked to the split source. - The second element is the new instance containing data only linked to the split source. |
Raises:
| Type | Description |
|---|---|
IndexError
|
If the provided integer index is out of bounds or if the
provided Source object is not found in the |