-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added citation and substrate to ProteinInfo * removed unused imports * removed parsing of citation * fixed UUID database issue * updated example * update
- Loading branch information
Showing
13 changed files
with
913 additions
and
591 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,26 @@ | ||
import sdRDM | ||
|
||
from typing import Optional | ||
from pydantic import Field | ||
from sdRDM.base.utils import forge_signature, IDGenerator | ||
|
||
|
||
@forge_signature | ||
class Author(sdRDM.DataModel): | ||
"""""" | ||
|
||
id: Optional[str] = Field( | ||
description="Unique identifier of the given object.", | ||
default_factory=IDGenerator("authorINDEX"), | ||
xml="@id", | ||
) | ||
|
||
given_name: Optional[str] = Field( | ||
default=None, | ||
description="Given name of the author", | ||
) | ||
|
||
family_name: Optional[str] = Field( | ||
default=None, | ||
description="Family name of the author", | ||
) |
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,64 @@ | ||
import sdRDM | ||
|
||
from typing import List, Optional | ||
from pydantic import Field | ||
from sdRDM.base.listplus import ListPlus | ||
from sdRDM.base.utils import forge_signature, IDGenerator | ||
from .author import Author | ||
|
||
|
||
@forge_signature | ||
class Citation(sdRDM.DataModel): | ||
"""Information on publication of the entry 📖""" | ||
|
||
id: Optional[str] = Field( | ||
description="Unique identifier of the given object.", | ||
default_factory=IDGenerator("citationINDEX"), | ||
xml="@id", | ||
) | ||
|
||
doi: Optional[str] = Field( | ||
default=None, | ||
description="DOI of the publication", | ||
) | ||
|
||
pubmed_id: Optional[str] = Field( | ||
default=None, | ||
description="PubMed ID of the publication", | ||
) | ||
|
||
medline_id: Optional[str] = Field( | ||
default=None, | ||
description="Medline ID of the publication", | ||
) | ||
|
||
year: Optional[int] = Field( | ||
default=None, | ||
description="Year of publication", | ||
) | ||
|
||
authors: List[Author] = Field( | ||
description="Authors of the publication", | ||
default_factory=ListPlus, | ||
multiple=True, | ||
) | ||
|
||
def add_to_authors( | ||
self, | ||
given_name: Optional[str] = None, | ||
family_name: Optional[str] = None, | ||
id: Optional[str] = None, | ||
) -> None: | ||
""" | ||
This method adds an object of type 'Author' to attribute authors | ||
Args: | ||
id (str): Unique identifier of the 'Author' object. Defaults to 'None'. | ||
given_name (): Given name of the author. Defaults to None | ||
family_name (): Family name of the author. Defaults to None | ||
""" | ||
params = {"given_name": given_name, "family_name": family_name} | ||
if id is not None: | ||
params["id"] = id | ||
self.authors.append(Author(**params)) | ||
return self.authors[-1] |
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,36 @@ | ||
import sdRDM | ||
|
||
from typing import Optional | ||
from pydantic import Field | ||
from sdRDM.base.utils import forge_signature, IDGenerator | ||
|
||
|
||
@forge_signature | ||
class Substrate(sdRDM.DataModel): | ||
"""Promiscuous substrate of an enzyme 🧪""" | ||
|
||
id: Optional[str] = Field( | ||
description="Unique identifier of the given object.", | ||
default_factory=IDGenerator("substrateINDEX"), | ||
xml="@id", | ||
) | ||
|
||
name: Optional[str] = Field( | ||
default=None, | ||
description="Name of the substrate", | ||
) | ||
|
||
inchi: Optional[str] = Field( | ||
default=None, | ||
description="InChI code of the substrate", | ||
) | ||
|
||
smiles: Optional[str] = Field( | ||
default=None, | ||
description="SMILES code of the substrate", | ||
) | ||
|
||
chebi_id: Optional[str] = Field( | ||
default=None, | ||
description="ChEBI ID of the substrate", | ||
) |
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.