def project(model, resi1_str, resi2_str, resi3_str, \ symQ, syms_for_use, syms_for_del, sym_d=3, \ segis_for_save='all', segis_for_del=''): all_segis = prepare(model, resi1_str, resi2_str, resi3_str, segis_for_save, segis_for_del) new_model, segi_count = make_segis(model, resi1, resi2, resi3, all_segis) cmd.alter(new_model, \ 'segi = new_segi(segi, sorted(all_segis))', \ space={'new_segi': new_segi, 'all_segis': all_segis, 'sorted': sorted}) if symQ: cmd.symexp('{}_sym'.format(model), \ '{}_save'.format(model), \ '({}_save)'.format(model), \ sym_d) for i in range(len(syms_for_use)): cmd.alter('{}_sym{}'.format(model, syms_for_use[i]), 'segi=segi+"mod{}"'.format(i + 1)) merge(model, ['{}_save'.format(model)] + ['{}_sym{}'.format(model, s) for s in syms_for_use]) else: merge(model, ['{}_save'.format(model)]) for sym in syms_for_del: cmd.delete('{}_sym{}'.format(model, sym)) cmd.alter('all', 'chain="A"') cmd.save('{}_calc.cif'.format(model), '{}_calc'.format(model)) print(cmd.rms_cur('{}_calc'.format(model), '{}_sym'.format(model)))
def testSymexp(self): cmd.load(self.datafile('1oky.pdb.gz'), 'm1') n = cmd.count_atoms() cmd.symexp('s', 'm1', '%m1 & resi 283', 20.0) x = cmd.get_object_list() self.assertEqual(x, [ 'm1', 's01000000', 's03000000', 's04000000', ]) self.assertEqual(n * 4, cmd.count_atoms())
# Fetch structure structure = '5FYL' cmd.reinitialize() cmd.delete('all') cmd.fetch(structure) #, type='pdb1') # Remove non-Env chains # gp41 = chain B # gp120 = chain G # 35O22 = chains D and E # PGT122 = chains H and L cmd.remove('c;D,E,H,L,U,V') # Generate symmetry partners based on crystal structure cmd.symexp(structure, structure, structure, 3) # Tweak initial display and color of Env monomers cmd.hide('everything') cmd.bg_color('white') cmd.show('cartoon') cmd.color('grey40') #cmd.color('grey20', structure) cmd.set('cartoon_transparency', '0.5') cmd.set('cartoon_transparency', '0', structure) #cmd.hide('hetatm') # Identify unique sites in structure sites_in_structure = [] cmd.iterate("(name ca)", "sites_in_structure.append(resi)") unique_sites_in_structure = []
homologs = ['BG505', 'BF520'] for h in homologs: # Fetch structure structure = '5fyl' cmd.reinitialize() cmd.delete('all') cmd.fetch(structure) #, type='pdb1') # Remove non-Env chains # gp41 = chain B # gp120 = chain G # 35O22 = chains D and E # PGT122 = chains H and L cmd.remove('c;D,E,H,L,U,V') cmd.symexp(structure, structure, structure, 3) # generate symmetry partners based on crystal structure # Tweak initial display and color of Env monomers cmd.hide('everything') cmd.bg_color('white') cmd.show('cartoon') cmd.color('grey40') #cmd.color('grey20', structure) cmd.set('cartoon_transparency', '0.5') cmd.set('cartoon_transparency', '0', structure) #cmd.hide('hetatm') # Identify unique sites in structure sites_in_structure = [] cmd.iterate("(name ca)", "sites_in_structure.append(resi)") unique_sites_in_structure = []
""" # Imports import pymol from pymol import cmd # Fetch structure structure = '1ENV' cmd.reinitialize() cmd.delete('all') cmd.fetch(structure) #, type='pdb1') # Generate symmetry partners based on crystal structure, using a distance of # 1.9 since this reproduces the timer without segments from any other adjacent # monomers in the crystal structure cmd.symexp(structure, structure, structure, 2.5) # Tweak initial display and color of Env monomers cmd.hide('everything') cmd.bg_color('white') cmd.show('cartoon') cmd.color('grey40') #cmd.set('cartoon_transparency', '0.5') #cmd.set('cartoon_transparency', '0', structure) # Get site-specific RMSDcorrected values and whether the shift at a site is # significant RMSD_dict = {} sig_dict = {} with open('../BG505_to_BF520_prefs_dist.csv') as f: lines = f.readlines()[1:]
""" # Imports import pymol from pymol import cmd # Fetch structure structure = '1AIK' cmd.reinitialize() cmd.delete('all') cmd.fetch(structure) #, type='pdb1') # Generate symmetry partners based on crystal structure, using a distance of # 1.9 since this reproduces the timer without segments from any other adjacent # monomers in the crystal structure cmd.symexp(structure, structure, structure, 1.9) # Tweak initial display and color of Env monomers cmd.hide('everything') cmd.bg_color('white') cmd.show('cartoon') cmd.color('grey40') #cmd.color('grey20', structure) cmd.set('cartoon_transparency', '0.5') cmd.set('cartoon_transparency', '0', structure) #cmd.hide('hetatm') # Identify unique sites in structure sites_in_structure = [] cmd.iterate("(name ca)", "sites_in_structure.append(resi)") unique_sites_in_structure = []