Ghost/make_figs_helper.py
def cubescanplot(options):
    """Read a cubescan output file and show the results"""
    fd=open(options.cubescanfile)
    import pickle
    data=pickle.load(fd)
    fd.close()
    #
    cubegrid=data[0]
    scanresults=data[1]
    #
    # Instantiate scoring class
    #
    SC=score_class(options)
    #
    # Score the ghosts from each cubescan
    #
    scores=[]
    for cube in sorted(scanresults.keys()):
        calc_ghosts=scanresults[cube]
        xs,ys,experrors,satisfied=SC.score_ghosts(calc_ghosts)
        rmsd=RMSD(xs,ys,experrors)
        scores.append([rmsd,cube])
        #import pylab
        #pylab.errorbar(xs,ys,xerr=experrors,fmt='ro')
        #pylab.plot(xs,xs,'g-')
        #pylab.xlabel('Experimental dCS')
        #pylab.ylabel('Calculated dCS')
        #pylab.title('Cubescan of cube %4d, atom: %s, RMSD: %5.3f' %(cube,options.atom,rmsd))
        #pylab.savefig('Cubescan_%d.png' %(cube))
        #pylab.clf()
    rmsds=[]
    scores.sort()
    import Protool
    P=Protool.structureIO()
    P.readpdb('2LZT_H.pdb')
    count=0
    for rmsd,cube in scores[:25]:
        print '%4d, rmsd: %5.2f' %(cube,rmsd)
        center=cubegrid[cube]['coord']
        P.add_atom('X:%4d:CS' %(count+1000),
                 atomnumber=0,atomname='CS',
                 chainid='X',residuename='CSS',residuenumber='999',
                 xcoord=center[0],ycoord=center[1],zcoord=center[2],update=1,BFACTOR=None,OCCUPANCY=None,CHARGE=None,RADIUS=None,tag=None,accept_duplicate=False)
        count=count+1
        rmsds.append(rmsd)
    P.writepdb('cubescan.pdb')
    import pylab
    pylab.hist(rmsds)
    pylab.savefig('Cubescanhist.png')
    return
Read a cubescan output file and show the results
Read a cubescan output file and show the results
Read a cubescan output file and show the results
def cubescanplot(options):
    fd=open(options.cubescanfile)
    import pickle
    data=pickle.load(fd)
    fd.close()
    cubegrid=data[0]
    scanresults=data[1]
     Instantiate scoring class
    SC=score_class(options)
     Score the ghosts from each cubescan
    scores=[]
    for cube in sorted(scanresults.keys()):
        calc_ghosts=scanresults[cube]
        xs,ys,experrors,satisfied=SC.score_ghosts(calc_ghosts)
        rmsd=RMSD(xs,ys,experrors)
        scores.append([rmsd,cube])
        import pylab
        pylab.errorbar(xs,ys,xerr=experrors,fmt='ro')
        pylab.plot(xs,xs,'g-')
        pylab.xlabel('Experimental dCS')
        pylab.ylabel('Calculated dCS')
        pylab.title('Cubescan of cube %4d, atom: %s, RMSD: %5.3f' %(cube,options.atom,rmsd))
        pylab.savefig('Cubescan_%d.png' %(cube))
        pylab.clf()
    rmsds=[]
    scores.sort()
    import Protool
    P=Protool.structureIO()
    P.readpdb('2LZT_H.pdb')
    count=0
    for rmsd,cube in scores[:25]:
        print '%4d, rmsd: %5.2f' %(cube,rmsd)
        center=cubegrid[cube]['coord']
        P.add_atom('X:%4d:CS' %(count+1000),
                 atomnumber=0,atomname='CS',
                 chainid='X',residuename='CSS',residuenumber='999',
                 xcoord=center[0],ycoord=center[1],zcoord=center[2],update=1,BFACTOR=None,OCCUPANCY=None,CHARGE=None,RADIUS=None,tag=None,accept_duplicate=False)
        count=count+1
        rmsds.append(rmsd)
    P.writepdb('cubescan.pdb')
    import pylab
    pylab.hist(rmsds)
    pylab.savefig('Cubescanhist.png')
    return
def cubescanplot ( options ) : fd = open ( options . cubescanfile ) import pickle data = pickle . load ( fd ) fd . close ( ) cubegrid = data [ 0 ] scanresults = data [ 1 ] SC = score_class ( options ) scores = [ ] for cube in sorted ( scanresults . keys ( ) ) : calc_ghosts = scanresults [ cube ] xs , ys , experrors , satisfied = SC . score_ghosts ( calc_ghosts ) rmsd = RMSD ( xs , ys , experrors ) scores . append ( [ rmsd , cube ] ) rmsds = [ ] scores . sort ( ) import Protool P = Protool . structureIO ( ) P . readpdb ( '2LZT_H.pdb' ) count = 0 for rmsd , cube in scores [ : 25 ] : print '%4d, rmsd: %5.2f' % ( cube , rmsd ) center = cubegrid [ cube ] [ 'coord' ] P . add_atom ( 'X:%4d:CS' % ( count + 1000 ) , atomnumber = 0 , atomname = 'CS' , chainid = 'X' , residuename = 'CSS' , residuenumber = '999' , xcoord = center [ 0 ] , ycoord = center [ 1 ] , zcoord = center [ 2 ] , update = 1 , BFACTOR = None , OCCUPANCY = None , CHARGE = None , RADIUS = None , tag = None , accept_duplicate = False ) count = count + 1 rmsds . append ( rmsd ) P . writepdb ( 'cubescan.pdb' ) import pylab pylab . hist ( rmsds ) pylab . savefig ( 'Cubescanhist.png' ) return
Read a cubescan output file and show the results
Read a cubescan output file and show the results
"""Read a cubescan output file and show the results""" # # # Instantiate scoring class # # # Score the ghosts from each cubescan # #import pylab #pylab.errorbar(xs,ys,xerr=experrors,fmt='ro') #pylab.plot(xs,xs,'g-') #pylab.xlabel('Experimental dCS') #pylab.ylabel('Calculated dCS') #pylab.title('Cubescan of cube %4d, atom: %s, RMSD: %5.3f' %(cube,options.atom,rmsd)) #pylab.savefig('Cubescan_%d.png' %(cube)) #pylab.clf()
options