pKaTool/pKa_system_help.py
def calc_decomposition(self):
        """Run the insystem and exsystem decomposition energies"""

        #
        # Store a copy of the wild type state
        #
        self.WT=self.update_pkasystem_curves()
        self.wt_state=self.pack_configuration()
        #
        # Start looping over all groups
        #
        num_groups=len(self.groups.keys())
        self.tot_perms=2*num_groups+num_groups*(num_groups-1)
        #
        self.curv_diffs=[]
        self.counter=0
        self.in_system={}
        self.ex_system={}
        groups=self.groups.keys()
        groups.sort()
        for monitor_group in groups:
            #
            # Make sure we get the correct titration curve difference
            #
            self.monitor={}
            for group in groups:
                self.monitor[group]=IntVar()
                self.monitor[group].set(0)
                if group==monitor_group:
                    self.monitor[group].set(1)
            #
            # Swith off all other groups
            #
            # Restore the wt state
            for group_t in groups:
                self.groups[group_t].active.set(1)
            #
            for group2 in groups:
                if monitor_group!=group2:
                    self.groups[group2].active.set(0)
            alone_tit=self.update_pkasystem_curves(doit=1)
            #
            # Prepare the dictionaries
            #
            if not self.in_system.has_key(monitor_group):
                self.in_system[monitor_group]={}
            if not self.ex_system.has_key(monitor_group):
                self.ex_system[monitor_group]={}
            #
            # Loop over the second groups for getting the ex_system titrations
            #
            for group_off in groups:
                if group_off!=monitor_group:
                    #
                    # Turn on this group
                    #
                    self.groups[group_off].active.set(1)
                    #
                    # Get the difference between the isolated titration curve
                    # and the system consisting of only two groups
                    #
                    ex_sys_diff=-self.measure_change(alone_tit,absolut=None)
                    self.ex_system[monitor_group][group_off]=ex_sys_diff
                    #
                    # Turn the group off again
                    #
                    self.groups[group_off].active.set(0)
            #
            # Go on to calculating the in_system energies
            #
            # Restore the wt state
            for group_t in groups:
                self.groups[group_t].active.set(1)
            #
            for group_off in groups:
                if group_off!=monitor_group:
                    #
                    # Turn off one group
                    #
                    self.groups[group_off].active.set(0)
                    diff=self.measure_change(absolut=None)
                    self.in_system[monitor_group][group_off]=diff
                    #
                    # Turn the group back on
                    #
                    self.groups[group_off].active.set(1)
        #
        # Get the wild type state back
        #
        # Restore the wt state
        for group_t in groups:
            self.groups[group_t].active.set(1)
        return
Run the insystem and exsystem decomposition energies
Run the insystem and exsystem decomposition energies
Run the insystem and exsystem decomposition energies
def calc_decomposition(self):
         Store a copy of the wild type state
        self.WT=self.update_pkasystem_curves()
        self.wt_state=self.pack_configuration()
         Start looping over all groups
        num_groups=len(self.groups.keys())
        self.tot_perms=2*num_groups+num_groups*(num_groups-1)
        self.curv_diffs=[]
        self.counter=0
        self.in_system={}
        self.ex_system={}
        groups=self.groups.keys()
        groups.sort()
        for monitor_group in groups:
             Make sure we get the correct titration curve difference
            self.monitor={}
            for group in groups:
                self.monitor[group]=IntVar()
                self.monitor[group].set(0)
                if group==monitor_group:
                    self.monitor[group].set(1)
             Swith off all other groups
             Restore the wt state
            for group_t in groups:
                self.groups[group_t].active.set(1)
            for group2 in groups:
                if monitor_group!=group2:
                    self.groups[group2].active.set(0)
            alone_tit=self.update_pkasystem_curves(doit=1)
             Prepare the dictionaries
            if not self.in_system.has_key(monitor_group):
                self.in_system[monitor_group]={}
            if not self.ex_system.has_key(monitor_group):
                self.ex_system[monitor_group]={}
             Loop over the second groups for getting the ex_system titrations
            for group_off in groups:
                if group_off!=monitor_group:
                     Turn on this group
                    self.groups[group_off].active.set(1)
                     Get the difference between the isolated titration curve
                     and the system consisting of only two groups
                    ex_sys_diff=-self.measure_change(alone_tit,absolut=None)
                    self.ex_system[monitor_group][group_off]=ex_sys_diff
                     Turn the group off again
                    self.groups[group_off].active.set(0)
             Go on to calculating the in_system energies
             Restore the wt state
            for group_t in groups:
                self.groups[group_t].active.set(1)
            for group_off in groups:
                if group_off!=monitor_group:
                     Turn off one group
                    self.groups[group_off].active.set(0)
                    diff=self.measure_change(absolut=None)
                    self.in_system[monitor_group][group_off]=diff
                     Turn the group back on
                    self.groups[group_off].active.set(1)
         Get the wild type state back
         Restore the wt state
        for group_t in groups:
            self.groups[group_t].active.set(1)
        return
def calc_decomposition ( self ) : self . WT = self . update_pkasystem_curves ( ) self . wt_state = self . pack_configuration ( ) num_groups = len ( self . groups . keys ( ) ) self . tot_perms = 2 * num_groups + num_groups * ( num_groups - 1 ) self . curv_diffs = [ ] self . counter = 0 self . in_system = { } self . ex_system = { } groups = self . groups . keys ( ) groups . sort ( ) for monitor_group in groups : self . monitor = { } for group in groups : self . monitor [ group ] = IntVar ( ) self . monitor [ group ] . set ( 0 ) if group == monitor_group : self . monitor [ group ] . set ( 1 ) for group_t in groups : self . groups [ group_t ] . active . set ( 1 ) for group2 in groups : if monitor_group != group2 : self . groups [ group2 ] . active . set ( 0 ) alone_tit = self . update_pkasystem_curves ( doit = 1 ) if not self . in_system . has_key ( monitor_group ) : self . in_system [ monitor_group ] = { } if not self . ex_system . has_key ( monitor_group ) : self . ex_system [ monitor_group ] = { } for group_off in groups : if group_off != monitor_group : self . groups [ group_off ] . active . set ( 1 ) ex_sys_diff = - self . measure_change ( alone_tit , absolut = None ) self . ex_system [ monitor_group ] [ group_off ] = ex_sys_diff self . groups [ group_off ] . active . set ( 0 ) for group_t in groups : self . groups [ group_t ] . active . set ( 1 ) for group_off in groups : if group_off != monitor_group : self . groups [ group_off ] . active . set ( 0 ) diff = self . measure_change ( absolut = None ) self . in_system [ monitor_group ] [ group_off ] = diff self . groups [ group_off ] . active . set ( 1 ) for group_t in groups : self . groups [ group_t ] . active . set ( 1 ) return
Run the insystem and exsystem decomposition energies
Run the insystem and exsystem decomposition energies
"""Run the insystem and exsystem decomposition energies""" # # Store a copy of the wild type state # # # Start looping over all groups # # # # Make sure we get the correct titration curve difference # # # Swith off all other groups # # Restore the wt state # # # Prepare the dictionaries # # # Loop over the second groups for getting the ex_system titrations # # # Turn on this group # # # Get the difference between the isolated titration curve # and the system consisting of only two groups # # # Turn the group off again # # # Go on to calculating the in_system energies # # Restore the wt state # # # Turn off one group # # # Turn the group back on # # # Get the wild type state back # # Restore the wt state
self