cdm_data_loaders.parsers.uniprot.uniprot_kb ¶
UniProt XML Parser Core.
Contains the core logic for parsing XSD-converted UniProt XML entry dictionaries into CDM tables.
parse_identifiers ¶
Parse the UniProt accessions from an XSD-converted entry dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
Mapping[str, Any]
|
XSD-converted entry dictionary |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
list of identifiers in "db" / "xref" format |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_names ¶
Parse the names from an XSD-converted entry dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
Mapping[str, Any]
|
XSD-converted entry dictionary |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
list of names with a description of the name type |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_cross_references ¶
Parse the dbReferences from an XSD-converted entry dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
Mapping[str, Any]
|
XSD-converted entry dictionary |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
list of cross references in "db" / "xref" / "description" / "relationship" format |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_ensembl_dbxref ¶
parse_ensembl_dbxref(
xref: str,
prop_list: list[dict[str, str]],
description_suffix: str,
) -> list[dict[str, str]]
Parse an Ensembl dbxref.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xref
|
str
|
primary Ensembl cross-reference |
required |
prop_list
|
list[dict[str, str]]
|
property dicts attached to the dbReference |
required |
description_suffix
|
str
|
optional molecule suffix |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, str]]
|
list of parsed Ensembl cross-reference dicts |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_refseq_dbxref ¶
parse_refseq_dbxref(
xref: str,
prop_list: list[dict[str, str]],
description_suffix: str,
) -> list[dict[str, str]]
Parse a RefSeq dbxref.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xref
|
str
|
primary RefSeq cross-reference |
required |
prop_list
|
list[dict[str, str]]
|
property dicts attached to the dbReference |
required |
description_suffix
|
str
|
optional molecule suffix |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, str]]
|
list of parsed RefSeq cross-reference dicts |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_embl_dbxref ¶
parse_embl_dbxref(
xref: str,
prop_list: list[dict[str, str]],
description_suffix: str,
) -> list[dict[str, str]]
Parse an EMBL / GenBank dbxref.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xref
|
str
|
primary EMBL cross-reference |
required |
prop_list
|
list[dict[str, str]]
|
property dicts attached to the dbReference |
required |
description_suffix
|
str
|
optional molecule suffix |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, str]]
|
list of parsed EMBL/GenBank cross-reference dicts |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_mane_dbxref ¶
parse_mane_dbxref(
xref: str,
prop_list: list[dict[str, str]],
description_suffix: str,
) -> list[dict[str, str]]
Parse a MANE-Select dbxref.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xref
|
str
|
primary MANE-Select cross-reference |
required |
prop_list
|
list[dict[str, str]]
|
property dicts attached to the dbReference |
required |
description_suffix
|
str
|
optional molecule suffix |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, str]]
|
list of parsed MANE-Select cross-reference dicts |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_protein_info ¶
Extract information for the protein table from an XSD-converted entry dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
Mapping[str, Any]
|
XSD-converted entry dictionary |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dictionary of protein properties |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_organism ¶
Parse the organism taxon designation from an XSD-converted entry dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
Mapping[str, Any]
|
XSD-converted entry dictionary |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, str]]
|
list of organism taxon cross-reference dicts |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_references ¶
Parse the publications for an entry and extract any that have prioritized database identifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
Mapping[str, Any]
|
the XSD-converted UniProt entry being parsed |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, str]]
|
list of publications associated with the entry |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
parse_uniprot_entry ¶
parse_uniprot_entry(
entry: Mapping[str, Any], timestamp: datetime
) -> dict[str, list[dict[str, Any]]]
Parse an XSD-converted UniProt entry dictionary into CDM schema tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
Mapping[str, Any]
|
an XSD-converted entry dictionary from a UniProt XML file |
required |
timestamp
|
datetime
|
current UTC timestamp |
required |
Returns:
| Type | Description |
|---|---|
dict[str, list[dict[str, Any]]]
|
dictionary of parsed data, indexed by table name |
Source code in src/cdm_data_loaders/parsers/uniprot/uniprot_kb.py
make_uniprot_cdm_transform ¶
Create a RecordTransformFn that transforms XSD-parsed UniProt entry dicts into CDM tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timestamp
|
datetime | None
|
UTC timestamp assigned to |
None
|
Returns:
| Type | Description |
|---|---|
RecordTransformFn
|
|