def _add_residue_highlighting_section(self): if self.structure.residues_of_interest: pymol_name = self.structure.pymol_name structure_selection = '%s and (%s)' % (self.structure.pymol_name, create_pymol_selection_from_PDB_residue_ids(self.structure.residues_of_interest)) self.script.append(''' ### Structure objects ### # Structure residues has_mutations = cmd.count_atoms('%(structure_selection)s') > 0 if has_mutations: cmd.select('%(pymol_name)s_mutations_s', '%(structure_selection)s'); if has_mutations: cmd.create('%(pymol_name)s_mutations', '%(structure_selection)s'); if has_mutations: cmd.show('sticks', '%(pymol_name)s_mutations') ''' % vars()) self.script.append(''' if has_mutations: cmd.color('%s', '%s_mutations')''' % (self.color_scheme['RosettaModel.mutations'], pymol_name)) self.script.append(''' # Rosetta model HETATMs - create and display has_hetatms = cmd.count_atoms('%(pymol_name)s and het and !(resn CSE+SEC+MSE)') > 0 if has_hetatms: cmd.create('%(pymol_name)s_HETATMs', '%(pymol_name)s and het and !(resn CSE+SEC+MSE)'); if has_hetatms: cmd.show('sticks', '%(pymol_name)s_HETATMs') if has_hetatms: cmd.create('spheres_%(pymol_name)s_HETATMs', '%(pymol_name)s and het and !(resn CSE+SEC+MSE)'); if has_hetatms: cmd.show('spheres', 'spheres_%(pymol_name)s_HETATMs') if has_hetatms: cmd.disable('spheres_%(pymol_name)s_HETATMs') ''' % vars())
def _add_residue_highlighting_section(self): loop_label = self.loop_label loop_selection = '{0} and ({1})'.format(self.loop_label, create_pymol_selection_from_PDB_residue_ids(self.Loop.residues_of_interest)) loop_color = self.color_scheme['Loop.bb'] self.script.append(''' ### Loop objects ### show car, %(loop_selection)s show sticks, %(loop_selection)s color %(loop_color)s, %(loop_selection)s ''' % vars())
def _add_residue_highlighting_section(self): for s in self.structures: residue_selection = '{0} and {1}'.format(s.structure_name, create_pymol_selection_from_PDB_residue_ids(s.residues_of_interest)) self.script.append(''' ### {0} objects ### # {0} residues of interest has_rois = cmd.count_atoms('{1}') > 0 if has_rois: cmd.select('{0}_roi_s', '{1}'); if has_rois: cmd.create('{0}_roi', '{1}'); if has_rois: cmd.show('{2}', '{0}_roi') if has_rois: cmd.color('{3}', '{0}_roi') '''.format(s.structure_name, residue_selection, s.sidechain_display or self.display_scheme['GenericProtein'].sidechain_display, s.sidechain_color or self.display_scheme['GenericProtein'].sidechain_color))
def _add_residue_highlighting_section(self): if self.Scaffold: scaffold_selection = 'Scaffold and (%s)' % (create_pymol_selection_from_PDB_residue_ids(self.Scaffold.residues_of_interest)) self.script.append(''' ### Scaffold objects ### # Scaffold mutations has_mutations = cmd.count_atoms('%(scaffold_selection)s') > 0 if has_mutations: cmd.select('Scaffold_mutations_s', '%(scaffold_selection)s'); if has_mutations: cmd.create('Scaffold_mutations', '%(scaffold_selection)s'); if has_mutations: cmd.show('sticks', 'Scaffold_mutations') ''' % vars()) self.script.append(''' if has_mutations: cmd.color('%(Scaffold.mutations)s', 'Scaffold_mutations') # Scaffold HETATMs - create has_hetatms = cmd.count_atoms('Scaffold and het and !(resn CSE+SEC+MSE)') > 0 if has_hetatms: cmd.create('Scaffold_HETATMs', 'Scaffold and het and !(resn CSE+SEC+MSE)'); if has_hetatms: cmd.show('sticks', 'Scaffold_HETATMs') if has_hetatms: cmd.disable('Scaffold_HETATMs') if has_hetatms: cmd.create('spheres_Scaffold_HETATMs', 'Scaffold and het and !(resn CSE+SEC+MSE)'); if has_hetatms: cmd.show('spheres', 'spheres_Scaffold_HETATMs') if has_hetatms: cmd.disable('spheres_Scaffold_HETATMs') ''' % self.color_scheme) #self.script.append('set label_color, black') #self.script.append('label n. CA and Scaffold and chain A and i. 122, "A122" ') model_selection = 'RosettaModel and (%s)' % (create_pymol_selection_from_PDB_residue_ids(self.Model.residues_of_interest)) self.script.append(''' ### Rosetta model objects ### # Rosetta model mutations has_mutations = cmd.count_atoms('%(model_selection)s') > 0 if has_mutations: cmd.select('RosettaModel_mutations_s', '%(model_selection)s'); if has_mutations: cmd.create('RosettaModel_mutations', '%(model_selection)s'); if has_mutations: cmd.show('sticks', 'RosettaModel_mutations') ''' % vars()) self.script.append(''' if has_mutations: cmd.color('%(RosettaModel.mutations)s', 'RosettaModel_mutations') # Rosetta model HETATMs - create and display has_hetatms = cmd.count_atoms('RosettaModel and het and !(resn CSE+SEC+MSE)') > 0 if has_hetatms: cmd.create('RosettaModel_HETATMs', 'RosettaModel and het and !(resn CSE+SEC+MSE)'); if has_hetatms: cmd.show('sticks', 'RosettaModel_HETATMs') if has_hetatms: cmd.create('spheres_RosettaModel_HETATMs', 'RosettaModel and het and !(resn CSE+SEC+MSE)'); if has_hetatms: cmd.show('spheres', 'spheres_RosettaModel_HETATMs') if has_hetatms: cmd.disable('spheres_RosettaModel_HETATMs') ''' % self.color_scheme) if self.ExpStructure: exp_structure_selection = 'ExpStructure and (%s)' % (create_pymol_selection_from_PDB_residue_ids(self.ExpStructure.residues_of_interest)) self.script.append(''' ### ExpStructure objects ### # ExpStructure mutations has_mutations = cmd.count_atoms('%(exp_structure_selection)s') > 0 if has_mutations: cmd.select('ExpStructure_mutations_s', '%(exp_structure_selection)s'); if has_mutations: cmd.create('ExpStructure_mutations', '%(exp_structure_selection)s'); if has_mutations: cmd.show('sticks', 'ExpStructure_mutations') ''' % vars()) self.script.append('''if has_mutations: cmd.color('%(ExpStructure.mutations)s', 'ExpStructure_mutations') # ExpStructure HETATMs - create and display has_hetatms = cmd.count_atoms('ExpStructure and het and !(resn CSE+SEC+MSE)') > 0 if has_hetatms: cmd.create('ExpStructure_HETATMs', 'ExpStructure and het and !(resn CSE+SEC+MSE)'); if has_hetatms: cmd.show('sticks', 'ExpStructure_HETATMs') if has_hetatms: cmd.create('spheres_ExpStructure_HETATMs', 'ExpStructure and het and !(resn CSE+SEC+MSE)'); if has_hetatms: cmd.show('spheres', 'spheres_ExpStructure_HETATMs') if has_hetatms: cmd.disable('spheres_ExpStructure_HETATMs') #ExpStructure and het and !(resn CSE+SEC+MSE)') ''' % self.color_scheme)