Example #1
0
def plotit(xs,ys,title,legends):
    #
    # Do it 
    #
    num_points=0
    for x in xs:
        num_points=num_points+len(x)
    print num_points,'data points'
    #x=[1,2,3,4,5,6,7,8,9]
    #y=[2,4,6,8,10,12,14,16,18]
    mat_fix=[]
    vec_fix=[]
    for x in xs:
        for point in x:
            mat_fix.append([point,1.0])
    for y in ys:
        for point in y:
            vec_fix.append(point)
    import LinearAlgebra
    sols,rsq,rank,junk=LinearAlgebra.linear_least_squares(Numeric.array(mat_fix),
                                                          Numeric.array(vec_fix))
    slope=sols[0]
    intercept=sols[1]
    print rsq
    rsq=float(rsq[0])
    print 'Slope: %.2f, Intercept: %.2f, R^2: %.2f' %(slope,intercept,rsq)
    file=dislin_driver.graf_mult3(xs,ys,title,'Simple E','PBE_ene',legends)
    return
        dists.append(dist)
        epses_all.append(epses)
        epses_dpKa_all.append(epses_dpKa)
        print nummuts
        muts=muts+nummuts
        #
        # Now for multiple mutations
        #
        #x,y=analyse_one_pdbfile(filename,'/home/nielsen/pKa-design/done_distnummuts/bigdict')
        #xs_mult.append(x)
        #ys_mult.append(y)
    #
    # Plot real effective eps
    #
    import dislin_driver
    filename=dislin_driver.graf_mult3(xs=epses_dpKa_all,ys=epses_all,title='Effective dielectric constant for single mutations',legends=names,x_legend='distance (A)',y_legend='Effective dielectric constant')
    #
    # Plot it
    #
    count=0
    for x in xs_single:
        count=count+len(x)

    print 'Number of delta pKa values',count
    stop
    import dislin_driver
    #filename=dislin_driver.graf_mult3(xs=xs_single,ys=ys_single,title='pKa shifts for single mutations',legends=names,x_legend='dpKa (dphi/ln10)',y_legend='dpKa')
    #
    # Plot dpKa vs distance
    #
    filename=dislin_driver.graf_mult3(xs=dists,ys=ys_single,title='Distance dependence of dpKas',
        print nummuts
        muts = muts + nummuts
        #
        # Now for multiple mutations
        #
        #x,y=analyse_one_pdbfile(filename,'/home/nielsen/pKa-design/done_distnummuts/bigdict')
        #xs_mult.append(x)
        #ys_mult.append(y)
    #
    # Plot real effective eps
    #
    import dislin_driver
    filename = dislin_driver.graf_mult3(
        xs=epses_dpKa_all,
        ys=epses_all,
        title='Effective dielectric constant for single mutations',
        legends=names,
        x_legend='distance (A)',
        y_legend='Effective dielectric constant')
    #
    # Plot it
    #
    count = 0
    for x in xs_single:
        count = count + len(x)

    print 'Number of delta pKa values', count
    stop
    import dislin_driver
    #filename=dislin_driver.graf_mult3(xs=xs_single,ys=ys_single,title='pKa shifts for single mutations',legends=names,x_legend='dpKa (dphi/ln10)',y_legend='dpKa')
    #