fast_conformation.gui package¶
Submodules¶
fast_conformation.gui.analysis_config module¶
- class fast_conformation.gui.analysis_config.AnalysisCategory(widget: Callable, tool_tip: str = '')[source]¶
Bases:
objectData class to represent an analysis category.
- widget¶
A callable that returns the widget associated with the analysis.
- Type:
Callable
- tool_tip¶
A string that provides a description of the analysis category.
- Type:
str
- tool_tip: str = ''¶
- widget: Callable¶
- class fast_conformation.gui.analysis_config.AnalysisConfigWidget(job_manager)[source]¶
Bases:
QWidgetThe AnalysisConfigWidget class is responsible for providing a user interface to configure various analysis options. It contains general analysis options and specific configurations for different types of analysis (RMSF, RMSD, TMScore, etc.).
- job_manager¶
A manager object that handles job submissions and execution.
- class fast_conformation.gui.analysis_config.GeneralAnalysisWidget[source]¶
Bases:
QWidgetGeneralAnalysisWidget provides the user interface for setting general analysis options like job name, output path, sequence pairs, and other configurations.
- auto_detect_sequence_pairs()[source]¶
Automatically detects sequence pairs from the selected directory.
- add_seq_pair(seq1='', seq2='')[source]¶
Adds a new sequence pair to the widget.
- Parameters:
seq1 – The first sequence in the pair.
seq2 – The second sequence in the pair.
- auto_detect_sequence_pairs(predictions_path)[source]¶
Automatically detects sequence pairs based on the structure of the predictions path directory.
- Parameters:
predictions_path – The path to the directory containing predictions.
- get_general_options()[source]¶
Retrieves the current general options set in the widget.
- Returns:
A dictionary containing the general options.
- class fast_conformation.gui.analysis_config.PCAWidget(general_options_getter, job_manager)[source]¶
Bases:
AnalysisWidgetBaseWidget to configure and run PCA (Principal Component Analysis).
- get_specific_options()[source]¶
Retrieves the specific options for PCA analysis.
- Returns:
A dictionary containing the specific options for PCA analysis.
- class fast_conformation.gui.analysis_config.RMSD2DWidget(general_options_getter, job_manager)[source]¶
Bases:
AnalysisWidgetBaseWidget to configure and run 2D RMSD (Root Mean Square Deviation) analysis.
- get_specific_options()[source]¶
Retrieves the specific options for 2D RMSD analysis.
- Returns:
A dictionary containing the specific options for 2D RMSD analysis.
- class fast_conformation.gui.analysis_config.RMSDAnalysisWidget(general_options_getter, job_manager)[source]¶
Bases:
AnalysisWidgetBaseWidget to configure and run RMSD (Root Mean Square Deviation) analysis.
- get_specific_options()[source]¶
Retrieves the specific options for RMSD analysis.
- Returns:
A dictionary containing the specific options for RMSD analysis.
- class fast_conformation.gui.analysis_config.RMSFAnalysisWidget(general_options_getter, job_manager)[source]¶
Bases:
AnalysisWidgetBaseWidget to configure and run RMSF (Root Mean Square Fluctuation) analysis.
- get_specific_options()[source]¶
Retrieves the specific options for RMSF analysis.
- Returns:
A dictionary containing the specific options for RMSF analysis.
- class fast_conformation.gui.analysis_config.TMSCOREWidget(general_options_getter, job_manager)[source]¶
Bases:
AnalysisWidgetBaseWidget to configure and run TMScore analysis.
- get_specific_options()[source]¶
Retrieves the specific options for TMScore analysis.
- Returns:
A dictionary containing the specific options for TMScore analysis.
- class fast_conformation.gui.analysis_config.TrajectorySavingWidget(general_options_getter, job_manager)[source]¶
Bases:
AnalysisWidgetBaseWidget to configure and run trajectory saving.
- get_specific_options()[source]¶
Retrieves the specific options for trajectory saving.
- Returns:
A dictionary containing the specific options for trajectory saving.
- class fast_conformation.gui.analysis_config.TwoTMScoreWidget(general_options_getter, job_manager)[source]¶
Bases:
AnalysisWidgetBaseWidget to configure and run 2D TMScore analysis.
- get_specific_options()[source]¶
Retrieves the specific options for 2D TMScore analysis.
- Returns:
A dictionary containing the specific options for 2D TMScore analysis.
fast_conformation.gui.build_msa module¶
- class fast_conformation.gui.build_msa.MSAOptionsWidget(job_manager)[source]¶
Bases:
AnalysisWidgetBaseMSAOptionsWidget provides a user interface for configuring and running multiple sequence alignment (MSA) jobs using either jackhmmer or mmseqs2.
- toggle_additional_options()[source]¶
Toggles visibility of additional options based on the selected MSA type.
- get_specific_options()[source]¶
Retrieves the specific options set by the user for MSA analysis.
- Returns:
A dictionary containing the specific MSA options.
- run_specific_analysis()[source]¶
Runs the specific MSA analysis based on the provided configuration.
- Parameters:
config – A dictionary containing the configuration options for the MSA analysis.
fast_conformation.gui.dock_widget module¶
- class fast_conformation.gui.dock_widget.Category(widget: Callable[[JobManager], QWidget], tool_tip: str = '')[source]¶
Bases:
objectA data class that represents a category in the main widget.
- widget¶
A callable that returns a QWidget, taking a JobManager as an argument.
- Type:
Callable[[fast_conformation.gui.job_manager.JobManager], PyQt5.QtWidgets.QWidget]
- tool_tip¶
A string representing the tooltip text for the category.
- Type:
str
- tool_tip: str = ''¶
- widget: Callable[[JobManager], QWidget]¶
- class fast_conformation.gui.dock_widget.MainWidget(parent, job_manager)[source]¶
Bases:
QWidgetMainWidget serves as the central widget for managing different tasks such as building MSA, making predictions, and analyzing results. It provides an interface for selecting tasks and displaying the appropriate configuration widgets.
- clear_dock_widget()[source]¶
Clears the contents of the current dock widget, removing all its child widgets.
- clear_layout(layout, start_index=0)[source]¶
Clears the contents of a given layout, starting from a specified index.
- Parameters:
layout – The QLayout to clear.
start_index – The index from which to start clearing the layout.
- create_dock_widget()[source]¶
Creates a new dock widget for selecting options. If an existing dock widget is present, it is cleared before creating the new one.
- create_new_job_widget()[source]¶
Creates a widget that allows the user to select a new job.
- Returns:
A QWidget that contains the options for selecting a new job.
- Return type:
new_job_widget
fast_conformation.gui.icons module¶
- class fast_conformation.gui.icons.Icons(parent=None)[source]¶
Bases:
QListWidgetIcons is a custom QListWidget that displays a grid of icons with labels. It supports adding individual items with optional tooltips and styling.
fast_conformation.gui.job_manager module¶
- class fast_conformation.gui.job_manager.JobItemWidget(job_id, status, message, job_manager, name)[source]¶
Bases:
QWidgetRepresents a single job item in the JobStatusPage, displaying the job’s name, status, and a button to view the job’s log.
- class fast_conformation.gui.job_manager.JobManager[source]¶
Bases:
QObjectManages job execution, monitoring, and status updates within a Qt application. It handles starting jobs, updating statuses, and emitting signals.
- job_finished¶
A PyQt signal emitted when a job finishes, with job_id, success, and message.
- job_started¶
A PyQt signal emitted when a job starts, with the job name.
- get_job_log(job_id)[source]¶
Retrieves the log of the specified job.
- Parameters:
job_id – The unique identifier of the job.
- Returns:
The log of the job as a string.
- get_job_name(job_id)[source]¶
Retrieves the name of the specified job.
- Parameters:
job_id – The unique identifier of the job.
- Returns:
The name of the job as a string.
- get_job_status(job_id)[source]¶
Retrieves the current status of the specified job.
- Parameters:
job_id – The unique identifier of the job.
- Returns:
The status of the job as a string.
- job_finished¶
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- job_started¶
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- monitor_queue()[source]¶
Monitors the queue for job status updates and emits the job_finished signal when a job is completed or fails.
- run_job(target, args, job_name)[source]¶
Runs a job using the backend and emits a signal when the job starts.
- Parameters:
target – The function to execute as the job.
args – A tuple of arguments to pass to the target function.
job_name – A string name for the job.
- Returns:
The unique identifier for the job.
- Return type:
job_id
- class fast_conformation.gui.job_manager.JobManagerBackend[source]¶
Bases:
objectManages the backend operations of job execution, including job tracking, status updates, and log management.
- jobs¶
A dictionary to store information about the jobs.
- manager¶
A multiprocessing.Manager instance to manage shared resources.
- queue¶
A multiprocessing.Queue for communication between processes.
- get_job_log(job_id)[source]¶
Retrieves the log of the specified job.
- Parameters:
job_id – The unique identifier of the job.
- Returns:
The log of the job as a string, or None if the job_id is not found.
- get_job_name(job_id)[source]¶
Retrieves the name of the specified job.
- Parameters:
job_id – The unique identifier of the job.
- Returns:
The name of the job as a string, or None if the job_id is not found.
- get_job_status(job_id)[source]¶
Retrieves the current status of the specified job.
- Parameters:
job_id – The unique identifier of the job.
- Returns:
The status of the job as a string, or None if the job_id is not found.
- run_job(target, args, job_name)[source]¶
Runs a job in a separate process, ensuring that the job name is unique and that the arguments are pickleable.
- Parameters:
target – The function to execute as the job.
args – A tuple of arguments to pass to the target function.
job_name – A string name for the job.
- Returns:
A unique identifier for the job.
- Return type:
job_id
- Raises:
ValueError – If job_name is not a string, or if arguments are not pickleable.
- class fast_conformation.gui.job_manager.JobStatusPage(job_manager)[source]¶
Bases:
QWidgetDisplays the status of all jobs in the JobManager. It allows users to view the current status and logs of jobs.
- add_job_item(job_id, status, message, name)[source]¶
Adds a new job item to the list widget.
- Parameters:
job_id – The unique identifier of the job.
status – The current status of the job as a string.
message – A string message about the job’s outcome.
name – The name of the job.
- fast_conformation.gui.job_manager.job_wrapper(job_id, target, log_list, queue, *args)[source]¶
Wraps the execution of a job to capture stdout and stderr output into a log list, and handles exceptions and job completion status.
- Parameters:
job_id – A unique identifier for the job.
target – The function to be executed as the job.
log_list – A shared list to capture log messages.
queue – A multiprocessing queue to report the job status.
*args – Additional arguments to pass to the target function.
fast_conformation.gui.make_predictions module¶
- class fast_conformation.gui.make_predictions.MakePredictionsWidget(job_manager, general_options_getter=None, *args, **kwargs)[source]¶
Bases:
AnalysisWidgetBaseThe MakePredictionsWidget class provides a user interface for configuring and running predictions using different MSA (Multiple Sequence Alignment) options and settings.
- add_seq_pair(seq1='', seq2='')[source]¶
Adds a new sequence pair input to the interface.
- Parameters:
seq1 – The first sequence in the pair.
seq2 – The second sequence in the pair.
- get_seq_pairs()[source]¶
Retrieves the sequence pairs input by the user.
- Returns:
A list of sequence pairs, each represented as a list of two integers.
- get_specific_options()[source]¶
Retrieves the specific options set by the user.
- Returns:
A dictionary containing the options for the prediction job.
fast_conformation.gui.plot_widget module¶
- class fast_conformation.gui.plot_widget.PlotWidget(parent=None)[source]¶
Bases:
GraphicsLayoutWidgetPlotWidget is a custom widget for plotting data using pyqtgraph. It supports both line plots and scatter plots with optional color mapping and colorbars.
- add_borders(plot)[source]¶
Adds borders to the given plot.
- Parameters:
plot – The plot item to which borders will be added.
- add_colorbar(resids)[source]¶
Adds a colorbar to the widget based on residual values.
- Parameters:
resids – Residual values to map the colorbar.
- Returns:
The created colorbar item.
- add_line(plot_item, x_data, y_data, color, label, lstyle=None)[source]¶
Adds a line plot to the given plot item.
- Parameters:
plot_item – The plot item to which the line plot will be added.
x_data – The data for the x-axis.
y_data – The data for the y-axis.
color – The color of the line.
label – The label for the legend.
lstyle – The line style (e.g., solid, dashed).
- add_plot(x_data, y_data, title, x_label, y_label, color=None, label=None, resids=None, scatter=False, colorbar=False)[source]¶
Adds a new plot to the widget.
- Parameters:
x_data – The data for the x-axis.
y_data – The data for the y-axis.
title – The title of the plot.
x_label – The label for the x-axis.
y_label – The label for the y-axis.
color – The color of the line or scatter points.
label – The label for the legend.
resids – Residual values for coloring scatter points.
scatter – Whether to create a scatter plot.
colorbar – Whether to add a colorbar for the scatter plot.
- Returns:
The created plot item.
- add_scatter(plot_item, x_data, y_data, resids=None, color='b', colorbar=False, label=None)[source]¶
Adds a scatter plot to the given plot item.
- Parameters:
plot_item – The plot item to which the scatter plot will be added.
x_data – The data for the x-axis.
y_data – The data for the y-axis.
resids – Residual values for coloring the scatter points.
color – The color of the scatter points.
colorbar – Whether to add a colorbar.
label – The label for the legend.
- Returns:
The created scatter plot item.
fast_conformation.gui.run_gui module¶
- class fast_conformation.gui.run_gui.BackgroundWidget(parent=None)[source]¶
Bases:
QWidgetA custom QWidget that displays a background image in the main window.
- class fast_conformation.gui.run_gui.MainFrame[source]¶
Bases:
QMainWindowMainFrame is the main application window for the FastConformation application. It contains the central widget, toolbar, and dock widgets for managing different tasks.
- create_terminal_dock()[source]¶
Creates a dock widget for displaying the analysis log (terminal output).
- create_terminal_dock()[source]¶
Creates a dock widget for displaying the analysis log (terminal output).
- set_initial_window_size()[source]¶
Sets the initial size of the main window based on the screen size.
- show_dock_widget(title, widget_callable)[source]¶
Displays a specified dock widget. If it does not exist, creates and displays it.
- Parameters:
title – The title of the dock widget.
widget_callable – A callable that returns the content widget for the dock.
- class fast_conformation.gui.run_gui.QPlainTextEditLogger(text_edit)[source]¶
Bases:
objectA custom logger that redirects stdout and stderr to a QPlainTextEdit widget.
fast_conformation.gui.widget_base module¶
- class fast_conformation.gui.widget_base.AnalysisWidgetBase(job_manager, general_options_getter=False)[source]¶
Bases:
QWidgetA base class for analysis widgets that provides common functionality such as input validation, configuration merging, and job management.
- job_manager¶
An instance of the JobManager responsible for managing job execution.
- timer¶
A QTimer instance that periodically checks the job manager queue.
- get_specific_options()[source]¶
Returns specific options for the analysis. Should be overridden by subclasses.
- check_job_manager_queue()[source]¶
Periodically checks the job manager queue for updates. This method can be overridden or extended if needed.
- get_specific_options()[source]¶
Retrieves specific options for the analysis. This method should be overridden by subclasses to provide specific options.
- Returns:
A dictionary containing specific options for the analysis.
- on_job_finished(job_id, success, message)[source]¶
Handles the job finished event, displaying an informational message to the user.
- Parameters:
job_id – The ID of the finished job.
success – A boolean indicating whether the job was successful.
message – A message describing the outcome of the job.
- run_analysis()[source]¶
Validates inputs, merges general and specific configurations, and runs the analysis. If validation fails, an error message is displayed.
- run_specific_analysis(config)[source]¶
Runs the specific analysis using the provided configuration. This method should be overridden by subclasses to implement specific analysis logic.
- Parameters:
config – A dictionary containing the merged configuration options.
- show_error_message(errors)[source]¶
Displays an error message dialog with a list of errors.
- Parameters:
errors – A list of error messages to display.
- fast_conformation.gui.widget_base.merge_configs(general_options, specific_options)[source]¶
Merges two dictionaries, with values from the specific_options dictionary overriding those in the general_options dictionary.
- Parameters:
general_options – A dictionary containing general configuration options.
specific_options – A dictionary containing specific configuration options.
- Returns:
A dictionary containing the merged configuration options.