Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help
Special pages
SBGrid Resources
SBGrid Consortium
SBGrid Data Bank
Software Webinars
PyMOL Webinar
PyMOL Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
User:Speleo3
(section)
User page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
User contributions
Logs
View user groups
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== ccmutate === <source lang="python"> @cmd.extend def ccmutate(code, selection='??sele|?pk1', sculpt=1): ''' DESCRIPTION Mutate selected residue. ARGUMENTS code = str: 3-letter PDBeChem chemical component identifier selection = str: single residue selection {default: pk1 or sele} sculpt = 0/1: try to adopt conformation of replaced sidechain, followed by relaxation using sculpting {default: 1} EXAMPLE fetch 1ubq, async=0 ccmutate 0HG, resi 24 SEE ALSO fetch ..., type=cc wizard mutagenesis ''' code = code.upper() tmp_sele = cmd.get_unused_name('_sele') tmp_frag = cmd.get_unused_name('_frag') tmp_Nnbr = cmd.get_unused_name('_Nnbr') tmp_back = cmd.get_unused_name('_back') tmp_tmpl = cmd.get_unused_name('_tmpl') tmp_sc_o = cmd.get_unused_name('_sc_o') tmp_sc_n = cmd.get_unused_name('_sc_n') try: cmd.select(tmp_sele, 'byres (' + selection + ')', 0) # check input selection if cmd.count_atoms('name CA & ?' + tmp_sele) != 1: raise pymol.CmdException('selection must include exactly one residue') if cmd.count_atoms('name N+CA+C & ?' + tmp_sele) != 3: raise pymol.CmdException("selected residue doesn't have N+CA+C atoms") # PDBeChem fragment cmd.fetch(code, tmp_frag, type='cc', zoom=0) # check if fragment is amino acid if cmd.count_atoms('name N+CA+C & ?' + tmp_frag) != 3: raise pymol.CmdException("residue '%s' doesn't have N+CA+C atoms" % (code)) # only keep hydrogens if target also has hydrogens if cmd.count_atoms('hydro & ?' + tmp_sele) == 0: cmd.remove('hydro & ?' + tmp_frag) # update residue name for old residue cmd.alter(tmp_sele, 'resn = ' + repr(code)) # superpose fragment on backbone cmd.align( 'name N+CA+C & ?' + tmp_frag, 'name N+CA+C & ?' + tmp_sele) # extra N bonds, like in PRO cmd.select(tmp_Nnbr, 'neighbor (name N & ?' + tmp_frag + ')', 0) # backbone selection cmd.select(tmp_back, 'name CA+C+O+N+OXT', 0) cmd.select(tmp_back, 'hydro & neighbor ?' + tmp_back, 0, merge=1) # remove complementary atoms cmd.remove( '?' + tmp_frag + ' & ' + tmp_back) cmd.extract(tmp_tmpl, '?' + tmp_sele + ' & !' + tmp_back, zoom=0) if cmd.count_atoms(tmp_frag): # attach new sidechain cmd.fuse('name CB & ?' + tmp_frag, 'name CA & ?' + tmp_sele, mode=1, move=0) cmd.unpick() # new atom selections cmd.select(tmp_sc_n, '(byres ?' + tmp_sele + ') & !?' + tmp_sele, 0) cmd.select(tmp_sc_o, '?' + tmp_sc_n + ' like ?' + tmp_tmpl, 0) # extra N bonds, like in PRO if cmd.count_atoms(tmp_Nnbr): cmd.bond('?' + tmp_sc_n + ' like ?' + tmp_Nnbr, 'name N & ?' + tmp_sele) # adopt old conformation, if possible if int(sculpt): model = cmd.get_object_list('?' + tmp_sele)[0] cmd.protect(model) cmd.deprotect('?' + tmp_sc_n + ' & !?' + tmp_sc_o) cmd.sculpt_activate(model) if cmd.count_atoms(tmp_sc_o): cmd.update(tmp_sc_o, tmp_tmpl) cmd.set('sculpt_field_mask', 63) # local geom + vdw cmd.sculpt_iterate(model, cycles=100) cmd.deprotect(tmp_sc_o) cmd.set('sculpt_field_mask', 0xff) # all cmd.sculpt_iterate(model, cycles=200) cmd.set('sculpt_field_mask', 31) # local geom cmd.sculpt_iterate(model, cycles=200) finally: cmd.delete(tmp_sele) cmd.delete(tmp_frag) cmd.delete(tmp_Nnbr) cmd.delete(tmp_back) cmd.delete(tmp_tmpl) cmd.delete(tmp_sc_o) cmd.delete(tmp_sc_n) </source>
Summary:
Please note that all contributions to PyMOL Wiki are considered to be released under the GNU Free Documentation License 1.2 (see
PyMOL Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
User:Speleo3
(section)
Add topic