Documentation for Protein
Bases: BaseModel
ld_id_url
property
Returns the URL of the UniProt page of the protein based on the protein ID
Returns:
Type | Description |
---|---|
str | None
|
str | None: URL of the UniProt page of the protein if the protein ID is defined, None otherwise. |
from_uniprot(uniprot_id, name=None)
classmethod
Creates a Protein instance from a UniProt ID using the UniProt API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uniprot_id
|
str
|
The UniProt accession or entry name. |
required |
Returns:
Name | Type | Description |
---|---|---|
Protein |
Protein
|
The created Protein instance. |
Raises:
Type | Description |
---|---|
ValueError
|
If the UniProt entry cannot be found or parsed. |
read_json(path)
classmethod
Creates a Protein instance from a JSON file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The path to the JSON file. |
required |
Returns:
Name | Type | Description |
---|---|---|
Protein |
Protein
|
The created Protein instance. |
save_json(path)
Saves the Protein instance to a JSON file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The path to the JSON file. |
required |
Returns:
Type | Description |
---|---|
None
|
None |