ovo.core.logic.proteinqc_logic¶
Module Contents¶
Functions¶
Get available schedulers based on the tools selected by the user. |
|
Get available tools based on the selected scheduler. |
|
Get the thresholds, reverse_colors and color_by settings for the descriptor plot. |
|
Create a matplotlib colormap and normalization object corresponding to the Altair redyellowgreen scheme with 4 points in the domain as specified by the thresholds. |
|
Create a color function for pLDDT values based on standard thresholds. |
|
Create a color function for PAE values. |
|
Create a color function for RMSD values. |
|
Return a color mapping function for the given descriptor. |
|
API¶
- ovo.core.logic.proteinqc_logic.tool_supports_scheduler(tool: ovo.core.database.models_proteinqc.ProteinQCTool, scheduler: ovo.core.scheduler.base_scheduler.Scheduler) bool¶
- ovo.core.logic.proteinqc_logic.get_available_schedulers(tools: List[ovo.core.database.models_proteinqc.ProteinQCTool]) dict[str, ovo.core.scheduler.base_scheduler.Scheduler]¶
Get available schedulers based on the tools selected by the user.
- ovo.core.logic.proteinqc_logic.get_available_tools(tools: List[ovo.core.database.models_proteinqc.ProteinQCTool], scheduler: ovo.core.scheduler.base_scheduler.Scheduler) List[ovo.core.database.models_proteinqc.ProteinQCTool]¶
Get available tools based on the selected scheduler.
- ovo.core.logic.proteinqc_logic.get_descriptor_plot_setting(descriptor: ovo.core.database.Descriptor) Tuple[List[float], bool, str]¶
Get the thresholds, reverse_colors and color_by settings for the descriptor plot.
The logic for thresholds is as follows:
For descriptors with ‘lower_is_better’, thresholds are [min_value, warning_value, error_value, max_value].
For descriptors with ‘higher_is_better’, thresholds are [min_value, error_value, warning_value, max_value].
If any of these values are not set (i.e., None), thresholds will be None.
Returns: Tuple[List[float], bool, str]: thresholds, reverse_colors, color_by
- ovo.core.logic.proteinqc_logic.get_descriptor_colormap(thresholds: List[float], reverse_colors: bool = False, colors=None)¶
Create a matplotlib colormap and normalization object corresponding to the Altair redyellowgreen scheme with 4 points in the domain as specified by the thresholds.
Args: thresholds (List[float]): List of threshold values to define color transitions. reverse_colors (bool): If True, reverse the color order.
Returns: Callable[[float], str]: A function that takes a value and returns a hex color string of a color in the colormap.
- ovo.core.logic.proteinqc_logic.get_plddt_color(thresholds: List[float] = [90, 70, 50], lighter: bool = False)¶
Create a color function for pLDDT values based on standard thresholds.
> 90, very high confidence, ‘#0053d6’
> 70, high confidence, ‘#65cbf3’
> 50, low confidence, ‘#ffdb13’
< 50, ‘Very low confidence’, ‘#ff7d45’
- ovo.core.logic.proteinqc_logic.get_pae_colormap()¶
Create a color function for PAE values.
- ovo.core.logic.proteinqc_logic.get_rmsd_colormap()¶
Create a color function for RMSD values.
- ovo.core.logic.proteinqc_logic.get_higher_is_better_colormap(min_val, max_val)¶
- ovo.core.logic.proteinqc_logic.get_lower_is_better_colormap(min_val, max_val)¶
- ovo.core.logic.proteinqc_logic.get_neutral_colormap(min_val, max_val)¶
- ovo.core.logic.proteinqc_logic.get_descriptor_cmap(descriptor: ovo.core.database.Descriptor, min_val: float, max_val: float)¶
Return a color mapping function for the given descriptor.
Colormap logic:
For special descriptors (e.g., pLDDT, PAE), apply custom color schemes.
If all thresholds (min_value, warning_value, error_value, max_value) are set, use them for color transitions based on the comparison type.
If thresholds are not fully set but a comparison is defined, use a 2-color scale (more green is better) based on comparison type and min/max values in the data.
If thresholds are not fully set and no comparison is defined, use a neutral colormap (higher values are darker grey), determined by min/max values in the data.
Args: descriptor (Descriptor): The descriptor for which to create the colormap. min_val (float): Minimum value among the selected designs. max_val (float): Maximum value among the selected designs.
- ovo.core.logic.proteinqc_logic.get_flag_color(value: float, descriptor: ovo.core.database.Descriptor) Literal[green, yellow, orange, missing, None]¶
- ovo.core.logic.proteinqc_logic.get_descriptor_comment(descriptor: ovo.core.database.Descriptor) str¶