pKa/Design_pKa.py
def run_opt(defaults,new_instance=None,mutant_PDB_files={}):
    """
    Do post-processing of defaults and branch into correct routine
    """
    #
    # Did we get a new design instance?
    #
    global G_Design_instance
    if new_instance:
        G_Design_instance=None
    #
    # Reformat parameters first though...
    #
    params={}
    for key in defaults.keys():
        params[key]=defaults[key][0]
    #
    # Print setup, and ask if ok
    #
    name=print_setup(params)
    if params['calc_dpka'] and params['list_mutations']:
        print
        print 'You cannot specify both -calc_dpka and -list_mutations'
        print
        raise Exception()
    #
    # Start the design process
    #
    if not G_Design_instance:
        print 'Instantiating Design_pKa anew'
        G_Design_instance=Design_pKa(params)
    else:
        # If we have an instance then just copy parameters
        G_Design_instance.params=params.copy()
        G_Design_instance.parse_parameters()
    #
    # Make sure we use pre-modelled PDB files if available
    #
    G_Design_instance.mutfile_names=mutant_PDB_files
    try:
        if params['calc_dpka']:
            G_Design_instance.name=name
            
            results=G_Design_instance.calc_dpKa()
            dpKa_dict=None
        else:
            results,dpKa_dict=G_Design_instance.design(name)
    finally:
        G_Design_instance.pKa_info.update_data()
    #
    # Done
    #
    return results,dpKa_dict

    Do post-processing of defaults and branch into correct routine
    
Do post-processing of defaults and branch into correct routine
Do post - processing of defaults and branch into correct routine
def run_opt(defaults,new_instance=None,mutant_PDB_files={}):
     Did we get a new design instance?
    global G_Design_instance
    if new_instance:
        G_Design_instance=None
     Reformat parameters first though...
    params={}
    for key in defaults.keys():
        params[key]=defaults[key][0]
     Print setup, and ask if ok
    name=print_setup(params)
    if params['calc_dpka'] and params['list_mutations']:
        print
        print 'You cannot specify both -calc_dpka and -list_mutations'
        print
        raise Exception()
     Start the design process
    if not G_Design_instance:
        print 'Instantiating Design_pKa anew'
        G_Design_instance=Design_pKa(params)
    else:
         If we have an instance then just copy parameters
        G_Design_instance.params=params.copy()
        G_Design_instance.parse_parameters()
     Make sure we use pre-modelled PDB files if available
    G_Design_instance.mutfile_names=mutant_PDB_files
    try:
        if params['calc_dpka']:
            G_Design_instance.name=name
            results=G_Design_instance.calc_dpKa()
            dpKa_dict=None
        else:
            results,dpKa_dict=G_Design_instance.design(name)
    finally:
        G_Design_instance.pKa_info.update_data()
     Done
    return results,dpKa_dict
def run_opt ( defaults , new_instance = None , mutant_PDB_files = { } ) : global G_Design_instance if new_instance : G_Design_instance = None params = { } for key in defaults . keys ( ) : params [ key ] = defaults [ key ] [ 0 ] name = print_setup ( params ) if params [ 'calc_dpka' ] and params [ 'list_mutations' ] : print print 'You cannot specify both -calc_dpka and -list_mutations' print raise Exception ( ) if not G_Design_instance : print 'Instantiating Design_pKa anew' G_Design_instance = Design_pKa ( params ) else : G_Design_instance . params = params . copy ( ) G_Design_instance . parse_parameters ( ) G_Design_instance . mutfile_names = mutant_PDB_files try : if params [ 'calc_dpka' ] : G_Design_instance . name = name results = G_Design_instance . calc_dpKa ( ) dpKa_dict = None else : results , dpKa_dict = G_Design_instance . design ( name ) finally : G_Design_instance . pKa_info . update_data ( ) return results , dpKa_dict
Do post-processing of defaults and branch into correct routine
Do post - processing of defaults and branch into correct routine
"""
    Do post-processing of defaults and branch into correct routine
    """ # # Did we get a new design instance? # # # Reformat parameters first though... # # # Print setup, and ask if ok # # # Start the design process # # If we have an instance then just copy parameters # # Make sure we use pre-modelled PDB files if available # # # Done #
defaults
new_instance
mutant_PDB_files