<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Motif</id>
	<title>Motif - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Motif"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Motif&amp;action=history"/>
	<updated>2026-07-17T06:51:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Motif&amp;diff=8109&amp;oldid=prev</id>
		<title>Pyadmin: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Motif&amp;diff=8109&amp;oldid=prev"/>
		<updated>2014-03-28T02:16:32Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Small script to show backbone motifs. Use like &amp;quot;motif 10-12&amp;quot; to show a segment from residues 10 to 12.&lt;br /&gt;
&lt;br /&gt;
The (optional) chain argument is the chain letter, but the output lists the chain along with the residue, so it's not essential to use this.&lt;br /&gt;
&lt;br /&gt;
When run, the output looks like this (for pdbid 1arb):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PyMOL&amp;gt;motif 10-12&lt;br /&gt;
 VAL-10 : (  -62,  -31 ) AR&lt;br /&gt;
 VAL-11 : (  -72,   -8 ) AR&lt;br /&gt;
 CYS-12 : (  -70,  170 ) BR&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;AR&amp;quot;, &amp;quot;BR&amp;quot;, &amp;quot;AL&amp;quot;, &amp;quot;BL&amp;quot; are conformation symbols, and cover quite large regions of the Ramachandran plot. to change them, change the typemap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# very rough bounds!&lt;br /&gt;
typemap = { (-180,0, 90, 180) : &amp;quot;BR&amp;quot;, (-150, -30, -60, 60) : &amp;quot;AR&amp;quot;, (0, 180, 90, 180) : &amp;quot;BL&amp;quot;, (30, 150, -60, 60) : &amp;quot;AL&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
def determinetype(phipsi):&lt;br /&gt;
    phi, psi = phipsi&lt;br /&gt;
    for bound in typemap:&lt;br /&gt;
        if bound[0] &amp;lt; phi &amp;lt; bound[1] and bound[2] &amp;lt; psi &amp;lt; bound[3]:&lt;br /&gt;
            return typemap[bound]&lt;br /&gt;
    return &amp;quot;?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
def my_phi_psi(selection):&lt;br /&gt;
    r = cmd.get_phipsi(selection)&lt;br /&gt;
&lt;br /&gt;
    if r is not None:&lt;br /&gt;
        keys = r.keys()&lt;br /&gt;
        keys.sort()&lt;br /&gt;
&lt;br /&gt;
        cmd.feedback('push')&lt;br /&gt;
        cmd.feedback('disable','executive','actions')&lt;br /&gt;
        for key in keys:&lt;br /&gt;
            phipsiType = determinetype(r[key])&lt;br /&gt;
            argtuple = r[key] + (phipsiType,)&lt;br /&gt;
            cmd.iterate(&amp;quot;(%s`%d)&amp;quot; % key, &amp;quot;print ' %-5s &amp;quot; + (&amp;quot;( %4.0f, %4.0f ) %s&amp;quot; % argtuple) + &amp;quot;'%(resn+'-'+resi+' '+chain+':')&amp;quot;)&lt;br /&gt;
        cmd.feedback('pop')&lt;br /&gt;
&lt;br /&gt;
def motif(residueRange, chain=None):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Use like &amp;quot;motif 10-12&amp;quot; to show a backbone segment from residues 10 to 12.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    name = residueRange&lt;br /&gt;
    if chain is None:&lt;br /&gt;
        selection = &amp;quot;name ca+n+c+o+h and not hetatm and resi %s&amp;quot; % residueRange&lt;br /&gt;
    else:&lt;br /&gt;
        selection = &amp;quot;name ca+n+c+o+h and not hetatm and resi %s and chain %s&amp;quot; % (residueRange, chain)&lt;br /&gt;
    cmd.select(name, selection)&lt;br /&gt;
    cmd.show(&amp;quot;sticks&amp;quot;, name)&lt;br /&gt;
    cmd.zoom(name)&lt;br /&gt;
    cmd.disable(name)&lt;br /&gt;
    cmd.label(&amp;quot;name ca and %s&amp;quot; % selection, &amp;quot;resi&amp;quot;)&lt;br /&gt;
    my_phi_psi(name)&lt;br /&gt;
&lt;br /&gt;
cmd.extend(&amp;quot;motif&amp;quot;, motif)&lt;br /&gt;
cmd.extend(&amp;quot;my_phi_psi&amp;quot;, my_phi_psi)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library|Motif]]&lt;br /&gt;
[[Category:Structural_Biology_Scripts]]&lt;/div&gt;</summary>
		<author><name>Pyadmin</name></author>
	</entry>
</feed>