"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gui/analyses/auto_model_free.py" between
relax-4.1.3.src.tar.bz2 and relax-5.0.0.src.tar.bz2

About: relax allows the study of molecular dynamics through the analysis of experimental NMR data. Organic molecules, proteins, RNA, DNA, sugars, and other biomolecules are all supported.

auto_model_free.py  (relax-4.1.3.src.tar.bz2):auto_model_free.py  (relax-5.0.0.src.tar.bz2)
############################################################################### ###############################################################################
# # # #
# Copyright (C) 2009-2010 Michael Bieri # # Copyright (C) 2009-2010 Michael Bieri #
# Copyright (C) 2009-2013,2015 Edward d'Auvergne # # Copyright (C) 2009-2013,2015,2019 Edward d'Auvergne #
# # # #
# This file is part of the program relax (http://www.nmr-relax.com). # # This file is part of the program relax (http://www.nmr-relax.com). #
# # # #
# This program is free software: you can redistribute it and/or modify # # 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 # # it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or # # the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. # # (at your option) any later version. #
# # # #
# This program is distributed in the hope that it will be useful, # # This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of # # but WITHOUT ANY WARRANTY; without even the implied warranty of #
skipping to change at line 34 skipping to change at line 34
"""Module for the automatic model-free protocol frame.""" """Module for the automatic model-free protocol frame."""
# Python module imports. # Python module imports.
from math import ceil from math import ceil
from os import sep from os import sep
import wx import wx
import wx.lib.buttons import wx.lib.buttons
import wx.lib.mixins.listctrl import wx.lib.mixins.listctrl
# relax module imports. # relax module imports.
import dep_check
from auto_analyses import dauvergne_protocol from auto_analyses import dauvergne_protocol
from data_store import Relax_data_store; ds = Relax_data_store() from data_store import Relax_data_store; ds = Relax_data_store()
from graphics import ANALYSIS_IMAGE_PATH, IMAGE_PATH, fetch_icon from graphics import ANALYSIS_IMAGE_PATH, IMAGE_PATH, fetch_icon
from gui.about import About_base from gui.about import About_base
from gui.analyses.base import Base_analysis from gui.analyses.base import Base_analysis
from gui.analyses.elements.spin_element import Spin_ctrl from gui.analyses.elements.spin_element import Spin_ctrl
from gui.analyses.elements.text_element import Text_ctrl from gui.analyses.elements.text_element import Text_ctrl
from gui.analyses.execute import Execute from gui.analyses.execute import Execute
from gui.analyses.elements.model_list import Model_list from gui.analyses.elements.model_list import Model_list
from gui.base_classes import Container from gui.base_classes import Container
skipping to change at line 287 skipping to change at line 288
""" """
# Sizer. # Sizer.
sizer = wx.BoxSizer(wx.HORIZONTAL) sizer = wx.BoxSizer(wx.HORIZONTAL)
# Dipole-dipole relaxation setup button. # Dipole-dipole relaxation setup button.
self.button_dipole_pair = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Dipolar relaxation") self.button_dipole_pair = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Dipolar relaxation")
self.button_dipole_pair.SetBitmapLabel(wx.Bitmap(fetch_icon("relax.dipol e_pair", "22x22"), wx.BITMAP_TYPE_ANY)) self.button_dipole_pair.SetBitmapLabel(wx.Bitmap(fetch_icon("relax.dipol e_pair", "22x22"), wx.BITMAP_TYPE_ANY))
self.button_dipole_pair.SetFont(font.normal) self.button_dipole_pair.SetFont(font.normal)
self.button_dipole_pair.SetSize((-1, 25)) self.button_dipole_pair.SetSize((-1, 25))
self.button_dipole_pair.SetToolTipString("Define the magnetic dipole-dip ole relaxation mechanism.") self.button_dipole_pair.SetToolTip(wx.ToolTip("Define the magnetic dipol e-dipole relaxation mechanism."))
self.gui.Bind(wx.EVT_BUTTON, self.setup_dipole_pair, self.button_dipole_ pair) self.gui.Bind(wx.EVT_BUTTON, self.setup_dipole_pair, self.button_dipole_ pair)
sizer.Add(self.button_dipole_pair, 1, wx.ALL|wx.EXPAND, 0) sizer.Add(self.button_dipole_pair, 1, wx.ALL|wx.EXPAND, 0)
# CSA button. # CSA button.
self.button_csa = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, Non e, " CSA relaxation") self.button_csa = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, Non e, " CSA relaxation")
self.button_csa.SetBitmapLabel(wx.Bitmap(fetch_icon("relax.align_tensor" , "22x22"), wx.BITMAP_TYPE_ANY)) self.button_csa.SetBitmapLabel(wx.Bitmap(fetch_icon("relax.align_tensor" , "22x22"), wx.BITMAP_TYPE_ANY))
self.button_csa.SetFont(font.normal) self.button_csa.SetFont(font.normal)
self.button_csa.SetSize((-1, 25)) self.button_csa.SetSize((-1, 25))
self.button_csa.SetToolTipString("Define the Chemical Shift Anisotropy ( CSA) relaxation mechanism via the value.set user function.") self.button_csa.SetToolTip(wx.ToolTip("Define the Chemical Shift Anisotr opy (CSA) relaxation mechanism via the value.set user function."))
self.gui.Bind(wx.EVT_BUTTON, self.value_set_csa, self.button_csa) self.gui.Bind(wx.EVT_BUTTON, self.value_set_csa, self.button_csa)
sizer.Add(self.button_csa, 1, wx.ALL|wx.EXPAND, 0) sizer.Add(self.button_csa, 1, wx.ALL|wx.EXPAND, 0)
# Isotope type button (heteronucleus). # Isotope type button (heteronucleus).
self.button_isotope_heteronuc = wx.lib.buttons.ThemedGenBitmapTextButton (self, -1, None, " X isotope") self.button_isotope_heteronuc = wx.lib.buttons.ThemedGenBitmapTextButton (self, -1, None, " X isotope")
self.button_isotope_heteronuc.SetBitmapLabel(wx.Bitmap(fetch_icon("relax .nuclear_symbol", "22x22"), wx.BITMAP_TYPE_ANY)) self.button_isotope_heteronuc.SetBitmapLabel(wx.Bitmap(fetch_icon("relax .nuclear_symbol", "22x22"), wx.BITMAP_TYPE_ANY))
self.button_isotope_heteronuc.SetFont(font.normal) self.button_isotope_heteronuc.SetFont(font.normal)
self.button_isotope_heteronuc.SetSize((-1, 25)) self.button_isotope_heteronuc.SetSize((-1, 25))
self.button_isotope_heteronuc.SetToolTipString("Set the nuclear isotope types of the heteronuclear spins via the spin.isotope user function.") self.button_isotope_heteronuc.SetToolTip(wx.ToolTip("Set the nuclear iso tope types of the heteronuclear spins via the spin.isotope user function."))
self.gui.Bind(wx.EVT_BUTTON, self.spin_isotope_heteronuc, self.button_is otope_heteronuc) self.gui.Bind(wx.EVT_BUTTON, self.spin_isotope_heteronuc, self.button_is otope_heteronuc)
sizer.Add(self.button_isotope_heteronuc, 1, wx.ALL|wx.EXPAND, 0) sizer.Add(self.button_isotope_heteronuc, 1, wx.ALL|wx.EXPAND, 0)
# Isotope type button (proton). # Isotope type button (proton).
self.button_isotope_proton = wx.lib.buttons.ThemedGenBitmapTextButton(se lf, -1, None, " H isotope") self.button_isotope_proton = wx.lib.buttons.ThemedGenBitmapTextButton(se lf, -1, None, " H isotope")
self.button_isotope_proton.SetBitmapLabel(wx.Bitmap(fetch_icon("relax.nu clear_symbol", "22x22"), wx.BITMAP_TYPE_ANY)) self.button_isotope_proton.SetBitmapLabel(wx.Bitmap(fetch_icon("relax.nu clear_symbol", "22x22"), wx.BITMAP_TYPE_ANY))
self.button_isotope_proton.SetFont(font.normal) self.button_isotope_proton.SetFont(font.normal)
self.button_isotope_proton.SetSize((-1, 25)) self.button_isotope_proton.SetSize((-1, 25))
self.button_isotope_proton.SetToolTipString("Set the nuclear isotope typ es of the proton spins via the spin.isotope user function.") self.button_isotope_proton.SetToolTip(wx.ToolTip("Set the nuclear isotop e types of the proton spins via the spin.isotope user function."))
self.gui.Bind(wx.EVT_BUTTON, self.spin_isotope_proton, self.button_isoto pe_proton) self.gui.Bind(wx.EVT_BUTTON, self.spin_isotope_proton, self.button_isoto pe_proton)
sizer.Add(self.button_isotope_proton, 1, wx.ALL|wx.EXPAND, 0) sizer.Add(self.button_isotope_proton, 1, wx.ALL|wx.EXPAND, 0)
# Add the element to the box. # Add the element to the box.
box.Add(sizer, 0, wx.ALL|wx.EXPAND, 0) box.Add(sizer, 0, wx.ALL|wx.EXPAND, 0)
def assemble_data(self): def assemble_data(self):
"""Assemble the data required for the auto-analysis. """Assemble the data required for the auto-analysis.
See the docstring for auto_analyses.dauvernge_protocol for details. All data is taken from the relax data store, so data upload from the GUI to there m ust have been previously performed. See the docstring for auto_analyses.dauvernge_protocol for details. All data is taken from the relax data store, so data upload from the GUI to there m ust have been previously performed.
skipping to change at line 469 skipping to change at line 470
# A spacer. # A spacer.
left_box.AddStretchSpacer() left_box.AddStretchSpacer()
# A button sizer, with some initial spacing. # A button sizer, with some initial spacing.
button_sizer = wx.BoxSizer(wx.HORIZONTAL) button_sizer = wx.BoxSizer(wx.HORIZONTAL)
# An about button. # An about button.
button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, "About ") button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, "About ")
button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.help-about', "22x22"), wx.BITMAP_TYPE_ANY)) button.SetBitmapLabel(wx.Bitmap(fetch_icon('oxygen.actions.help-about', "22x22"), wx.BITMAP_TYPE_ANY))
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetToolTipString("Information about this automatic analysis") button.SetToolTip(wx.ToolTip("Information about this automatic analysis" ))
# Bind the click. # Bind the click.
self.Bind(wx.EVT_BUTTON, self._about, button) self.Bind(wx.EVT_BUTTON, self._about, button)
# A cursor for the button. # A cursor for the button.
cursor = wx.StockCursor(wx.CURSOR_QUESTION_ARROW) if dep_check.wx_classic:
cursor = wx.StockCursor(wx.CURSOR_QUESTION_ARROW)
else:
cursor = wx.Cursor(wx.CURSOR_QUESTION_ARROW)
button.SetCursor(cursor) button.SetCursor(cursor)
# Pack the button. # Pack the button.
button_sizer.Add(button, 0, 0, 0) button_sizer.Add(button, 0, 0, 0)
left_box.Add(button_sizer, 0, wx.ALL, 0) left_box.Add(button_sizer, 0, wx.ALL, 0)
# Return the packed box. # Return the packed box.
return left_box return left_box
def build_right_box(self): def build_right_box(self):
skipping to change at line 967 skipping to change at line 971
title = wx.StaticText(self, -1, "Fully automated") title = wx.StaticText(self, -1, "Fully automated")
title.SetFont(font.subtitle) title.SetFont(font.subtitle)
sub_sizer.Add(title, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0) sub_sizer.Add(title, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0)
# Spacing. # Spacing.
sub_sizer.AddStretchSpacer() sub_sizer.AddStretchSpacer()
# The button. # The button.
button = wx.BitmapButton(self, -1, wx.Bitmap(fetch_icon('oxygen.actions. go-bottom', "48x48"), wx.BITMAP_TYPE_ANY)) button = wx.BitmapButton(self, -1, wx.Bitmap(fetch_icon('oxygen.actions. go-bottom', "48x48"), wx.BITMAP_TYPE_ANY))
button.SetMinSize((80, 80)) button.SetMinSize((80, 80))
button.SetToolTipString("Perform a fully automated analysis, looping ove r global models I to V and terminating with the final run. Please click on the 'About' button for more information.") button.SetToolTip(wx.ToolTip("Perform a fully automated analysis, loopin g over global models I to V and terminating with the final run. Please click on the 'About' button for more information."))
sub_sizer.Add(button, 3, wx.EXPAND, 0) sub_sizer.Add(button, 3, wx.EXPAND, 0)
self.Bind(wx.EVT_BUTTON, self.select_full_analysis, button) self.Bind(wx.EVT_BUTTON, self.select_full_analysis, button)
# Spacing. # Spacing.
sub_sizer.AddStretchSpacer() sub_sizer.AddStretchSpacer()
# Add the sub-sizer. # Add the sub-sizer.
sizer.Add(sub_sizer, 1, wx.ALL|wx.EXPAND, 0) sizer.Add(sub_sizer, 1, wx.ALL|wx.EXPAND, 0)
def build_manual(self, sizer): def build_manual(self, sizer):
skipping to change at line 997 skipping to change at line 1001
# The title. # The title.
title = wx.StaticText(self, -1, "Manual modes") title = wx.StaticText(self, -1, "Manual modes")
title.SetFont(font.subtitle) title.SetFont(font.subtitle)
sub_sizer.Add(title, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0) sub_sizer.Add(title, 0, wx.ALIGN_CENTRE_HORIZONTAL, 0)
# Spacing. # Spacing.
sub_sizer.AddSpacer(10) sub_sizer.AddSpacer(10)
# The local_tm button. # The local_tm button.
button = wx.Button(self, -1, "Local %s" % tm) button = wx.Button(self, -1, "Local %s" % tm)
button.SetToolTipString("Optimise global model I, the %s models. Please click on the 'About' button for more information." % local_tm) button.SetToolTip(wx.ToolTip("Optimise global model I, the %s models. P lease click on the 'About' button for more information." % local_tm))
button.SetFont(font.normal) button.SetFont(font.normal)
sub_sizer.Add(button, 1, wx.EXPAND, 0) sub_sizer.Add(button, 1, wx.EXPAND, 0)
self.Bind(wx.EVT_BUTTON, self.select_local_tm, button) self.Bind(wx.EVT_BUTTON, self.select_local_tm, button)
# The sphere button. # The sphere button.
button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, str_to _gui(" Sphere")) button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, str_to _gui(" Sphere"))
button.SetBitmapLabel(wx.Bitmap(IMAGE_PATH+'sphere.png', wx.BITMAP_TYPE_ ANY)) button.SetBitmapLabel(wx.Bitmap(IMAGE_PATH+'sphere.png', wx.BITMAP_TYPE_ ANY))
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetToolTipString("Optimise global model II, the spherical diffusi on model. Please click on the 'About' button for more information.") button.SetToolTip(wx.ToolTip("Optimise global model II, the spherical di ffusion model. Please click on the 'About' button for more information."))
sub_sizer.Add(button, 1, wx.EXPAND, 0) sub_sizer.Add(button, 1, wx.EXPAND, 0)
self.Bind(wx.EVT_BUTTON, self.select_sphere, button) self.Bind(wx.EVT_BUTTON, self.select_sphere, button)
# The prolate spheroid button. # The prolate spheroid button.
button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, str_to _gui(" Prolate spheroid")) button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, str_to _gui(" Prolate spheroid"))
button.SetBitmapLabel(wx.Bitmap(IMAGE_PATH+'prolate.png', wx.BITMAP_TYPE _ANY)) button.SetBitmapLabel(wx.Bitmap(IMAGE_PATH+'prolate.png', wx.BITMAP_TYPE _ANY))
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetToolTipString("Optimise global model III, the prolate spheroid diffusion model. Please click on the 'About' button for more information.") button.SetToolTip(wx.ToolTip("Optimise global model III, the prolate sph eroid diffusion model. Please click on the 'About' button for more information. "))
sub_sizer.Add(button, 1, wx.EXPAND, 0) sub_sizer.Add(button, 1, wx.EXPAND, 0)
self.Bind(wx.EVT_BUTTON, self.select_prolate, button) self.Bind(wx.EVT_BUTTON, self.select_prolate, button)
# The oblate spheroid button. # The oblate spheroid button.
button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, str_to _gui(" Oblate spheroid")) button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, str_to _gui(" Oblate spheroid"))
button.SetBitmapLabel(wx.Bitmap(IMAGE_PATH+'oblate.png', wx.BITMAP_TYPE_ ANY)) button.SetBitmapLabel(wx.Bitmap(IMAGE_PATH+'oblate.png', wx.BITMAP_TYPE_ ANY))
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetToolTipString("Optimise global model IV, the oblate spheroid d iffusion model. Please click on the 'About' button for more information.") button.SetToolTip(wx.ToolTip("Optimise global model IV, the oblate spher oid diffusion model. Please click on the 'About' button for more information.") )
sub_sizer.Add(button, 1, wx.EXPAND, 0) sub_sizer.Add(button, 1, wx.EXPAND, 0)
self.Bind(wx.EVT_BUTTON, self.select_oblate, button) self.Bind(wx.EVT_BUTTON, self.select_oblate, button)
# The ellipsoid button. # The ellipsoid button.
button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, str_to _gui(" Ellipsoid")) button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, str_to _gui(" Ellipsoid"))
button.SetBitmapLabel(wx.Bitmap(IMAGE_PATH+'ellipsoid.png', wx.BITMAP_TY PE_ANY)) button.SetBitmapLabel(wx.Bitmap(IMAGE_PATH+'ellipsoid.png', wx.BITMAP_TY PE_ANY))
button.SetFont(font.normal) button.SetFont(font.normal)
button.SetToolTipString("Optimise global model V, the ellipsoid diffusio n model. Please click on the 'About' button for more information.") button.SetToolTip(wx.ToolTip("Optimise global model V, the ellipsoid dif fusion model. Please click on the 'About' button for more information."))
sub_sizer.Add(button, 1, wx.EXPAND, 0) sub_sizer.Add(button, 1, wx.EXPAND, 0)
self.Bind(wx.EVT_BUTTON, self.select_ellipsoid, button) self.Bind(wx.EVT_BUTTON, self.select_ellipsoid, button)
# The final button. # The final button.
button = wx.Button(self, -1, str_to_gui("Final")) button = wx.Button(self, -1, str_to_gui("Final"))
button.SetToolTipString("The final run of the protocol. Please click on the 'About' button for more information.") button.SetToolTip(wx.ToolTip("The final run of the protocol. Please cli ck on the 'About' button for more information."))
button.SetFont(font.normal) button.SetFont(font.normal)
sub_sizer.Add(button, 1, wx.EXPAND, 0) sub_sizer.Add(button, 1, wx.EXPAND, 0)
self.Bind(wx.EVT_BUTTON, self.select_final, button) self.Bind(wx.EVT_BUTTON, self.select_final, button)
# Add the sub-sizer. # Add the sub-sizer.
sizer.Add(sub_sizer, 1, wx.ALL|wx.EXPAND, 0) sizer.Add(sub_sizer, 1, wx.ALL|wx.EXPAND, 0)
def select_ellipsoid(self, event=None): def select_ellipsoid(self, event=None):
"""The ellipsoid global model has been selected. """The ellipsoid global model has been selected.
 End of changes. 15 change blocks. 
14 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)