Ghost/make_figs.py
def yasaraplot():
    """Make a plot of all ghosts on the structure"""
    ghosts=getdata()
    #
    rescolor={}
    tgcount=0
    tgcolstep=360.0/len(ghosts.keys())
    print 'tgcolstep: %5.2f' %tgcolstep
    #
    colors=[240,0,60,120,180,300,1030,1150]
    del ghosts[':0048:ASP']
    del ghosts[':0066:ASP']
    for tg in sorted(ghosts.keys()):
        for residue in ghosts[tg].keys():
            if not rescolor.has_key(residue):
                rescolor[residue]={}
            for atom in ['N','H']:
                if ghosts[tg][residue].has_key(atom):
                    if ghosts[tg][residue][atom]!='absent':
                        if not rescolor[residue].has_key(atom):
                            rescolor[residue][atom]=[colors[tgcount]]
                        else:
                            rescolor[residue][atom].append(colors[tgcount])
        print tg, colors[tgcount]
        tgcount=tgcount+1
    #
    import Yasara_handler
    Y=Yasara_handler.yasara_handler()
    obj=Y.load_mol('2LZT.pdb')[0]
    for plot in ['N','H']:
        for residue in sorted(rescolor.keys()):
            resnum=int(residue[1:])
            if rescolor[residue].has_key(plot):
                #if len(rescolor[residue][plot])==1:
                
                color=sum(rescolor[residue][plot])/len(rescolor[residue][plot])
                print resnum,rescolor[residue][plot],color
                #else:  
                #    color=1270
            else: 
                color=1059
            Y.yasara.ColorRes('%d' %(resnum),'%d' %color)
        raw_input('is this ok?')
    return
Make a plot of all ghosts on the structure
Make a plot of all ghosts on the structure
Make a plot of all ghosts on the structure
def yasaraplot():
    ghosts=getdata()
    rescolor={}
    tgcount=0
    tgcolstep=360.0/len(ghosts.keys())
    print 'tgcolstep: %5.2f' %tgcolstep
    colors=[240,0,60,120,180,300,1030,1150]
    del ghosts[':0048:ASP']
    del ghosts[':0066:ASP']
    for tg in sorted(ghosts.keys()):
        for residue in ghosts[tg].keys():
            if not rescolor.has_key(residue):
                rescolor[residue]={}
            for atom in ['N','H']:
                if ghosts[tg][residue].has_key(atom):
                    if ghosts[tg][residue][atom]!='absent':
                        if not rescolor[residue].has_key(atom):
                            rescolor[residue][atom]=[colors[tgcount]]
                        else:
                            rescolor[residue][atom].append(colors[tgcount])
        print tg, colors[tgcount]
        tgcount=tgcount+1
    import Yasara_handler
    Y=Yasara_handler.yasara_handler()
    obj=Y.load_mol('2LZT.pdb')[0]
    for plot in ['N','H']:
        for residue in sorted(rescolor.keys()):
            resnum=int(residue[1:])
            if rescolor[residue].has_key(plot):
                if len(rescolor[residue][plot])==1:
                color=sum(rescolor[residue][plot])/len(rescolor[residue][plot])
                print resnum,rescolor[residue][plot],color
                else:  
                    color=1270
            else: 
                color=1059
            Y.yasara.ColorRes('%d' %(resnum),'%d' %color)
        raw_input('is this ok?')
    return
def yasaraplot ( ) : ghosts = getdata ( ) rescolor = { } tgcount = 0 tgcolstep = 360.0 / len ( ghosts . keys ( ) ) print 'tgcolstep: %5.2f' % tgcolstep colors = [ 240 , 0 , 60 , 120 , 180 , 300 , 1030 , 1150 ] del ghosts [ ':0048:ASP' ] del ghosts [ ':0066:ASP' ] for tg in sorted ( ghosts . keys ( ) ) : for residue in ghosts [ tg ] . keys ( ) : if not rescolor . has_key ( residue ) : rescolor [ residue ] = { } for atom in [ 'N' , 'H' ] : if ghosts [ tg ] [ residue ] . has_key ( atom ) : if ghosts [ tg ] [ residue ] [ atom ] != 'absent' : if not rescolor [ residue ] . has_key ( atom ) : rescolor [ residue ] [ atom ] = [ colors [ tgcount ] ] else : rescolor [ residue ] [ atom ] . append ( colors [ tgcount ] ) print tg , colors [ tgcount ] tgcount = tgcount + 1 import Yasara_handler Y = Yasara_handler . yasara_handler ( ) obj = Y . load_mol ( '2LZT.pdb' ) [ 0 ] for plot in [ 'N' , 'H' ] : for residue in sorted ( rescolor . keys ( ) ) : resnum = int ( residue [ 1 : ] ) if rescolor [ residue ] . has_key ( plot ) : color = sum ( rescolor [ residue ] [ plot ] ) / len ( rescolor [ residue ] [ plot ] ) print resnum , rescolor [ residue ] [ plot ] , color else : color = 1059 Y . yasara . ColorRes ( '%d' % ( resnum ) , '%d' % color ) raw_input ( 'is this ok?' ) return
Make a plot of all ghosts on the structure
Make a plot of all ghosts on the structure
"""Make a plot of all ghosts on the structure""" # # # #if len(rescolor[residue][plot])==1: #else:   #    color=1270