transphire package (Developer area)

Submodules

transphire.buttoncontainer module

transphire.emaildialog module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.emaildialog.EmailDialog(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

EmailDialog widget.

Inherits from: QDialog

Buttons: OK Cancel

LineEdit: Name - Name, that associates with the E-Mail E-Mail - E-Mail adress of the user

get_email()[source]

Return the text of the E-Mail.

Arguments: None

Return: E-Mail

get_name()[source]

Return the text of the Name.

Arguments: None

Return: Name

transphire.framecontainer module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.framecontainer.FrameContainer(parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

FrameContainer widget.

Inherits from: QWidget

Buttons: Add - Add FrameWidget widget to the layout

LineEdit: First frame - First frame to use for a smaller amount of dose Last frame - Last frame to use for a smaller amount of dose

add_widget()[source]

Add a FrameWidget widget to the dynamic layout. Called when the add button is clicked.

Arguments: None

Returns: None

enable(var, use_all)[source]

Enable or disable the buttons and widgets.

Arguments: var - State of buttons (True or False) use_all - Disable all buttons (True) or only some (False)

Return: None

get_settings()[source]

Get settings of all FrameWidget widgets.

Arguments: None

Returns: settings - List of FrameWidget settings

set_settings(settings)[source]

Add FrameWidget widgets to the dynamic layout based on setting entries.

Arguments: settings - List of FrameWidget settings.

Returns: None

transphire.framewidget module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.framewidget.FrameWidget(first, last, dose_weight, default, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

FrameWidget widget.

Inherits from: QWidget

Buttons: Delete - Delete this instance of the variable.

Signals: delete - Delete this instance of the variable (class instance).

delete
get_settings()[source]

Get the settings

Arguments: None

Return: settings as dictionary

transphire.inputbox module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.inputbox.InputBox(is_password, restart_names=None, is_stop=False, settings=None, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

Show a message box with an input field.

Inherits: QDialog

Signals: None

getText()[source]

Get the text from the label.

Arguments: None

Returns: Text content

get_restart_dict()[source]
handle_check(state)[source]
setDefault(text)[source]

Set the default values for the QLineEdit.

text - Text to put

Returns: None

setText(heading, text)[source]

Set the text to the label.

Arguments: heading - Heading of the window text - Text of the label

Returns: None

set_type(this_type)[source]

transphire.loadcontent module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.loadcontent.LoadContent(typ, separator, settings_folder, hdd=None, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

LoadContent widget. Widget used for the LoadContentContainer.

Inherits from: QWidget

Signals: delete - Emited, when the delete button is pressed (object)

delete
get_settings()[source]

Get the settings from the child widgets.

Arguments: None

Return: List of settings

set_settings(settings)[source]

Set settings to the entry widgets.

Arguments: settings - List of settings

Return: None

transphire.loadcontentcontainer module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.loadcontentcontainer.LoadContentContainer(typ, template_name, templates, settings_folder, is_shared, default_file, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

LoadContentContainer widget Inherits from: QWidget

Buttons: Save settings - Save currently defined settings to settings files Add - Add new Mount entry (Case Mount)

add_widget(name=None, hdd=None)[source]

Add new widget to layout.

Arguments: name - Name of new mount point (default None) hdd - Is hdd entry (default None)

Return: None

copy_from_template(template)[source]
get_settings()[source]

Get settings from tab or normal normal widget.

Arguments: None

Return: List of widget settings

get_settings_tab()[source]

Get settings from tab widget.

Arguments: None

Return: List of widget settings

get_settings_widget()[source]

Get settings from normal widget.

Arguments: None

Return: List of widget settings

remove_widget(separator)[source]

Remove widget from layout.

Arguments: separator - List of seperator widgets

Return: None

save_settings()[source]

Save settings specified in widget to json text file.

Arguments: None

Return: None

set_settings(settings)[source]

Set settings to widget.

Arguments: settings - List of widget settings

Return: None

transphire.loadwindow module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.loadwindow.DefaultSettings(apply, settings_directory, template_name, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

DefaultSettings dialog. Dialog used to enter default values.

Inherits from: QDialog

accept_apply()[source]

Set the apply settings variable to True before saving.

Argumens: None

Return: None

add_tab(widget, name)[source]

Add a new widget to the tab widget

Arguments: widget - Widget to add as new tab Name - Name of the new tab

Return: None

add_tabs()[source]
check_modified_widgets(done)[source]

Check, if a widget is modified before saving.

Arguments: done - If True, close after input, else apply settings.

Return: True if no modification, else False

clear_tabs()[source]
closeEvent(event)[source]

Handle the close event.

Arguments: event - Close event

Return: None

create_initial_tabs(tab_dict, parent_widget, is_old=False)[source]
fill_default_dict()[source]

Fill the default dict with the information from the function dict.

Arguments: None - The self.default_dict is used

Returns: None - The self.default_dict is changed in-place

get_apply()[source]

Getter for the self.apply variable.

Arguments: None

Return: Content of self.apply

static get_content_default(edit_settings, apply, settings_folder, template_name)[source]

Staticmethod to open the default content dialog.

Arguments: edit_settings - If True, open default settings dialog, else just return content apply - Apply settings after closing the default settings dialog settings_folder - Folder to store the default settings

Return: Content for the widgets, Content of the apply variable

is_in_content(tab_dict, name)[source]
load_template()[source]
recursive_clear(tab_widget)[source]

transphire.logviewer module

class transphire.logviewer.LogViewer(show_indicators=False, indicator='', file_name='', parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

appendPlainText(text, indicator='log', user=False)[source]
change_state(state)[source]
get_indicator(indicator)[source]
increment_indicator(indicator, text='')[source]
my_click_event(event=None)[source]
reset_plain_text(text)[source]
set_project_path(project_path, log_path, error_path)[source]
submit_text()[source]
update_plain_text(force=False)[source]

transphire.logviewerdialog module

class transphire.logviewerdialog.LogViewerDialog(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

add_tab(widget, name)[source]

transphire.mainwindow module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.mainwindow.MainWindow(content_raw, content_gui, content_pipeline, settings_folder, mount_directory, template_name, version, n_feedbacks, parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

MainWindow widget. Connects GUI and worker threads.

Inherits from: QMainWindow

Buttons: None

Signals: None

abort_finished(*args, **kwargs)[source]

Set the mount worker abort variable to True.

Arguments: None

Return: None

check_quota()[source]

Check the quota for the project and scratch directory.

Arguments: None

Return: None

closeEvent(event)[source]

Quit threads before close and check if the process is still running

Arguments: event - QCloseEvent.

Return: None

continue_dialog(text1, text2, is_stop=False, is_restart=False, settings=None)[source]

Check if the user wants to run the continue mode.

Arguments: text1 - Dialog window name. text2 - Text of the dialog.

Return: True, if the input is YES!

enable(var, use_all=False)[source]

Enable or disable widgets

Arguments: var - Enable status of the widgets. use_all - Disable/Enable everything (Default False)

Return: None

fill_content(content_gui)[source]

Fill the layouts of the central widget.

Arguments: content_gui - Content used to create the GUI outfit.

Return: List of errors that occured.

get_start_settings(monitor=False)[source]

Start TranSPHIRE processing.

Arguments: None

Return: None

hide_tab(sender, text)[source]
load(file_name=None)[source]

Load settings from settings file.

Arguments: file_name - Name of the file (default None)

Return: None

monitor(start)[source]

Start the TranSPHIRE monitor processing.

Arguments: start - True if start, False if stop

Returns: None

new_round_plot()[source]
postprocess_content(error_list)[source]

Do postprocessing of creating GUI content, like connecting signals.

Arguments: error_list - List of errors that occured.

Return: True, if saving was succesful.

reset_gui(template_name, load_file)[source]

Reset the content of the mainwindow.

Arguments: template_name - Name of the template to load load_file - Settings file (default None).

Return: None

save(file_name=None, temp=False, interactive=False, do_message=True)[source]

Save GUI status to file.

Arguments: file_name - File name to save settings to. temp - File is a temporary save file.

Return: True, if saving was succesful.

save_temp_settings()[source]

Save the status of the GUI in a temp file.

Arguments: None

Return: True, if saving was succesful.

set_central_widget()[source]

Reset the central widget of the MainWindow.

Arguments: None

Return: None

set_design(settings)[source]

Load settings from settings file.

Arguments: settings - Settings as dictionary.

Return: None

set_layout_structure()[source]

Setup the layout structure for the central widget.

Arguments: None

Return: None

set_settings(settings)[source]

Load settings from settings file.

Arguments: settings - Settings as dictionary.

Return: None

set_visualisation()[source]
static settings_to_dict(settings)[source]

Make the settings readable for the widgets set settings method.

Arguments: settings - Settings as dictionary.

Return: None

sig_reset
start()[source]
start_threads(content_pipeline)[source]

Start threads used in TranSPHIRE.

Arguments: content_pipeline - Content used to start processing threads.

Return: None

stop(abort=False)[source]

Stop the process.

Arguments: None

Return: None

stop_dialog()[source]

Check if the user really wants to stop the process.

Arguments: None

Return: None

transphire.messagebox module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.messagebox.MessageBox(is_question, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

Show a message box

Inherits: QDialog

Signals: None

setDefault(text)[source]
setText(heading, text)[source]

Set the text to the label.

Arguments: heading - Heading of the window text - Text of the label

Returns: None

transphire.mountcalculator module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.mountcalculator.MountCalculator(name, parent=None)[source]

Bases: PyQt5.QtCore.QObject

MountCalculator object.

Inherits from: QObject

Buttons: None

Signals: sig_finished - Signal emitted, if process finished (str, str, str)

calculate_df_quota(key, mount_folder)[source]

Calculate the quota with the help of the df command.

Arguments: key - Mount point key mount_folder - Mount folder

Return: None

calculate_get_quota(key, quota, mount_folder)[source]

Calculate the quota by calculating the size of every file.

Arguments: key - Mount point key mount_folder - Mount folder quota - User provided maximum quota

Return: None

calculate_ssh_quota(user, folder, device, mount_folder, ssh_dict, quota_command_dict, password_dict)[source]

Calculate the quota via ssh.

Arguments: mount_folder - Mount folder user - Username folder - Folder to mount device - Device name ssh_dict - ssh_dict containing ssh information quota_command_dict - Dictionary containing the quota commands password_dict - Dictionary containing passwords

Return: None

get_folder_size(folder, size)[source]

Get the size of the folder recursively

Arguments: folder - Folder to check contents size - Current caclulated size

Return: Calculated size

static get_quota_quota_command(text, folder)[source]

Extract the quota from the quota command.

Arguments: text - Text returned by quota command. folder - Mounted folder

Return: None

get_ssh_quota(user, folder, device)[source]

Get the quota via ssh command.

Arguments: user - User name folder - Mounted folder device - Device name

Return: None

sig_finished

transphire.mountcontainer module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.mountcontainer.MountContainer(content_mount, mount_worker, parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

MountContainer widget.

Inherits from: QWidget

Buttons: None

Signals: None

enable(var, use_all)[source]

Enable or disable the content.

Arguments: var - State of buttons (True or False) use_all - Disable all buttons (True) or only some (False)

Return: None

get_settings()[source]

Return settings of the container.

Arguments: None

Return: Settings as list

set_threadlist(thread_list)[source]

Set the thread instances for the different objects.

Arguments: thread_list - List of mount threads

Return: None

transphire.mountwidget module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.mountwidget.MountWidget(content, mount_worker, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

MountWidget widget.

Inherits from: QWidget

Buttons: mount_button - Mount mount point umount_button - Umount mount point

Signals: None

get_settings()[source]

Return settings of the content.

Arguments: None

Returns: Settings as dictionary

mount()[source]

Mount device preparation

Arguments: None

Return: None

set_current_folder(device, folder)[source]
set_thread_object(thread_object)[source]

Set the thread object.

thread_object - Thread object to set.

Returns: None

umount()[source]

Umount device signal preparation

Arguments: None

Return: None

transphire.mountworker module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.mountworker.MountWorker(password, settings_folder, mount_directory, parent=None)[source]

Bases: PyQt5.QtCore.QObject

Mounting and unmounting shared devices.

Inherits from: QObject

Buttons: None

Signals: sig_mount_hdd - Signal connected to mount HDD (device|str) sig_mount - Signal connected to mount a mount point (device|str, user|str, password|str, folder|str, server|str, typ|str, domain|str, version|str, sec|str, gid|str) sig_umount - Signal connected to unmount a mount point (device_folder|str, device|str, thread|object)

sig_success - Signal emitted, if a task was a success (text|str, device|str, color|str) sig_error - Signal emitted, if a task was a failure (text|str, device|str) sig_info - Signal emitted, to show text in a text box (text|str) sig_notification - Signal emitted, to send a notification message (text|str)

sig_add_save - Signal connected to add a save file to the dictionary (device|str, ss_address|str, quota_command|str, is_right_quota|str, quota|str) sig_load_save - Signal connected to load data from save file (No object) sig_refresh - Signal connected to recalculate quota (No object) sig_quota - Signal emitted, to refresh the quota status in the GUI (text|str, device|str, color|str) sig_set_settings - Signal connected set quota related settings (settings|object)

sig_calculate_ssh_quota - Signal emitted to calculate the quota via ssh (user|str, folder|str, device|str, mount_folder|str, ssh_dict|object, quota_command_dict|object, password_dict|object) sig_calculate_df_quota - Signal emitted to calculate the quota via system information (device|str, mount_folder|str) sig_calculate_get_quota - Signal emitted to calculate the quota brute force (device|str, total_quota|str, mount_folder|str)

add_save(device, ssh_address, quota_command, is_right_quota, quota)[source]

Add a save file to the dictonaries.

Arguments: device - Mounted device name ssh_address - ssh adress quota_command - Command to calculate quota via ssh is_right_quota - True, if df is showing the right quota quota - Provided maximum quota

Return: None

check_connection()[source]

Check if a mount connection crashed

Arguments: None

Return: None

fill_quota_project_and_scratch(name, directory, warning, quota_limit)[source]

Refresh quota information for the project and scratch directory.

Arguments: name - Name (project or scratch) directory - Directory to check warning - current warning status quota_limit - Limit of the quota to show a warning

Return: Current warning status

load_save()[source]

Load connection status from the files

Arguments: None

Return: None

mount(device, user, password, folder, server, typ, domain, version, sec, gid, folder_from_root, fixed_folder)[source]

Mount device except HDD

Arguments: device - Device name user - Username password - User password folder - Mount folder server - Server name typ - Mount type domain - Domain name version - Mount type version sec - security protocol gid - groupid to mount folder_from_root - Absolute path pointing towards the mount point

Return: None

mount_hdd(device)[source]

Mount external HDD

Arguments: device - Device name

Return: None

refresh_quota()[source]

Refresh quota information.

Arguments: None

Return: None

set_settings(settings)[source]

Set settings used by the worker.

Arguments: settings - TranSPHIRE settings

Return: None

sig_add_save
sig_calculate_df_quota
sig_calculate_get_quota
sig_calculate_ssh_quota
sig_error
sig_info
sig_load_save
sig_mount
sig_mount_hdd
sig_notification
sig_quota
sig_refresh
sig_set_folder
sig_set_settings
sig_success
sig_umount
umount(device_folder, device, fixed_folder, thread_object)[source]

Unmount device

Arguments: device_folder - Mount point folder device - Device name thread_object - Thread object that is connected to the mount point

Return: None

transphire.mountworker.check_existence(mount_directory, mount_folder)[source]

Check existence of the mount folder and create it if it does not

Arguments: mount_folder - tolder to check

Return: True, if the mount folder exists

transphire.notificationcontainer module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.notificationcontainer.NotificationContainer(content, mount_worker, process_worker, settings_folder, parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Container for notification widgets

Inherits: QWidget

Signals: sig_stop - Signal is emitted, if the user is sending /stop via telegram

add_email()[source]

Add a new e-mail adress

Arguments: None

Returns: None

enable(var, use_all)[source]

Enable or disable the widgets of the widget.

Arguments: var - True(Enable) or False(Disable) use_all - Disable or enable all

Returns: None

get_settings()[source]

Get settings as dict

Arguments: None

Returns: Settings dictionary as list

get_telegram_messages()[source]

Check the messages in telegram for commands.

Arguments: None

Returns: None

get_telegram_user(page)[source]

Get the users and the user id

Arguments: page - Webpage of the telegram bot

Returns: Dictionary of users

send_notification(text)[source]

Send a notification to specified users.

Arguments: text - Text to send

Returns: None

send_to_user(user_id, text, name)[source]

Send a message to all users.

Arguments: user_id - User id of the receiving person text - Text of the message name - Name of the sender

Returns: None

set_settings(settings)[source]

Set settings.

Arguments: settings - Settings as dictionary to set.

Returns: None

sig_stop
update()[source]

Update the combo boxes.

Arguments: None

Returns: None

update_email()[source]

Update E-Mail file.

Arguments: None

Returns: None

update_telegram()[source]

Update telegram settings file

Arguments: None

Returns: None

transphire.notificationwidget module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.notificationwidget.NotificationWidget(name, default, default_programs_dict, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget for notification phone numbers

add_exceptions(name)[source]

Add a person to the exception list and dont send notification anymore.

Arguments: name - Name of the person

Returns: None

change_tooltip(text)[source]
clear_combo()[source]

Remove all users from the combo box.

Arguments: None

Returns: None

get_settings()[source]

Get text of the currently selected combo item.

Arguments: None

Returns: Settings dictionary

set_settings(name, state)[source]

Set currently selected combo item in text.

Arguments: name - Name of the person that should be currently selected. state - State of the person (True/False;Enables/Disables)

Returns: None

update_combo(typ, users)[source]

Update the combo boxes.

Arguments: users - User dictionary

Returns: None

transphire.passworddialog module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.passworddialog.PasswordDialog(folder, default, login, extension, fixed_folder, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

User password dialog

Inherits: QDialog

Signals: None

transphire.plotcontainer module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.plotcontainer.PlotContainer(name, content, plot_labels, plot_name, plot_worker, plot_type, layout, *args, parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QMainWindow

Qwidget in combination with a FigureCanvas.

Inherits: QMainWindow

activate_tab(name)[source]

Activate the tab with the name: name.

Arguments: name - Name of the activation

Returns: None

enable(var, use_all)[source]

Enable or disable the widgets.

var - It True, enable widgets, else disable use_all - If True, enable/disable all widgets, else only a subset

Returns: None

eventFilter(source, event)[source]

Override the QMainWindow eventFilter function.

source - Source that led to the event trigger event - Emitted event

Returns: True, if it has been a close event -> Redock widget Event, if it is another event

reset_plot()[source]
select_tab(widget)[source]
set_floating()[source]
set_visibility(visible, name)[source]
synchronize_tabs(widget)[source]
update_figure(name, name_no_feedback, data, directory_name, settings)[source]

Update the figure in the canvas

name - Name of the program that called this function. data - Data to plot. directory_name - Directory to save plots to. settings - TranSPHIRE settings

Returns: None

class transphire.plotcontainer.TwinContainer(dock_widget, *args, parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

add_to_layout(name, widget)[source]
handle_show(name, widget, state)[source]
mouse_twin_event(event)[source]

transphire.plotwidget module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.plotwidget.MplCanvas(no_grid, width=5, height=5, dpi=100, parent=None)[source]

Bases: matplotlib.backends.backend_qtagg.FigureCanvasQTAgg

sig_twin
class transphire.plotwidget.MplCanvasWidget(no_grid, plot_type, is_twin=False, width=5, height=5, dpi=100, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

update_labels(title, label_x, label_y)[source]
class transphire.plotwidget.PlotWidget(label, plot_typ, dock_widget, twin_container, *args, parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

PlotWidget widget. Widget used to show data plots.

Inherits from: QWidget

Signals: None

add_canvas()[source]
clear_canvas()[source]
do_data_reset()[source]
force_update(do_message=False)[source]
hide_marker()[source]
hide_twin(state)[source]
static high_res(x_data, y_data, splits)[source]
prepare_axes(update)[source]
set_current_image_name(text)[source]
set_settings(name, name_no_feedback, data, directory_name, settings)[source]
setup_values()[source]
start_plotting()[source]
update_data(do_message=False)[source]
update_figure(do_message=False)[source]
update_helpers(canvas, plot_idx, update, plot_type)[source]
update_histogram(canvas, plot_idx, update)[source]
update_image()[source]
update_image_plot(canvas, data_x, data_y, high_res, label, marker, color, idx)[source]
update_trim()[source]
update_values(canvas, plot_idx, update)[source]
class transphire.plotwidget.SelectWidget(parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

check_enable(idx)[source]
filter_combo(text)[source]
get_value()[source]
handle_change()[source]
reset_values()[source]
set_values(value_list)[source]
sig_update
class transphire.plotwidget.TrimWidget(plot_typ, min_default_x, max_default_x, min_default_y, max_default_y, bin_default, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

get_values()[source]
reset_values()[source]
set_state(state)[source]
set_values(value_dict)[source]
sig_hide
sig_set_state
sig_update
class transphire.plotwidget.ViewWidget(parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

sig_hide
update_label(label_dict)[source]

transphire.plotworker module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.plotworker.PlotWorker(parent=None)[source]

Bases: PyQt5.QtCore.QObject

Plot different information about motion correction and ctf estimation.

Inherits: QObject

Signals: sig_data - Emitted, if data for plotting is found (name|str, data|object, directory|str, settings|object) sig_notification - Emitted, if phase plate limit is reached. (text|str)

calculate_array()[source]

Calculate array.

Returns: None

static calculate_array_now(name, name_no_feedback, directory_name, settings)[source]
reset_list()[source]
send_data(data)[source]
set_settings(settings)[source]

Set settings for the calculation of the arrays.

name - Name of the software that calls the calculation directory_name - Name of the directory that contains the log files settings - TranSPHIRE settings

Returns: None

sig_calculate
sig_data
sig_new_round
sig_reset
sig_reset_list
sig_set_visual
sig_visible

transphire.processthread module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.processthread.ProcessThread(shared_dict, name, content_settings, queue_com, password, settings, mount_directory, use_threads_set, stop, abort, has_finished, data_frame, parent=None)[source]

Bases: object

Worker thread

Inherits from: object

Buttons: None

Signals: None

add_to_queue(aim, root_name, allow_dublicate=False)[source]

Add item to queue.

Arguments: aim - Aim queue root_name - Name to add

Return: None

add_to_queue_file(root_name, file_name, allow_dublicate=False)[source]

Add item to queue_file.

Arguments: root_name - Name to add file_name - File to append to

Return: Name removed from the queue.

all_in_queue_file(aim, root_name, lock=True)[source]

Add item to queue.

Arguments: aim - Aim queue root_name - Name to add

Return: None

already_in_queue_file(aim, root_name)[source]

Add item to queue.

Arguments: aim - Aim queue root_name - Name to add

Return: None

already_in_translation_file(root_name)[source]

Check, if the root_name already exists in the translation file.

root_name - root_name

Returns: True, if root_name in translation file.

append_to_translate(root_name, new_name, xml_file, output_queue_dict=None)[source]

Write to the translation file.

root_name - Root name of the file new_name - New name of the file xml_file - XML or GTG file that contains meta data information

Returns: None

check_connection()[source]

Check, if the process got a lost connection error.

Arguments: None

Return: True, if the process did not get an error, else False

check_full()[source]

Check, if the program got an no space error.

Arguments: None

Return: True, if there is a no space error, else False

static check_if_mounted(directory)[source]

Check, if the mount point is still present.

Arguments: directory - Directory to check.

Return: True, if the mount point is still present, else False

check_queue_files(root_name)[source]
check_quota()[source]

Check, if the computer reached the quota limit.

Arguments: None

Return: True, if the computer did not hit the limit, else False

check_ready_for_copy(file_out)[source]

Check, if the current file is ready to copy.

file_out - File to copy

Returns: True, if ready

copy_as_another_user(file_in, file_out)[source]

Copy to device as another user via sudo.

file_in - Input file path file_out - Output file path

Returns: None

copy_as_user(file_in, file_out)[source]

Copy to another device.

file_in - Input file path file_out - Output file path

Returns: None

copy_extern(my_typ, copy_file)[source]
create_combines(combine_list, output_queue_dict=None)[source]
static delete_file_to_delete(file_to_delete)[source]
file_to_distribute(file_name, output_queue_dict=None)[source]
static get_gtg_info(xml_file, entries, first_entry)[source]
static get_hash(file_in, chunksize=1048576)[source]
static get_xml_info(xml_file, entries, first_entry)[source]
lost_connection(typ)[source]

Handle lost connection errors.

Arguments: typ - Typ of the error

Return: None

mkdir_p_as_another_user(folder)[source]

Create folders recursively as another user with the help of sudo.

folder - Folder structure to create

Returns: None

Find files in a recursive search.

directory - Directory to search files. file_list - List of files that have been found. find_meta - Find meta data flag.

Returns: List of files found

remove_from_queue()[source]

Remove item from queue.

Arguments: None

Return: Name removed from the queue.

remove_from_queue_file(root_name, file_name, lock=True)[source]

Remove the files from the queue file.

Arguments: root_name - Name of the file to delete

Return: None

remove_from_translate(root_name, output_queue_dict=None)[source]

Remove line from the translation file.

root_name - Root name of the file to remove

Returns: None

reset_queue(aim=None, switch_feedback=False, remove_pattern='THIS IS A DUMMY PATTERN')[source]
run()[source]

Run the thread.

Arguments: None

Return: None

run_auto3d(root_name)[source]

Run AutoSPHIRE. In case of Feedback rounds, just work with what is available. Otherwise, first wait until the required minimum number of classes is reached. Once this condition is met, create the combined classes file and provide it to the first AutoSPHIRE run. Afterwards, when the root_name is None start AutoSPHIRE when the minimum number of particles is met.

root_name - name of the file to process.

Returns: None

run_class2d(root_name)[source]
run_command(command, log_prefix, block_gpu, gpu_list, shell, file_to_delete=None, root_name_input='INVALID')[source]

Run the command with respect to the gpu list.

command - Command to run block_gpu - Block the GPU gpu_list - List of GPUs to use settings - Transphire settings

Return: log_file name, err_file name

run_compress(root_name)[source]

Compress stack.

root_name - Name of the file to compress

Returns: None

run_copy_extern(root_name)[source]

Copy to Work/Backup/HDD

root_name - Root name of the file to copy

Returns: None

run_ctf(root_name)[source]

Run CTF estimation.

root_name - name of the file to process.

Returns: None

run_extract(root_name)[source]

Run Particle extraction.

root_name - name of the file to process.

Returns: None

run_find()[source]

Find files

Arguments: None

Return: None

run_import(root_name)[source]

Import found files to em-transfer.

root_name - Root name of file to copy.

Returns: None

run_motion(root_name)[source]

Do the motion correction.

root_name - Root name of the micrograph.

Returns: None

run_picking(root_name)[source]

Run picking particles.

root_name - name of the file to process.

Returns: None

run_select2d(root_name)[source]

Run Particle extraction.

root_name - name of the file to process.

Returns: None

run_software_meta(directory)[source]

Copy meta files produces by the collection software.

Arguments: directory - Start directory for recursive search.

Return: None

run_train2d(root_name)[source]

Run Particle extraction.

root_name - name of the file to process.

Returns: None

send_out_of_range_error(warning, file_name, error_type)[source]
start_queue(clear_list)[source]

Start pipeline processes.

Arguments: None

Return: None

start_queue_find()[source]

Start finding files to process.

Arguments: None

Return: None

start_queue_meta()[source]

Start copying meta files.

Arguments: None

Return: None

static try_write(*args, **kwargs)
wait(wait_time=10)[source]
write_error(msg, root_name)[source]

Write to error file.

Arguments: msg - Message to send. root_name - File that was processed while the error occured.

Return: None

transphire.processworker module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.processworker.MyManager(address=None, authkey=None, serializer='pickle', ctx=None)[source]

Bases: multiprocessing.managers.BaseManager

LifoQueue(*args, **kwds)
class transphire.processworker.ProcessWorker(password, content_process, mount_directory, parent=None)[source]

Bases: PyQt5.QtCore.QObject

Setup and start worker threads

Inherits from: QObject

Buttons: None

Signals: sig_start - Connected to the run method to start the process (settings|object) sig_finished - Emitted, if run method finishes (No objects) sig_error - Emitted, if an error occured (text|str) sig_status - Emitted to change the status (text|str, device|str, color|str) sig_notification - Emitted to send a notification (text|str) sig_plot_ctf - Emitted to plot ctf information (ctf_name|str, ctf_settings|object, settings|object) sig_plot_motion - Emitted to plot motion information (motion_name|str, motion_settings|object, settings|object) sig_plot_picking - Emitted to plot picking information (picking_name|str, picking_settings|str, settings|object)

check_queue(queue_com)[source]

Check the content of the queues and react accordingly.

Arguments: queue_com

Return: None

emit_plot_signals(folder_list, monitor)[source]
fill_spot_dict()[source]

Fill the spot dictionary.

Arguments: None

Return: Spot dictionary

pre_check_programs()[source]

Check, if all programs the user wants to use are available.

Arguments: None

Return: True, if programs exist, else False

prefill_queue(shared_dict, entry, restart_dict, keep_list)[source]

Prefill the queues for continue mode

Arguments: shared_dict - Shared dictionary entry - Name of the queue process

Return: None

run(settings, restart_dict)[source]

Start the process.

Arguments: settings - Transphire settings

Return: None

static run_in_parallel(thread_obj)[source]
run_monitor(typ_dict, queue_com, full_content)[source]

Run the TranSPHIRE monitor process.

Arguments: typ_dict - Dictionary for the queue types queue_com - Dictionary for queue communication

Returns: None

run_process(typ_dict, queue_com, share_dict, bad_dict, queue_dict, content_process, full_content, manager, restart_dict)[source]

Run the TranSPHIRE process.

Arguments: typ_dict - Dictionary for the queue types queue_com - Dictionary for queue communication

Returns: None

sig_error
sig_finished
sig_notification
sig_set_project_directory
sig_start
sig_status
signal_plot

transphire.separator module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.separator.Separator(typ, color, up=False, down=False, left=False, right=False, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Separator widget

hide_show_widget(status)[source]

Hide or show the widget with the status.

Arguments: status - Status show or status hide.

transphire.settingscontainer module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.settingscontainer.SettingsContainer(content, name, global_dict, settings_folder, mount_worker, parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget for setting widgets.

Inherits: QWidget

change_state(name)[source]

Change the state of widgets based on the choice of the corresponding combo box

name - Name of the group to change status (Emitted by the combo box)

Returns: None

emit_global(_=None)[source]
emit_signals()[source]
enable(var, use_all)[source]

Disable or enable all widgets

Arguments: var - If True, enable the widgets, else disable them use_all - If True, all widgets are enabled/disabled

Returns: None

get_input_names()[source]
get_settings(quiet=False)[source]

Get the settings as dict

Arguments: quiet - If True, no prints are executed

Returns: Settings as dictionary

prepare_send_adjust(text)[source]
search_for_projects(project_dir)[source]
set_design(settings)[source]

Set settings to the widgets

Arguments: settings - Settings to set.

Returns: None

set_global(global_dict)[source]
set_new_model(weights, threshold)[source]
set_settings(settings)[source]

Set settings to the widgets

Arguments: settings - Settings to set.

Returns: None

sig_adjust_tab
sig_change_use_movie
update_global(text)[source]

transphire.settingswidget module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.settingswidget.SettingsWidget(name, content, content_others, mount_directory, global_dict=None, input_file_names=None, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget for setting entrys

Inherits: QWidget

Signals: sig_index_changed - Emitted, if the index of a combo box changes (Combo box name|str)

change_color_if_true()[source]

Change the color, if the types are all true.

Arguments: None

Returns: None

change_tooltip(text)[source]
enlarge()[source]
get_combo_entries()[source]

Get the entries of the combo boxes.

Arguments: None

Returns: List containing entries.

get_current_global()[source]
get_settings(quiet=False)[source]

Get the settings as dict.

Arguments: quiet - True, if prints should not be shown.

Returns: None, if an error occured. Settings as dictionary.

set_settings(text, is_checked)[source]

Set settings

text - Text to set to the widget.

Returns: None

sig_index_changed

transphire.statuscontainer module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.statuscontainer.StatusContainer(content, content_mount, content_pipeline, mount_worker, process_worker, content_font, parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Container for status widgets

Inherits: QWidget

Signals: sig_refresh_quota - Connected to change the quota text (no object)

refresh_quota(text, device, color)[source]

Refresh the quota

Arguments: text - Text to show device - Device name color - Color of the text

Returns: None

sig_refresh_quota

transphire.statuswidget module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.statuswidget.StatusWidget(name, default_name, default_quota, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget to show the current status of the processes.

Inherits: QWidget

Signals: sig_change_info_name - Connected, to change the info name information (text|str, color|str) sig_change_info_quota - Connected, to change the quota name information (text|str, color|str)

change_info_name(text, color)[source]

Change the info text and the info text color.

Arguments: text - Text to put color - Color to use

Returns: None

change_info_quota(text, color)[source]

Change the info text and the info text color.

Arguments: text - Text to put color - Color to use

Returns: None

sig_change_info_name
sig_change_info_quota

transphire.tabdocker module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.tabdocker.MyTabBar(parent)[source]

Bases: PyQt5.QtWidgets.QTabBar

paintEvent(self, a0: QPaintEvent)[source]
tabSizeHint(self, index: int) → QSize[source]
class transphire.tabdocker.TabDocker(parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Tab widget for the settingswidgets.

Inherits: QWidget

add_tab(widget, name, add_widgets=True)[source]

Add a new tab to the TabDocker

Arguments: widget - Widget to add name - Name of the widget

Return: None

assign_latest(idx)[source]
count()[source]

Return the number of tabs.

Arguments: None

Returns: Number of tabs

currentIndex()[source]

Get the current Index of the tab_widget.

Returns: Current index of self.tab_widget

enable_tab(visible)[source]

Enable or disable the tab.

Arguments: visible - Enable if True, Disable if False name - Name of the tab to disable.

Returns: None

indexOf(widget)[source]

Get the index of the widget.

Arguments: widget - Adress of the widget

Returns: Index of the widget

latest_active = [None]
order_tabs()[source]
removeTab(idx)[source]

Remove the widget located at tab idx

Arguments: idx - Idx of the widget

Returns: None

setCurrentIndex(idx)[source]

Set the current Index of the tab_widget.

Arguments: idx - Index to set

Returns: Current index of self.tab_widget

setCurrentWidget(widget)[source]

Set the current widget of the tab_widget.

Arguments: idx - Widget to set

Returns: Current index of self.tab_widget

setMovable(status)[source]

Set the movable status for the tab widgets

Arguments: status - Boolean variable for the status

Returns: None

setTabEnabled(index, state)[source]

Set the tab position index to the enable state.

Arguments: index - Tab position index state - State (True or False)

Returns: None

setTabPosition(position)[source]

Set the tab position of the Tab bar

Arguments: position - Tab position as string [‘North’, ‘East’, ‘West’, ‘South’]

Returns: None

setTabText(idx, text)[source]

Set the text for the tab at idx

Arguments: idx - Index of the tab text - Text of the tab

Returns: None

sig_start_plot
tabText(idx)[source]

Return the text of the tab at idx

Arguments: idx - Index of the tab

Returns: Text of the tab at position isx

widget(idx)[source]

Return the widget that belongs to the idx of tabs.

Arguments: idx - Tab index

Returns: Widget

transphire.templatedialog module

class transphire.templatedialog.TemplateDialog(settings_directory, add_remove=True, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

TemplateDialog dialog. Dialog used to enter the template.

Inherits from: QDialog

add_template()[source]
choose_template()[source]
copy_template()[source]
remove_template()[source]

transphire.transphire_class2d module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_class2d.create_class2d_command(class2d_name, stack_name, file_name, output_dir, settings, queue_com, name)[source]

Create the command to combine BDB stacks.

transphire.transphire_class2d.create_isac2_1_2_combine_command(class2d_name, file_names, file_name, output_dir, settings)[source]

Create e2bdb.py combine command

transphire.transphire_class2d.create_isac2_1_2_command(class2d_name, stack_name, file_name, output_dir, settings, name)[source]

Create e2bdb.py combine command

transphire.transphire_class2d.create_stack_combine_command(class2d_name, file_names, file_name, output_dir, settings, queue_com, name)[source]

Create the command to combine BDB stacks.

transphire.transphire_class2d.find_logfiles(root_path, settings, queue_com, name)[source]

Find logfiles related to the produced Extract files.

root_path - Root path of the file settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process

Returns: list of log files

Recursive file search function.

transphire.transphire_content module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_content.default_auto_sphire_v1_3()[source]

Content for auto sphire

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cinderella_v0_3_1()[source]

Content of cinderella v0.3.1

Arguments: None

Return: Content items as list

transphire.transphire_content.default_compress_command_line()[source]

Content for compression

Arguments: None

Return: Content items as list

transphire.transphire_content.default_copy(settings_folder)[source]

Content of Copy tab.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cryolo_train_v1_5_4()[source]

Content of crYOLO_train version 1.5.4

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cryolo_train_v1_5_8()[source]

Content of crYOLO_train version 1.5.8

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cryolo_train_v1_7_4()[source]

Content of crYOLO_train version 1.7.4

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cryolo_v1_0_4()[source]

Content of crYOLO version 1.0.4

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cryolo_v1_1_0()[source]

Content of crYOLO version 1.1.0

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cryolo_v1_2_1()[source]

Content of crYOLO version 1.2.1

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cryolo_v1_4_1()[source]

Content of crYOLO version 1.4.1

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cryolo_v1_5_8()[source]

Content of crYOLO version 1.5.8

Arguments: None

Return: Content items as list

transphire.transphire_content.default_cter_v1_0()[source]

Content of CTER SPHIRE version 1.0.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_ctffind_4_v4_1_8()[source]

Content of CTFFind version 4.1.8.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_font()[source]

Content of Font tab.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_gctf_v1_06()[source]

Content of GCtf version 1.06.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_gctf_v1_18()[source]

Content of GCtf version 1.18.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_general()[source]

Content of General tab.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_global()[source]
transphire.transphire_content.default_input()[source]

Content of General tab.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_isac2_1_2()[source]

Content of sp_isac2(gpu) version 1.2

Arguments: None

Return: Content items as list

transphire.transphire_content.default_motion_cor_2_v1_0_0()[source]

Content of MotionCor2 version 1.0.0.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_motion_cor_2_v1_0_5()[source]

Content of MotionCor2 version 1.0.5.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_motion_cor_2_v1_1_0()[source]

Content of MotionCor2 version 1.1.0.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_motion_cor_2_v1_3_0()[source]

Content of MotionCor2 version 1.3.0.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_mount(hdd=None)[source]

Content of Mount tab.

Arguments: hdd - Content is related to HDD

Return: Content items as list

transphire.transphire_content.default_notification()[source]

Content of notification tab.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_notification_widget()[source]

Content of notification widget.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_others(settings_folder)[source]

Content of Status tab.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_path()[source]

Content of Path tab.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_pipeline()[source]

Content of pipeline tab.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_unblur_v1_0_0()[source]

Content of Unblur version 1.0.0.

Arguments: None

Return: Content items as list

transphire.transphire_content.default_window_1_2()[source]

Content of sp_window version 1.2

Arguments: None

Return: Content items as list

transphire.transphire_ctf module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_ctf.combine_ctf_outputs(data, data_orig, root_path, file_name, settings, queue_com, shared_dict, name, sum_file, dw_file)[source]

Combine the ctf outputs to one SPHIRE partres and one RELION star file.

root_path - Root path of the file file_name - File name of the ctf file. settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process sum_file - Name of the dose uncorrected sum file

Returns: None

transphire.transphire_ctf.contrast_to_shift(a_cont)[source]

Transform amplitude contrast to phase shift.

a_cont - Amplitude contrast value in percent

Returns: Phase shift in degrees.

transphire.transphire_ctf.create_cter_1_0_command(ctf_name, file_sum, file_input, output_dir, settings)[source]

Create the CTER v1.0 command

transphire.transphire_ctf.create_cter_1_3_command(ctf_name, file_sum, file_input, output_dir, settings)[source]

Create the CTER v1.3 command

transphire.transphire_ctf.create_ctffind_4_v4_1_13_command(ctf_name, file_sum, file_input, file_output, set_name, settings)[source]

Create the ctffind command

transphire.transphire_ctf.create_ctffind_4_v4_1_8_command(ctf_name, file_sum, file_input, file_output, set_name, settings)[source]

Create the ctffind command

transphire.transphire_ctf.create_export_data(export_data, lines, maximum_string)[source]

Write export data to file.

export_data - Data to export. file_name - Name of the file to write to.

Returns: In place modificaion of lines

transphire.transphire_ctf.create_gctf_v1_06_command(ctf_name, file_sum, file_input, file_output, settings, name)[source]

Create the Gctf v1.06 command

transphire.transphire_ctf.find_logfiles(root_path, file_name, settings, queue_com, name)[source]

Find logfiles related to the produced CTF files.

root_path - Root path of the file file_name - File name of the ctf file. settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process

Returns: list of log files

transphire.transphire_ctf.get_constant_value(key, ctf_settings, row, project_folder, ctf_name, ctf_folder, pixel_size_adjust)[source]
transphire.transphire_ctf.get_ctf_command(file_sum, file_input, new_name, settings, queue_com, set_name, name)[source]

Create the ctf command based on the ctf software.

file_input - Input name of the file for ctf estimation new_name - Output file settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process

Returns: CTF command File to check vor validation if the process was successful

transphire.transphire_ctf.get_relion_header(names)[source]

Create a relion star file header.

names - Header names as list

Returns: header string

Recursive file search function.

transphire.transphire_ctf.shift_to_contrast(phase_shift)[source]

Convert phase shift to amplitud contrast.

phase_shift - Phase shift in degrees.

Returns: Amplitude contrast in percent.

transphire.transphire_ctf.to_partres_file(data, ctf_name, ctf_settings, project_folder, ctf_folder, sum_file, pixel_size_adjust)[source]

Create a CTF partres file from data

data - Array containing ctf information. ctf_name - Name of the ctf program. ctf_settings - Settings for this ctf estimation run. project_folder - Name of the project folder. ctf_folder - Name of the ctf output folder. sum_file - Name of the summed micrograph image

Returns: None

transphire.transphire_ctf.to_star_file(data, ctf_name, ctf_settings, project_folder, ctf_folder, sum_file, dw_file, pixel_size_adjust)[source]

Create a CTF star file from data

data - Array containing ctf information. ctf_name - Name of the ctf program. ctf_settings - Settings for this ctf estimation run. project_folder - Name of the project folder. ctf_folder - Name of the ctf output folder. sum_file - Name of the sum file

Returns: None

transphire.transphire_extract module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_extract.create_window_1_2_command(extract_name, file_sum, file_box, file_ctf, output_dir, settings)[source]

Create the WINDOW v1.2 command

transphire.transphire_extract.find_logfiles(root_path, settings, queue_com, name)[source]

Find logfiles related to the produced Extract files.

root_path - Root path of the file settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process

Returns: list of log files

transphire.transphire_extract.get_extract_command(file_sum, file_box, file_ctf, output_dir, settings, queue_com, name)[source]

Create the ctf command based on the ctf software.

file_input - Input name of the file for ctf estimation new_name - Output file settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process

Returns: CTF command File to check vor validation if the process was successful

transphire.transphire_extract.get_particle_number(log_file, settings, queue_com, name)[source]

Recursive file search function.

transphire.transphire_import module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_import.dummy(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]
transphire.transphire_import.get_dtype_dict()[source]

Dtype of the data plot array.

Arguments: None

Return: Dtype dict

transphire.transphire_import.get_dtype_import_dict()[source]

Dtype of the file to import.

Arguments: None

Return: Dtype dict

transphire.transphire_import.get_header(input_file)[source]

Extract header information from a relion star file.

Arguments: input_file - Input star file

Return: Color string

transphire.transphire_import.get_relion_dict()[source]

Translate relion star file information to dtype dict.

Arguments: None

Return: Dtype dict

transphire.transphire_import.get_transphire_dict()[source]

Translate transphire ctf dict into relion star file information.

Arguments: None

Return: Dtype dict

transphire.transphire_import.import_auto_sphire_v1_3(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]

Import motion information for auto_sphire.py version 1.3

Arguments: name - Name of motion program directory_name - Name of the directory to search for files

Return: Imported data

transphire.transphire_import.import_cinderella_v0_3_1(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]
transphire.transphire_import.import_cryolo_v1_0_4(name, name_no_feedback, settings, directory_name, import_name='', send_data=None, sub_directory=None)[source]

Import picking information for crYOLO v1.0.4.

Arguments: name - Name of picking program directory_name - Name of the directory to search for files

Return: Imported data

transphire.transphire_import.import_cryolo_v1_2_2(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]

Import picking information for crYOLO v1.2.2.

Arguments: name - Name of picking program directory_name - Name of the directory to search for files

Return: Imported data

transphire.transphire_import.import_cryolo_v1_8_0(name, name_no_feedback, settings, directory_name, import_name='', send_data=None, sub_directory=None)[source]

Import picking information for crYOLO v1.8.0.

Arguments: name - Name of picking program directory_name - Name of the directory to search for files

Return: Imported data

transphire.transphire_import.import_cter_v1_0(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]

Import ctf information for CTER v1.0. Defocus in angstrom, phase shift in degree.

Arguments: name - Name of ctf program directory_name - Name of the directory to search for files

Return: Imported data

transphire.transphire_import.import_ctffind_v4_1_8(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]

Import ctf information for CTFFIND v4.1.8. Defocus in angstrom, phase shift in degree.

Arguments: name - Name of ctf program directory_name - Name of the directory to search for files

Return: Imported data

transphire.transphire_import.import_gctf_v1_06(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]

Import ctf information for Gctf v1.06. Defocus in angstrom, phase shift in degree.

Arguments: name - Name of ctf program directory_name - Name of the directory to search for files

Return: Imported data

transphire.transphire_import.import_isac_v1_2(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]
transphire.transphire_import.import_motion_cor_2_v1_0_0(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]

Import motion information for MotionCor2 v1.0.0.

Arguments: name - Name of motion program directory_name - Name of the directory to search for files

Return: Imported data

transphire.transphire_import.import_unblur_v1_0_0(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]

Import motion information for cisTEM Unblur v1.0.0.

Arguments: name - Name of motion program directory_name - Name of the directory to search for files

Return: Imported data

transphire.transphire_import.import_window_v1_2(name, name_no_feedback, settings, directory_name, import_name='', send_data=None)[source]

transphire.transphire_motion module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_motion.combine_motion_outputs(data, data_original, settings, queue_com, shared_dict, name, log_file, sum_file, dw_file, stack_file, set_name)[source]

Combine the motion outputs to one micrograph and one relion star file.

root_path - Root path of the file file_name - File name of the ctf file. settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process sum_file - Name of the dose uncorrected sum file

Returns: None

transphire.transphire_motion.create_export_data(export_data, lines)[source]

Write export data to file.

export_data - Data to export. file_name - Name of the file to write to.

Returns: In place modificaion of lines

transphire.transphire_motion.create_motion_cor_2_v1_0_0_command(motion_name, file_input, file_output, file_log, settings, queue_com, name, set_name, do_subsum)[source]

Create the MotionCor2 v1.0.0 command

file_input - Input file for motion correction. file_output - Output filename file_log - Logfile name settings - TranSPHIRE settings. queue_com - Queue for communication. name - Name of the process.

Returns: Command for MotionCor2 v1.0.0

transphire.transphire_motion.create_sum_movie_command(motion_frames, file_input, file_output, file_shift, file_frc, settings, queue_com, name)[source]

Create the SumMovie command.

motion_frames - Sub frames settings dictionary file_input - File to sum. file_output - Output file name file_shift - Output shift file name file_frc - Output frc file name settings - TranSPHIRE settings queue_com - Queue for communication name - Name of the process

Returns: Command for SumMovie

transphire.transphire_motion.create_sum_movie_v1_0_2_command(motion_frames, file_input, file_output, file_shift, file_frc, settings, queue_com, name)[source]

Create the SumMovie v1.0.2 command.

motion_frames - Sub frames settings dictionary file_input - File to sum. file_output - Output file name file_shift - Output shift file name file_frc - Output frc file name settings - TranSPHIRE settings queue_com - Queue for communication name - Name of the process

Returns: Command for Summovie v1.0.2

transphire.transphire_motion.create_unblur_v1_0_0_command(motion_name, file_input, file_output, file_log, settings, queue_com, name, set_name, do_subsum)[source]

Create the SumMovie v1.0.2 command.

motion_frames - Sub frames settings dictionary file_input - File to sum. file_output - Output file name file_shift - Output shift file name file_frc - Output frc file name settings - TranSPHIRE settings queue_com - Queue for communication name - Name of the process

Returns: Command for Summovie v1.0.2

transphire.transphire_motion.get_dw_file_name(output_transfer_scratch, file_name, settings, queue_com, name)[source]

Get the name of the dose weighted file directly after the program finished.

output_transfer - Name of the folder in the scratch directory. file_name - File name of the root_name path. settings - TranSPHIRE settings. queue_com - Queue for communication. name - Name of the process.

Returns: File path of the DW file.

transphire.transphire_motion.get_dws_file_name(output_transfer_scratch, file_name, settings, queue_com, name)[source]

Get the name of the dose weighted file directly after the program finished.

output_transfer - Name of the folder in the scratch directory. file_name - File name of the root_name path. settings - TranSPHIRE settings. queue_com - Queue for communication. name - Name of the process.

Returns: File path of the DW file.

transphire.transphire_motion.get_motion_command(file_input, file_output_scratch, file_log_scratch, settings, queue_com, name, set_name, do_subsum)[source]

Get the command for the selected motion software.

file_input - Input file for motion correction. file_output_scratch - Output file name file_log_scratch - Logfile path on the scratch disc settings - TranSPHIRE settings. queue_com - Queue for communication. name - Name of the process.

Returns: Motion command

transphire.transphire_motion.get_motion_default(settings, motion_frames, queue_com, name)[source]

Set the default values for the motion correction software.

settings - TranSPHIRE settings. motion_frames - Sub frame settings. queue_com - Queue for communication. name - Name of the process.

Returns: True, if dose weighting will be applied.

transphire.transphire_motion.get_relion_header(names)[source]

Create a relion star file header.

names - Header names as list

Returns: header string

transphire.transphire_picking module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_picking.create_box(jpg_data, maskcenters, box_size)[source]
transphire.transphire_picking.create_circle(jpg_data, maskcenters, radius)[source]

Create a circle in a numpy array

Arguments: jpg_data - Data that needs to be changed maskcenters - center of mask radius - Radius of the circle

Returns: None, jpg_data will be changed in-place

transphire.transphire_picking.create_cryolo_v1_0_4_command(picking_name, file_input, file_output, settings, name)[source]

Create the crYOLO v1.0.4 command

transphire.transphire_picking.create_cryolo_v1_1_0_command(picking_name, file_input, file_output, settings, name)[source]

Create the crYOLO v1.1.0 command

transphire.transphire_picking.create_cryolo_v1_4_1_command(picking_name, file_input, file_output, settings, name)[source]

Create the crYOLO v1.1.0 command

transphire.transphire_picking.create_filter_command(file_input, settings)[source]
transphire.transphire_picking.find_logfiles(root_path, file_name, settings, queue_com, name)[source]

Find logfiles related to the produced CTF files.

root_path - Root path of the file file_name - File name of the ctf file. settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process

Returns: list of log files

transphire.transphire_picking.get_picking_command(file_input, new_name, settings, queue_com, name)[source]

Create the picking command based on the picking software.

file_input - Input name of the file for ctf estimation new_name - Output file settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process

Returns: Picking command File to check vor validation if the process was successful

transphire.transphire_plot module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_plot.dummy(data, settings, label)[source]
transphire.transphire_plot.get_mic_number(array, settings, as_int=True)[source]

Identify the micrograph number out of the name string.

Arguments: array - Array containing information settings - User provided settings

Return: Array of micrograph numbers

transphire.transphire_plot.update_batch(data, settings, label)[source]

Update the plot for crYOLO v1.0.4.

Arguments: data - Data to plot settings - User provided settings label - Label of the plot

Return: x values, y values, label, title

transphire.transphire_plot.update_cryolo_v1_0_4(data, settings, label)[source]

Update the plot for crYOLO v1.0.4.

Arguments: data - Data to plot settings - User provided settings label - Label of the plot

Return: x values, y values, label, title

transphire.transphire_plot.update_ctf(data, settings, label)[source]

Update the plot for CTFFIND v4.1.8.

Arguments: data - Data to plot settings - User provided settings label - Label of the plot

Return: x values, y values, label, title

transphire.transphire_plot.update_micrograph(data, settings, label)[source]

Update the plot for crYOLO v1.0.4.

Arguments: data - Data to plot settings - User provided settings label - Label of the plot

Return: x values, y values, label, title

transphire.transphire_plot.update_motion(data, settings, label)[source]

Update the plot for MotionCor2 v1.0.0.

Arguments: data - Data to plot settings - User provided settings label - Label of the plot

Return: x values, y values, label, title

transphire.transphire_select2d module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_select2d.create_cinderella_0_3_1_command(prog_name, file_input, file_output, settings, name)[source]

Create the Cinderella >=v0.3.1 command

transphire.transphire_select2d.find_logfiles(root_path, settings, queue_com, name)[source]
transphire.transphire_select2d.get_select2d_command(file_input, output_dir, settings, queue_com, name)[source]

Create the picking command based on the picking software.

file_input - Input name of the file for ctf estimation output_dir - Output file settings - TranSPHIRE settings queue_com - Queue for communication name - Name of process

Returns: Picking command File to check vor validation if the process was successful

transphire.transphire_software module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_software.check_for_outlier(dict_name, data, file_name, settings)[source]
transphire.transphire_software.check_nr_frames(frames, settings, force=False)[source]

Check if the nr of frames of the stack match the given nr of frames

Arguments: frames - List of found frames settings - TranSPHIRE settings

transphire.transphire_software.check_outputs(zero_list, non_zero_list, exists_list, folder, command)[source]

Check, if the output files are present and have the proper size.

zero_list - List of files that should be zero non_zero_list - List of files that should not be zero

Returns: None

transphire.transphire_software.extract_time_and_grid_information(root_name, settings, queue_com, name)[source]

Extract the time and grid information from the micrograph names.

Arguments: root_name - Name to extract information from. settings - TranSPHIRE settings. queue_com - Queue for communication. name - Name of the process.

Returns: hole_number, spot1_number, spot2_number, date, time

transphire.transphire_software.find_all_files(root_name, compare_name_frames, compare_name_meta, settings, queue_com, name)[source]

Find other files that relate to root_name.

root_name - Root name of files to find. compare_name_meta - Name of the meta data to find. queue_com - Queue for communication. name - Name of the process

Returns: list of files related to root_name.

transphire.transphire_software.find_frames(frames_root, compare_name, settings, queue_com, name, write_error)[source]

Find frames based on Software, Type and camera used.

frames_root - Root name of the frames. compare_name - Name to compare jpg and frames as time might differ. settings - TranSPHIRE settings used. queue_com - Queue for communication name - Name of process write_error - Write error function

Returns: None if the number of frames does not match user input. False if an error occured and the file needs to be skipped. True if the function was successful.

Find related frames to the jpg file based on the used software.

Arguments: frames_root - Root name to search for related files root_name - Root name of the jpg file settings - TranSPHIRE settings queue_com - Queue for communication name - Name of the process

transphire.transphire_software.get_copy_command_for_frames(settings, queue_com, name)[source]

Copy the frames based on stack or frames type.

settings - TranSPHIRE settings. queue_com - Queue for communication. name - Name of the process.

Returns: Command to use for copy.

transphire.transphire_software.get_logfiles(log_prefix)[source]

Return the names of the log_file and error file.

Arguments: log_prefix - Prefix to use.

Returns: Name of log file, Name of error file

transphire.transphire_software.get_x_dim(frames, settings)[source]

transphire.transphire_train2d module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

transphire.transphire_train2d.create_eval_command(config_file, weight_file, log_file, settings, name)[source]
transphire.transphire_train2d.create_restack_command(stack_name, output_dir, settings)[source]
transphire.transphire_train2d.create_substack_command(class_average_name, input_stack, isac_dir, output_dir, settings)[source]
transphire.transphire_train2d.create_train_command(sum_folder, box_folder, output_dir, name, settings)[source]

transphire.transphire_utils module

TranSPHIRE is supposed to help with the cryo-EM data collection Copyright (C) 2017 Markus Stabrin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class transphire.transphire_utils.DataFrame(manager, file_path)[source]

Bases: object

append_values(*args, **kwargs)[source]
get_df(*args, **kwargs)[source]
get_index_where(*args, **kwargs)[source]
get_values(*args, **kwargs)[source]
load_df(*args, **kwargs)[source]
save_df(*args, **kwargs)[source]
set_df(*args, **kwargs)[source]
set_values(*args, **kwargs)[source]
value_in_column(*args, **kwargs)[source]
transphire.transphire_utils.check_instance(value, typ)[source]

Check typ of value

Arguments: value - Value to check typ - Type to check

Return: Bool

transphire.transphire_utils.copy(file_in, file_out)[source]

Copy file_in to a new location.

Arguments: file_in - Input file file_out - Output file

Return: None

transphire.transphire_utils.copytree(root_src_dir, root_dst_dir)[source]
transphire.transphire_utils.create_log(*args)[source]

Add a time string to print statement.

args - Args to print

Returns: String with added time stemp.

transphire.transphire_utils.find_best_match(name, dictionary)[source]

Find the best matching version key in a dictionary. Raises an assertion error it the return_key is not valid.

name - Name of the current version. dictionary - Dictionary to find the best matching version.

Returns: The best matching version Key.

transphire.transphire_utils.find_latest_version(name, dictionary)[source]

Find the latest matching version key in a dictionary. Raises an assertion error it the return_key is not valid.

name - Name of the program dictionary - Dictionary to find the best matching version.

Returns: The best matching version Key.

transphire.transphire_utils.get_color(typ)[source]

Color defined for the type

Arguments: typ - Typ of color

Return: Color string

transphire.transphire_utils.get_content_gui(content, template_name, n_feedbacks)[source]

Create content lists to load the GUI.

Arguments: content - Content as dictionary. template_name = Name of the template!

Return: Content as list

transphire.transphire_utils.get_exclude_set_path(content)[source]

Check the widget_2 variable, if the program should be loaded or not.

Argument: content - Content as dictionary.

Return: List of names to exclude

transphire.transphire_utils.get_function_dict()[source]

Return a dictionary containing the function to use for specific plots.

Arguments: None

Return: None

transphire.transphire_utils.get_key_names(settings_folder, name)[source]

Extract mount names from related settings file.

Arguments: None

Return: List of mount names

transphire.transphire_utils.get_name(name)[source]

Remove the extension of a file and return the basename without the PATH

name - Name to remove the extension from

Returns: The name of the file without PATH and extension.

transphire.transphire_utils.get_style(typ)[source]

Style colores for the content of widgets.

Arguments: typ - Typ of color

Return: Color string

transphire.transphire_utils.get_unique_types()[source]
transphire.transphire_utils.is_higher_version(name, version_ref)[source]

Compare the versions of software. The versions do not need to match in digits. v1 > v0, v0.0, v0.0.0 v1 >= v1 v1 < v1.0.1

name - Name of the Software containing the version string, e.g. v1, v1.1, v1.1.1, v1.1.1rc2 version_ref - reference version as string, e.g. 1, 1.1, 1.1.1

Returns: True if the version is larger than the reference version

transphire.transphire_utils.look_and_feel(app, font=None, adjust_width=None, adjust_height=None, default=None)[source]

Look and feel.

Arguments: app - QApplication. font - User provided font size (default None) adjust_width - User provided width adjustment (default None) adjust_height - User provided height adjustment (default None) default - Default values (default None)

Return: Style sheet

transphire.transphire_utils.look_and_feel_small(app, font=None)[source]

Look and feel for the default settings dialog.

Arguments: app - QApplication. font - User provided font size (default None)

Return: Style sheet

transphire.transphire_utils.message(text)[source]

Show a text in a message box.

Arguments: text - Text shown in the message box

Return: None

transphire.transphire_utils.mkdir_p(path)[source]

Create output directories recursively.

Arguments: path - Directory path to create

Return: None

transphire.transphire_utils.normalize_image(data, apix=1.0, min_res=30, real=True)[source]
transphire.transphire_utils.question(head, text)[source]

Show a questions message box dialog.

Arguments: head - Header of the window text - Text with the questions

Return: True if No, False if Yes

transphire.transphire_utils.rebin(arr, new_shape)[source]
transphire.transphire_utils.reduce_copy_entries(exclude_set, content)[source]

Reduce the number of options based on the exclude_set

Arguments: exclude_set - Set of names to not consider content - Content of the widgets

Return: None

transphire.transphire_utils.reduce_path_widget(exclude_set, content)[source]

Reduce the number of paths based on the exclude_set

Arguments: exclude_set - Set of names to not consider content - Content of the widgets

Return: None

transphire.transphire_utils.reduce_programs(exclude_set=None)[source]

Reduce the number of programs to the users preferences.

Arguments: exclude_set - Set of names to not consider

Return: List of content for motion, List of content for ctf

transphire.transphire_utils.rerun_function_in_case_of_error(func)[source]
transphire.transphire_utils.split_maximum(text, max_char, split_char=None)[source]

Split text into chunks of size max_char containing whole words.

Arguments: text - Text to split max_char - Maximum number of characters

Returns: Splitted text

transphire.transphire_utils.thread_safe(func)[source]
transphire.transphire_utils.tooltip_style()[source]

Module contents