Ghost/make_figs.py
def find_excludes_from_structure(self):
        """This is an old function for selecting residues to exclude. Does not work that great"""
        excludes={}
        #
        # Get the PDB file
        #
        import Protool
        X=Protool.structureIO()
        X.readpdb(options.pdbfile)
        #
        # Find all residues next to tg and next to Hbond-tg + residues with bb in VDW distance of sidechain
        #
        for tg in sorted(exp_ghosts.keys()):
            excludes[tg]=[]
            import string
            tg_res=string.join(tg.split(':')[:2],':')
            tg_num=int(tg.split(':')[1])
            CID=tg.split(':')[0]
            # Before - After
            excludes[tg].append('%s:%s' %(CID,string.zfill(tg_num-1,4)))
            excludes[tg].append('%s:%s' %(CID,string.zfill(tg_num+1,4)))
            #
            # Find Hbonding and VdW partners for side chain atoms
            #        
            for res2 in X.residues.keys():
                if res2==tg_res:
                    continue
                for atom in X.residues[tg_res]:
                    if X.is_backbone(atom) or X.is_hydrogen(atom):
                        continue
                    for atom2 in X.residues[res2]:
                        if X.dist(atom,atom2)<6.0:
                            if not res2 in excludes[tg]:
                                excludes[tg].append(res2)
                                break
        for tg in sorted(excludes.keys()):
            print tg
            print excludes[tg]
            print '-------'
        return excludes
This is an old function for selecting residues to exclude. Does not work that great
This is an old function for selecting residues to exclude. Does not work that great
This is an old function for selecting residues to exclude . Does not work that great
def find_excludes_from_structure(self):
        excludes={}
         Get the PDB file
        import Protool
        X=Protool.structureIO()
        X.readpdb(options.pdbfile)
         Find all residues next to tg and next to Hbond-tg + residues with bb in VDW distance of sidechain
        for tg in sorted(exp_ghosts.keys()):
            excludes[tg]=[]
            import string
            tg_res=string.join(tg.split(':')[:2],':')
            tg_num=int(tg.split(':')[1])
            CID=tg.split(':')[0]
             Before - After
            excludes[tg].append('%s:%s' %(CID,string.zfill(tg_num-1,4)))
            excludes[tg].append('%s:%s' %(CID,string.zfill(tg_num+1,4)))
             Find Hbonding and VdW partners for side chain atoms
            for res2 in X.residues.keys():
                if res2==tg_res:
                    continue
                for atom in X.residues[tg_res]:
                    if X.is_backbone(atom) or X.is_hydrogen(atom):
                        continue
                    for atom2 in X.residues[res2]:
                        if X.dist(atom,atom2)<6.0:
                            if not res2 in excludes[tg]:
                                excludes[tg].append(res2)
                                break
        for tg in sorted(excludes.keys()):
            print tg
            print excludes[tg]
            print '-------'
        return excludes
def find_excludes_from_structure ( self ) : excludes = { } import Protool X = Protool . structureIO ( ) X . readpdb ( options . pdbfile ) for tg in sorted ( exp_ghosts . keys ( ) ) : excludes [ tg ] = [ ] import string tg_res = string . join ( tg . split ( ':' ) [ : 2 ] , ':' ) tg_num = int ( tg . split ( ':' ) [ 1 ] ) CID = tg . split ( ':' ) [ 0 ] excludes [ tg ] . append ( '%s:%s' % ( CID , string . zfill ( tg_num - 1 , 4 ) ) ) excludes [ tg ] . append ( '%s:%s' % ( CID , string . zfill ( tg_num + 1 , 4 ) ) ) for res2 in X . residues . keys ( ) : if res2 == tg_res : continue for atom in X . residues [ tg_res ] : if X . is_backbone ( atom ) or X . is_hydrogen ( atom ) : continue for atom2 in X . residues [ res2 ] : if X . dist ( atom , atom2 ) < 6.0 : if not res2 in excludes [ tg ] : excludes [ tg ] . append ( res2 ) break for tg in sorted ( excludes . keys ( ) ) : print tg print excludes [ tg ] print '-------' return excludes
This is an old function for selecting residues to exclude.
This is an old function for selecting residues to exclude .
"""This is an old function for selecting residues to exclude. Does not work that great""" # # Get the PDB file # # # Find all residues next to tg and next to Hbond-tg + residues with bb in VDW distance of sidechain # # Before - After # # Find Hbonding and VdW partners for side chain atoms #        
self