Skip to content

Molecular Complex

gentropy.dataset.molecular_complex.MolecularComplex dataclass

Bases: Dataset

Curated and predicted macromolecular complex annotations.

Each row represents one complex entry sourced from the Complex Portal and contains the following information:

  • id (str) – Complex Portal accession (e.g. CPX-1)
  • description (str) – Free-text description of the complex.
  • properties (str) – Additional complex property annotations.
  • assembly (str) – Known or predicted assembly state.
  • components (array<struct<id, stoichiometry, source>>) – List of component UniProt protein IDs with stoichiometry and source database.
  • evidenceCodes (array<str>) – ECO evidence codes supporting the complex annotation.
  • crossReferences (array<struct<source, id>>) – External database cross-references (e.g. PDB, GO).
  • source (struct<id, source>) – PSI-MI ontology term describing the data source.

The schema is defined in assets/schemas/molecular_complex.json.

Source code in src/gentropy/dataset/molecular_complex.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@dataclass
class MolecularComplex(Dataset):
    """Curated and predicted macromolecular complex annotations.

    Each row represents one complex entry sourced from the Complex Portal and
    contains the following information:

    - **id** (`str`) – Complex Portal accession (e.g. ``CPX-1``)
    - **description** (`str`) – Free-text description of the complex.
    - **properties** (`str`) – Additional complex property annotations.
    - **assembly** (`str`) – Known or predicted assembly state.
    - **components** (`array<struct<id, stoichiometry, source>>`) – List of
      component UniProt protein IDs with stoichiometry and source database.
    - **evidenceCodes** (`array<str>`) – ECO evidence codes supporting the
      complex annotation.
    - **crossReferences** (`array<struct<source, id>>`) – External database
      cross-references (e.g. PDB, GO).
    - **source** (`struct<id, source>`) – PSI-MI ontology term describing the
      data source.

    The schema is defined in ``assets/schemas/molecular_complex.json``.
    """

    @classmethod
    def get_schema(cls: type[MolecularComplex]) -> t.StructType:
        """Return the enforced Spark schema for `MolecularComplex`.

        The schema is loaded from the bundled JSON schema file
        ``assets/schemas/molecular_complex.json``.

        Returns:
            t.StructType: Schema for the `MolecularComplex` dataset.
        """
        return parse_spark_schema("molecular_complex.json")

get_schema() -> t.StructType classmethod

Return the enforced Spark schema for MolecularComplex.

The schema is loaded from the bundled JSON schema file assets/schemas/molecular_complex.json.

Returns:

Type Description
StructType

t.StructType: Schema for the MolecularComplex dataset.

Source code in src/gentropy/dataset/molecular_complex.py
48
49
50
51
52
53
54
55
56
57
58
@classmethod
def get_schema(cls: type[MolecularComplex]) -> t.StructType:
    """Return the enforced Spark schema for `MolecularComplex`.

    The schema is loaded from the bundled JSON schema file
    ``assets/schemas/molecular_complex.json``.

    Returns:
        t.StructType: Schema for the `MolecularComplex` dataset.
    """
    return parse_spark_schema("molecular_complex.json")