Skip to content

System Bio Model

An abstract base class for Models in the data module.

SysBioModel

Bases: BaseModel, ABC

Abstract base class for Models in the data section, allowing different mathematical approaches to be implemented in subclasses.

This class enforces a standard interface for models working with SBML (Systems Biology Markup Language) files.

Source code in vpeleaderboard/data/src/sys_bio_model.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class SysBioModel(BaseModel, ABC):
    """
    Abstract base class for Models in the data section, allowing
    different mathematical approaches to be implemented in subclasses.

    This class enforces a standard interface for models working
    with SBML (Systems Biology Markup Language) files.
    """
    sbml_file_path: str = Field(..., description="Path to an SBML file")
    name: Optional[str] = Field(..., description="Name of the model")
    description: Optional[str] = Field("", description="Description of the model")

    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        if not self.sbml_file_path:
            raise ValueError("sbml_file_path must be provided.")

    @abstractmethod
    def get_model_metadata(self) -> pd.DataFrame:
        """
        Abstract method to retrieve metadata of the SBML model.

        This method must be implemented in subclasses to extract and return
        relevant details about the SBML model, such as its structure, components,
        and parameters.

        Returns:
            pd.DataFrame: A pandas DataFrame containing the metadata of the model.
        """

get_model_metadata() abstractmethod

Abstract method to retrieve metadata of the SBML model.

This method must be implemented in subclasses to extract and return relevant details about the SBML model, such as its structure, components, and parameters.

Returns:

Type Description
DataFrame

pd.DataFrame: A pandas DataFrame containing the metadata of the model.

Source code in vpeleaderboard/data/src/sys_bio_model.py
28
29
30
31
32
33
34
35
36
37
38
39
@abstractmethod
def get_model_metadata(self) -> pd.DataFrame:
    """
    Abstract method to retrieve metadata of the SBML model.

    This method must be implemented in subclasses to extract and return
    relevant details about the SBML model, such as its structure, components,
    and parameters.

    Returns:
        pd.DataFrame: A pandas DataFrame containing the metadata of the model.
    """