ProteinController¶
class ProteinController(available_subclasses: Optional[Mapping[str, List[str]]] = None, **kwargs)
Bases: MetaController
Subclass of MetaController for managing protein view-model logic.
Relays queries, event data, and filter/column metadata between the database backend and ProteinView.
Public Methods¶
- ProteinController.alter_database_status(status: bool) None¶
Inform the view whether database alteration was successful.
- Parameters:
status (bool) – Result of the database alteration operation.
- ProteinController.check_column_exists(table_name: str | None) None¶
Notify the view to check if a fit-data column exists in the given table.
- Parameters:
table_name (Optional[str]) – Name of the table containing the queried column, or None if the loader could not resolve one.
- ProteinController.get_experiment_names_for_tree(experiments: list[str], loader_name: str) None¶
Provide a list of experiment names to the view for the tree display.
- ProteinController.get_experiment_structure_ready(structure: dict[str, list[int]], loader_name: str) None¶
Pass experiment-to-channel mappings to the view in display-ready format.
- ProteinController.get_session_state() Dict[str, Any]¶
Include the view’s live subset filters in this tab’s session history entry.
- Returns:
Extra state to serialize into this tab’s session history entry.
- Return type:
Dict[str, Any]
- ProteinController.on_raw_filter_validated(valid: bool, error_msg: str) None¶
Relay the result of raw filter validation to the view.
- ProteinController.relay_baseline_duration(duration: float | None) None¶
Relay the computed baseline duration to the view.
- Parameters:
duration (Optional[float]) – Duration of the baseline in appropriate units, or None if it could not be resolved.
- ProteinController.relay_event_data_generator(generator: Generator) None¶
Relay a generator for event data overlays to the view.
- Parameters:
generator (Generator) – Generator yielding event data for overlay purposes.
- ProteinController.relay_event_plot_data_generator(generator: Generator) None¶
Relay a generator for event plotting to the view.
- Parameters:
generator (Generator) – Generator yielding event data for plotting.
- ProteinController.relay_event_query(query: str, debug: str) None¶
Relay an event-level query to the view.
- ProteinController.relay_plot_data(data: Any) None¶
Relay processed data to the view for plotting.
- Parameters:
data (Any) – Structured plot data.
- ProteinController.relay_query(query: str, debug: str, table_name: str, *args: str) None¶
Relay a query and optional debug message to the view, handling optional filter intents.
- ProteinController.relay_query_result(result: DataFrame | None) None¶
Relay a direct database query result to the view. Used by ProteinView._rebuild_event_id_cache to receive the list of filtered event_ids.
- Parameters:
result (Optional[pd.DataFrame]) – DataFrame returned by query_database_directly, or None if the query failed.
- ProteinController.relay_table_by_column(table: str | None) None¶
Relay the name of the table a column lives in to the view.
- Parameters:
table (Optional[str]) – Name of the table containing the queried column, or None if the loader could not resolve one.
- ProteinController.relay_units(units: str | None) None¶
Provide a column unit label to the view.
- Parameters:
units (Optional[str]) – Unit string for the queried column, or None if the loader could not resolve one.
- ProteinController.restore_session_state(state: Dict[str, Any]) None¶
Restore subset filters captured by
get_session_state()onto the view.- Parameters:
state (Dict[str, Any]) – This tab’s session history entry, as previously written by
get_session_state().
- ProteinController.set_channel_db_id(channel_db_id: int | None) None¶
Relay the channel database ID to the view.
- Parameters:
channel_db_id (Optional[int]) – Integer database ID of the channel.
- ProteinController.set_experiment_id(experiment_id: int | None) None¶
Relay the experiment ID to the view.
- Parameters:
experiment_id (Optional[int]) – Integer ID of the experiment.
- ProteinController.set_exported_event_count(written: int) None¶
Update the view with the number of events exported.
- Parameters:
written (int) – Number of events successfully written to file.
- ProteinController.update_column_names(column_names: list[str]) None¶
Update the view with new column names.