mkt.databases.app.properties

Kinase-level property tables backing the Streamlit app.

Provides PropertyTables, which assembles the property summary tables rendered in the Streamlit app.

Classes

PropertyTables(obj_kinase[, df_kinhub, ...])

Class to hold the property tables.

class mkt.databases.app.properties.PropertyTables(obj_kinase: KinaseInfo, df_kinhub: DataFrame | None = None, df_klifs: DataFrame | None = None, df_kincore: DataFrame | None = None)[source]

Bases: object

Class to hold the property tables.

__init__(obj_kinase: KinaseInfo, df_kinhub: DataFrame | None = None, df_klifs: DataFrame | None = None, df_kincore: DataFrame | None = None) None
static _format_property_value(value) str[source]

Render a single property value as a display string.

Parameters:

value (Any) – The raw attribute value from the KinaseInfo sub-object.

Returns:

String representation; iterables are comma-joined and None becomes “”.

Return type:

str

assign_properties()[source]

Extract the properties from the KinaseInfo object.

Returns:

The properties are extracted and stored in the class.

Return type:

None

convert_property2dataframe(str_attr: str, list_drop: list[str] | None = None, list_keep: list[str] | None = None) DataFrame[source]

Convert the properties of the KinaseInfo object to a dataframe.

Parameters:
  • str_attr (str) – The attribute of the KinaseInfo object to convert to dataframe.

  • list_drop (list[str], optional) – The list of attributes to drop from the dataframe, by default None. If provided, these attributes will be dropped from the dataframe.

  • list_keep (list[str], optional) – The list of attributes to keep in the dataframe, by default None. If provided, only these attributes will be kept in the dataframe.

Returns:

The dataframe containing the properties of the KinaseInfo object.

Return type:

pd.DataFrame

df_kincore: DataFrame | None = None

Dataframe containing the KinCore information.

df_kinhub: DataFrame | None = None

Dataframe containing the KinHub information.

df_klifs: DataFrame | None = None

Dataframe containing the KLIFS information.

format_property_columns() None[source]

Stringify the Property column of each table for st.table.

The property tables collapse a kinase’s heterogeneous attributes (str, int, list, set, …) into a single column, which pyarrow cannot serialize to an Arrow table. Coercing every value to a string yields a uniform, Arrow-compatible column.

Returns:

The Property column of each populated table is modified in place.

Return type:

None

obj_kinase: KinaseInfo

KinaseInfo object from which to extract properties.