pKaTool/get_CCPS_population.py
def _get_CCPS_population(options,args):
    """recalculate titration curves and get the pH-dependent population of select protonation states"""
    import pKaIO
    pdbfile=args[0]
    MCsteps=options.MCsteps
    pHstep=options.pHstep
    pHstart=options.pHstart
    pHend=options.pHstop
    IO=pKaIO.pKaIO(pdbfile)
    import pKa.pKa_MC 
    print 'Recalculating wild type titration curves'
    pKa_params={'pHstart':pHstart,'pHstop':pHend,'pHstep':pHstep,'pKMCsteps':MCsteps,'verbose':1}
    pKaCALC=pKa.pKa_MC.pKa_calculation_class(pdbfile,pKa_info=None,params=pKa_params)
    pKaCALC.set_MC_CPP()
    #
    #
    #
    groups=pKaCALC.MC.desolv.keys()
    groups.sort()
    if options.list_groups:
        print 'The PDB file contains these titratable groups:\n',groups
        return
    #
    # Set the protonation state
    #
    CCPS={}
    for spec in options.ccps:
        split=spec.split('=')
        group=split[0]
        charge=abs(int(split[1]))
        if CCPS.has_key(group):
            raise Exception('You cannot specify two protonation states for a single group: %s' %group)
        if not group in groups:
            raise Exception('Unknown group: %s' %group)
        CCPS[group]=charge
    #
    # Construct monitor_states        
    #
    monitor_states=[]
    for group in groups:
        if CCPS.has_key(group):
            monitor_states.append(CCPS[group])
        else:
            monitor_states.append(-99)
    #
    # Calculate the pKa values
    #
    print 'pHrange: step: %.2f start: %.2f, end: %.2f. MCsteps: %e ' %(pHstep,pHstart,pHend,MCsteps)
    wtpkas,titration_curves=pKaCALC.MC.calc_pKas(MCsteps,pHstep,pHstart,pHend,0,
        monitor_states=monitor_states)
    pHs=pKaCALC.MC.pH[:]
    CCPS=pKaCALC.MC.CCPS_pop[:]
    if options.show_plot:
        import matplotlib.pyplot as plt
        plt.plot(pHs,CCPS,'ro-',linewidth=2.0)
        plt.show()
    return pHs,CCPS
recalculate titration curves and get the pH-dependent population of select protonation states
recalculate titration curves and get the pH-dependent population of select protonation states
recalculate titration curves and get the pH - dependent population of select protonation states
def _get_CCPS_population(options,args):
    import pKaIO
    pdbfile=args[0]
    MCsteps=options.MCsteps
    pHstep=options.pHstep
    pHstart=options.pHstart
    pHend=options.pHstop
    IO=pKaIO.pKaIO(pdbfile)
    import pKa.pKa_MC 
    print 'Recalculating wild type titration curves'
    pKa_params={'pHstart':pHstart,'pHstop':pHend,'pHstep':pHstep,'pKMCsteps':MCsteps,'verbose':1}
    pKaCALC=pKa.pKa_MC.pKa_calculation_class(pdbfile,pKa_info=None,params=pKa_params)
    pKaCALC.set_MC_CPP()
    groups=pKaCALC.MC.desolv.keys()
    groups.sort()
    if options.list_groups:
        print 'The PDB file contains these titratable groups:\n',groups
        return
     Set the protonation state
    CCPS={}
    for spec in options.ccps:
        split=spec.split('=')
        group=split[0]
        charge=abs(int(split[1]))
        if CCPS.has_key(group):
            raise Exception('You cannot specify two protonation states for a single group: %s' %group)
        if not group in groups:
            raise Exception('Unknown group: %s' %group)
        CCPS[group]=charge
     Construct monitor_states        
    monitor_states=[]
    for group in groups:
        if CCPS.has_key(group):
            monitor_states.append(CCPS[group])
        else:
            monitor_states.append(-99)
     Calculate the pKa values
    print 'pHrange: step: %.2f start: %.2f, end: %.2f. MCsteps: %e ' %(pHstep,pHstart,pHend,MCsteps)
    wtpkas,titration_curves=pKaCALC.MC.calc_pKas(MCsteps,pHstep,pHstart,pHend,0,
        monitor_states=monitor_states)
    pHs=pKaCALC.MC.pH[:]
    CCPS=pKaCALC.MC.CCPS_pop[:]
    if options.show_plot:
        import matplotlib.pyplot as plt
        plt.plot(pHs,CCPS,'ro-',linewidth=2.0)
        plt.show()
    return pHs,CCPS
def _get_CCPS_population ( options , args ) : import pKaIO pdbfile = args [ 0 ] MCsteps = options . MCsteps pHstep = options . pHstep pHstart = options . pHstart pHend = options . pHstop IO = pKaIO . pKaIO ( pdbfile ) import pKa . pKa_MC print 'Recalculating wild type titration curves' pKa_params = { 'pHstart' : pHstart , 'pHstop' : pHend , 'pHstep' : pHstep , 'pKMCsteps' : MCsteps , 'verbose' : 1 } pKaCALC = pKa . pKa_MC . pKa_calculation_class ( pdbfile , pKa_info = None , params = pKa_params ) pKaCALC . set_MC_CPP ( ) groups = pKaCALC . MC . desolv . keys ( ) groups . sort ( ) if options . list_groups : print 'The PDB file contains these titratable groups:\n' , groups return CCPS = { } for spec in options . ccps : split = spec . split ( '=' ) group = split [ 0 ] charge = abs ( int ( split [ 1 ] ) ) if CCPS . has_key ( group ) : raise Exception ( 'You cannot specify two protonation states for a single group: %s' % group ) if not group in groups : raise Exception ( 'Unknown group: %s' % group ) CCPS [ group ] = charge monitor_states = [ ] for group in groups : if CCPS . has_key ( group ) : monitor_states . append ( CCPS [ group ] ) else : monitor_states . append ( - 99 ) print 'pHrange: step: %.2f start: %.2f, end: %.2f. MCsteps: %e ' % ( pHstep , pHstart , pHend , MCsteps ) wtpkas , titration_curves = pKaCALC . MC . calc_pKas ( MCsteps , pHstep , pHstart , pHend , 0 , monitor_states = monitor_states ) pHs = pKaCALC . MC . pH [ : ] CCPS = pKaCALC . MC . CCPS_pop [ : ] if options . show_plot : import matplotlib . pyplot as plt plt . plot ( pHs , CCPS , 'ro-' , linewidth = 2.0 ) plt . show ( ) return pHs , CCPS
recalculate titration curves and get the pH-dependent population of select protonation states
recalculate titration curves and get the pH - dependent population of select protonation states
"""recalculate titration curves and get the pH-dependent population of select protonation states""" # # # # # Set the protonation state # # # Construct monitor_states         # # # Calculate the pKa values #
options
args