<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Avelldiroll</id>
	<title>PyMOL Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Avelldiroll"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/Avelldiroll"/>
	<updated>2026-04-16T10:52:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8313</id>
		<title>Helicity check</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8313"/>
		<updated>2007-04-20T18:52:23Z</updated>

		<summary type="html">&lt;p&gt;Avelldiroll: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;helicity_check show the evolution of O - N distances over an amino acid sequence&lt;br /&gt;
&lt;br /&gt;
See for further info:&lt;br /&gt;
&lt;br /&gt;
Protein Sci ROHL and DOIG 5 (8) 1687&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Models for the 3(10)-helix/coil, pi-helix/coil, and alpha-helix/3(10)-helix/coil transitions in isolated peptides.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
uses:&lt;br /&gt;
*in the pymol console:&lt;br /&gt;
  &amp;gt;run pymol_helicity_check.py&lt;br /&gt;
    ----&amp;gt; select some consecutive amino acids&lt;br /&gt;
           - this is nicely done with the Display-&amp;gt;Sequence tool&lt;br /&gt;
  &amp;gt;helicity_check()&lt;br /&gt;
*installing helicity_check&lt;br /&gt;
  copy pymol_helicity_check.py in $PYMOL_INSTALL_DIR/modules/pmg_tk/startup&lt;br /&gt;
  launch Pymol: you now have a new option in the Plugin menu&lt;br /&gt;
 &lt;br /&gt;
helicity_check uses gnuplot (http://www.gnuplot.info) to display its results.&lt;br /&gt;
As a consequence gnuplot needs to be installed.&lt;br /&gt;
 &lt;br /&gt;
This plugin was tested on linux only, it might need some modifications to run on&lt;br /&gt;
other OSes. (hints: launching gnuplot and path to dumpfile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# pymol_helicity_check.py&lt;br /&gt;
# Copyright (c) 2006-2007 Julien Lefeuvre &amp;lt;lefeuvrejulien@yahoo.fr&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
Pymol plugin for checking helicity type&lt;br /&gt;
&lt;br /&gt;
helicity_check() takes as input a selection ('sele' by default)&lt;br /&gt;
of at least 5 amino acids and computes the distances between&lt;br /&gt;
O(i) - N(i+3)&lt;br /&gt;
O(i) - N(i+4)&lt;br /&gt;
O(i) - N(i+5)&lt;br /&gt;
See for further info:&lt;br /&gt;
Protein Sci ROHL and DOIG 5 (8) 1687&lt;br /&gt;
'Models for the 3(10)-helix/coil, pi-helix/coil,&lt;br /&gt;
and alpha-helix/3(10)-helix/coil transitions in isolated peptides.'&lt;br /&gt;
&lt;br /&gt;
uses:&lt;br /&gt;
*in the pymol console:&lt;br /&gt;
  &amp;gt;run pymol_helicity_check.py&lt;br /&gt;
    ----&amp;gt; select some consecutive amino acids&lt;br /&gt;
           - this is nicely done with the Display-&amp;gt;Sequence tool&lt;br /&gt;
  &amp;gt;helicity_check()&lt;br /&gt;
*installing helicity_check&lt;br /&gt;
  copy pymol_helicity_check.py in $PYMOL_INSTALL_DIR/modules/pmg_tk/startup&lt;br /&gt;
  launch Pymol: you now have a new option in the Plugin menu&lt;br /&gt;
&lt;br /&gt;
helicity_check uses gnuplot (http://www.gnuplot.info) to display its results&lt;br /&gt;
As a consequence gnuplot needs to be installed.&lt;br /&gt;
&lt;br /&gt;
This plugin was tested on linux only, it my need some modifications to run on&lt;br /&gt;
other OSes (hints: launching gnuplot and path to dumpfile)&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__author__ =    &amp;quot;Julien Lefeuvre &amp;lt;lefeuvrejulien@yahoo.fr&amp;gt;&amp;quot;&lt;br /&gt;
__version__ =   &amp;quot;1.0&amp;quot;&lt;br /&gt;
__date__ =      &amp;quot;2007-04-02&amp;quot;&lt;br /&gt;
__copyright__ = &amp;quot;Copyright (c) 2007 %s. All rights reserved.&amp;quot; % __author__&lt;br /&gt;
__licence__ =   &amp;quot;BSD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
from math import sqrt&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
import subprocess&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def __init__(self):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;init function in order to have a nice menu option in Pymol&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    self.menuBar.addmenuitem('Plugin', 'command', 'Helicity Check',&lt;br /&gt;
             label='Helicity Check', command = lambda: helicity_check())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Residue(object):&lt;br /&gt;
&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        self.name=None&lt;br /&gt;
        self.index=None&lt;br /&gt;
        self.Ocoord=None&lt;br /&gt;
        self.Ncoord=None&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def calc_distON(Ocoord,Ncoord):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;return the distance between 2 atoms given their coordinates&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    sum = 0&lt;br /&gt;
    for o, n in zip(Ocoord, Ncoord):&lt;br /&gt;
        sum += (o - n)**2&lt;br /&gt;
    return sqrt(sum)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def helicity_check(selection='sele'):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;calcultate distance O[res i]-N[res i+3]&lt;br /&gt;
                           O[res i]-N[res i+4]&lt;br /&gt;
                           O[res i]-N[res i+5]&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    seq_model = cmd.get_model(selection) #get info from selection&lt;br /&gt;
    res_lim = seq_model.get_residues()&lt;br /&gt;
&lt;br /&gt;
    if len(res_lim)&amp;lt;5:&lt;br /&gt;
        sys.stderr.write(&amp;quot;\nPlease select at least 5 residues\n&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    atom_list = seq_model.atom&lt;br /&gt;
    res_data=[]&lt;br /&gt;
&lt;br /&gt;
    for start,end in res_lim:   #extract the data we are interested in&lt;br /&gt;
        res=Residue()&lt;br /&gt;
        for atom in atom_list[start:end]:&lt;br /&gt;
            if atom.name == 'N':&lt;br /&gt;
                res.name = atom.resn&lt;br /&gt;
                res.index = atom.resi&lt;br /&gt;
                res.Ncoord = atom.coord&lt;br /&gt;
            elif atom.name == 'O':&lt;br /&gt;
                res.Ocoord = atom.coord&lt;br /&gt;
        if res.Ocoord and res.Ncoord and res.name and res.index:&lt;br /&gt;
            res_data.append(res)&lt;br /&gt;
        else:&lt;br /&gt;
            sys.stderr.write(&amp;quot;\nPlease select complete protein residues\n&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
    res_list = [int(res.index) for res in res_data]&lt;br /&gt;
&lt;br /&gt;
    if res_list != range(res_list[0], res_list[-1]+1):&lt;br /&gt;
        sys.stderr.write(&amp;quot;\nPlease select a unbrocken residue sequence\n&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    distON3 = []&lt;br /&gt;
    distON4 = []&lt;br /&gt;
    distON5 = []&lt;br /&gt;
    distONs = [distON3, distON4, distON5]&lt;br /&gt;
&lt;br /&gt;
    for i,res in enumerate(res_data[:-5]): #distances calculations&lt;br /&gt;
        resis = res_data[i+3:i+6]&lt;br /&gt;
        for resi, distONi in zip(resis, distONs):&lt;br /&gt;
            distONi.append(calc_distON(res.Ocoord, resi.Ncoord))&lt;br /&gt;
&lt;br /&gt;
    dump = os.tmpnam()+'.dat'&lt;br /&gt;
    dumpfile = file(dump, 'w')&lt;br /&gt;
&lt;br /&gt;
    sys.stdout.write('\n#Distances O(i)---N(i+n)\n'&lt;br /&gt;
           '#ResNum , d(O(i)-N(i+3)) , d(O(i)-N(i+4)) , d(O(i)-N(i+4))\n')&lt;br /&gt;
    for i, d3, d4, d5 in zip(res_list, distON3, distON4, distON5):&lt;br /&gt;
        #writing console output&lt;br /&gt;
        sys.stdout.write(&lt;br /&gt;
              '  %i ,      %f ,       %f ,       %f \n'%(i, d3, d4, d5))&lt;br /&gt;
        #writing data to a dump file for use by gnuplot&lt;br /&gt;
        dumpfile.write(&lt;br /&gt;
              '  %i       %f        %f        %f \n'%(i, d3, d4, d5))&lt;br /&gt;
    dumpfile.flush()&lt;br /&gt;
&lt;br /&gt;
    #launch a gnuplot window to show the distances&lt;br /&gt;
    gnuplotcmd = subprocess.Popen(['/usr/bin/gnuplot'], shell=True,&lt;br /&gt;
                               stdin=subprocess.PIPE)&lt;br /&gt;
    gnuplotcmd.stdin.write('set autoscale\n')&lt;br /&gt;
    gnuplotcmd.stdin.write(&amp;quot;plot &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:2 title 'd(O(i)-N(i+3))' with lines, &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:3 title 'd(O(i)-N(i+4))' with lines, &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:4 title 'd(O(i)-N(i+5))' with lines\n'&amp;quot;&lt;br /&gt;
                          % (dump, dump, dump))&lt;br /&gt;
    time.sleep(3)&lt;br /&gt;
    dumpfile.close()&lt;br /&gt;
    os.remove(dump)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Avelldiroll</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=User:Avelldiroll&amp;diff=3241</id>
		<title>User:Avelldiroll</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=User:Avelldiroll&amp;diff=3241"/>
		<updated>2007-04-03T14:05:29Z</updated>

		<summary type="html">&lt;p&gt;Avelldiroll: New page: Julien Lefeuvre&amp;lt;br&amp;gt; PhD Student&amp;lt;br&amp;gt;   Institut Européen de Chimie et de Biologie (IECB)&amp;lt;br&amp;gt; UMR 5248 CBMN, Chimie et Biologie des Membranes et des Nanoobjets,&amp;lt;br&amp;gt; CNRS-Universite Bordeaux...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Julien Lefeuvre&amp;lt;br&amp;gt;&lt;br /&gt;
PhD Student&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Institut Européen de Chimie et de Biologie (IECB)&amp;lt;br&amp;gt;&lt;br /&gt;
UMR 5248 CBMN, Chimie et Biologie des Membranes et des Nanoobjets,&amp;lt;br&amp;gt;&lt;br /&gt;
CNRS-Universite Bordeaux 1-ENITAB&amp;lt;br&amp;gt;&lt;br /&gt;
2, rue Robert Escarpit - 33607 Pessac Cedex - France&amp;lt;br&amp;gt;&lt;br /&gt;
Tél. : 33 (0)5 40 00 30 31&amp;lt;br&amp;gt;&lt;br /&gt;
Fax. : 33 (0)5 40 00 30 73&amp;lt;br&amp;gt;&lt;br /&gt;
http://www.iecb.u-bordeaux.fr&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Avelldiroll</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8312</id>
		<title>Helicity check</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8312"/>
		<updated>2007-04-03T12:44:51Z</updated>

		<summary type="html">&lt;p&gt;Avelldiroll: update to improve portability&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;helicity_check show the evolution of O - N distances over an amino acid sequence&lt;br /&gt;
&lt;br /&gt;
See for further info:&lt;br /&gt;
&lt;br /&gt;
Protein Sci ROHL and DOIG 5 (8) 1687&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Models for the 3(10)-helix/coil, pi-helix/coil, and alpha-helix/3(10)-helix/coil transitions in isolated peptides.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
uses:&lt;br /&gt;
*in the pymol console:&lt;br /&gt;
  &amp;gt;run pymol_helicity_check.py&lt;br /&gt;
    ----&amp;gt; select some consecutive amino acids&lt;br /&gt;
           - this is nicely done with the Display-&amp;gt;Sequence tool&lt;br /&gt;
  &amp;gt;helicity_check()&lt;br /&gt;
*installing helicity_check&lt;br /&gt;
  copy pymol_helicity_check.py in $PYMOL_INSTALL_DIR/modules/pmg_tk/startup&lt;br /&gt;
  launch Pymol: you now have a new option in the Plugin menu&lt;br /&gt;
 &lt;br /&gt;
helicity_check uses gnuplot (http://www.gnuplot.info) to display its results.&lt;br /&gt;
As a consequence gnuplot needs to be installed.&lt;br /&gt;
 &lt;br /&gt;
This plugin was tested on linux only, it my need some modifications to run on&lt;br /&gt;
other OSes. (hints: launching gnuplot and path to dumpfile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# pymol_helicity_check.py&lt;br /&gt;
# Copyright (c) 2006-2007 Julien Lefeuvre &amp;lt;lefeuvrejulien@yahoo.fr&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
Pymol plugin for checking helicity type&lt;br /&gt;
&lt;br /&gt;
helicity_check() takes as input a selection ('sele' by default)&lt;br /&gt;
of at least 5 amino acids and computes the distances between&lt;br /&gt;
O(i) - N(i+3)&lt;br /&gt;
O(i) - N(i+4)&lt;br /&gt;
O(i) - N(i+5)&lt;br /&gt;
See for further info:&lt;br /&gt;
Protein Sci ROHL and DOIG 5 (8) 1687&lt;br /&gt;
'Models for the 3(10)-helix/coil, pi-helix/coil,&lt;br /&gt;
and alpha-helix/3(10)-helix/coil transitions in isolated peptides.'&lt;br /&gt;
&lt;br /&gt;
uses:&lt;br /&gt;
*in the pymol console:&lt;br /&gt;
  &amp;gt;run pymol_helicity_check.py&lt;br /&gt;
    ----&amp;gt; select some consecutive amino acids&lt;br /&gt;
           - this is nicely done with the Display-&amp;gt;Sequence tool&lt;br /&gt;
  &amp;gt;helicity_check()&lt;br /&gt;
*installing helicity_check&lt;br /&gt;
  copy pymol_helicity_check.py in $PYMOL_INSTALL_DIR/modules/pmg_tk/startup&lt;br /&gt;
  launch Pymol: you now have a new option in the Plugin menu&lt;br /&gt;
&lt;br /&gt;
helicity_check uses gnuplot (http://www.gnuplot.info) to display its results&lt;br /&gt;
As a consequence gnuplot needs to be installed.&lt;br /&gt;
&lt;br /&gt;
This plugin was tested on linux only, it my need some modifications to run on&lt;br /&gt;
other OSes (hints: launching gnuplot and path to dumpfile)&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__author__ =    &amp;quot;Julien Lefeuvre &amp;lt;lefeuvrejulien@yahoo.fr&amp;gt;&amp;quot;&lt;br /&gt;
__version__ =   &amp;quot;1.0&amp;quot;&lt;br /&gt;
__date__ =      &amp;quot;2007-04-02&amp;quot;&lt;br /&gt;
__copyright__ = &amp;quot;Copyright (c) 2007 %s. All rights reserved.&amp;quot; % __author__&lt;br /&gt;
__licence__ =   &amp;quot;BSD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
from math import sqrt&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
import subprocess&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def __init__(self):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;init function in order to have a nice menu option in Pymol&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    self.menuBar.addmenuitem('Plugin', 'command', 'Helicity Check',&lt;br /&gt;
             label='Helicity Check', command = lambda: helicity_check())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Residue(object):&lt;br /&gt;
&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        self.name=None&lt;br /&gt;
        self.index=None&lt;br /&gt;
        self.Ocoord=None&lt;br /&gt;
        self.Ncoord=None&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def calc_distON(Ocoord,Ncoord):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;return the distance between 2 atoms given their coordinates&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    sum = 0&lt;br /&gt;
    for o, n in zip(Ocoord, Ncoord):&lt;br /&gt;
        sum += (o - n)**2&lt;br /&gt;
    return sqrt(sum)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def helicity_check(selection='sele'):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;calcultate distance O[res i]-N[res i+3]&lt;br /&gt;
                           O[res i]-N[res i+4]&lt;br /&gt;
                           O[res i]-N[res i+5]&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    seq_model = cmd.get_model(selection) #get info from selection&lt;br /&gt;
    res_lim = seq_model.get_residues()&lt;br /&gt;
&lt;br /&gt;
    if len(res_lim)&amp;lt;5:&lt;br /&gt;
        sys.stderr.write(&amp;quot;\nPlease select at least 5 residues\n&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    atom_list = seq_model.atom&lt;br /&gt;
    res_data=[]&lt;br /&gt;
&lt;br /&gt;
    for start,end in res_lim:   #extract the data we are interested in&lt;br /&gt;
        res=Residue()&lt;br /&gt;
        for atom in atom_list[start:end]:&lt;br /&gt;
            if atom.name == 'N':&lt;br /&gt;
                res.name = atom.resn&lt;br /&gt;
                res.index = atom.resi&lt;br /&gt;
                res.Ncoord = atom.coord&lt;br /&gt;
            elif atom.name == 'O':&lt;br /&gt;
                res.Ocoord = atom.coord&lt;br /&gt;
        if res.Ocoord and res.Ncoord and res.name and res.index:&lt;br /&gt;
            res_data.append(res)&lt;br /&gt;
        else:&lt;br /&gt;
            sys.stderr.write(&amp;quot;\nPlease select complete protein residues\n&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
    res_list = [int(res.index) for res in res_data]&lt;br /&gt;
&lt;br /&gt;
    if res_list != range(res_list[0], res_list[-1]+1):&lt;br /&gt;
        sys.stderr.write(&amp;quot;\nPlease select a unbrocken residue sequence\n&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    distON3 = []&lt;br /&gt;
    distON4 = []&lt;br /&gt;
    distON5 = []&lt;br /&gt;
    distONs = [distON3, distON4, distON5]&lt;br /&gt;
&lt;br /&gt;
    for i,res in enumerate(res_data[:-5]): #distances calculations&lt;br /&gt;
        resis = res_data[i+3:i+6]&lt;br /&gt;
        for resi, distONi in zip(resis, distONs):&lt;br /&gt;
            distONi.append(calc_distON(res.Ocoord, resi.Ncoord))&lt;br /&gt;
&lt;br /&gt;
    dump = os.tmpnam()+'.dat'&lt;br /&gt;
    dumpfile = file(dump, 'w')&lt;br /&gt;
&lt;br /&gt;
    sys.stdout.write('\n#Distances O(i)---N(i+n)\n'&lt;br /&gt;
           '#ResNum , d(O(i)-N(i+3)) , d(O(i)-N(i+4)) , d(O(i)-N(i+4))\n')&lt;br /&gt;
    for i, d3, d4, d5 in zip(res_list, distON3, distON4, distON5):&lt;br /&gt;
        #writing console output&lt;br /&gt;
        sys.stdout.write(&lt;br /&gt;
              '  %i ,      %f ,       %f ,       %f \n'%(i, d3, d4, d5))&lt;br /&gt;
        #writing data to a dump file for use by gnuplot&lt;br /&gt;
        dumpfile.write(&lt;br /&gt;
              '  %i       %f        %f        %f \n'%(i, d3, d4, d5))&lt;br /&gt;
    dumpfile.flush()&lt;br /&gt;
&lt;br /&gt;
    #launch a gnuplot window to show the distances&lt;br /&gt;
    gnuplotcmd = subprocess.Popen(['/usr/bin/gnuplot'], shell=True,&lt;br /&gt;
                               stdin=subprocess.PIPE)&lt;br /&gt;
    gnuplotcmd.stdin.write('set autoscale\n')&lt;br /&gt;
    gnuplotcmd.stdin.write(&amp;quot;plot &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:2 title 'd(O(i)-N(i+3))' with lines, &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:3 title 'd(O(i)-N(i+4))' with lines, &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:4 title 'd(O(i)-N(i+5))' with lines\n'&amp;quot;&lt;br /&gt;
                          % (dump, dump, dump))&lt;br /&gt;
    time.sleep(3)&lt;br /&gt;
    dumpfile.close()&lt;br /&gt;
    os.remove(dump)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Avelldiroll</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Category:Script_Library&amp;diff=3884</id>
		<title>Category:Script Library</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Category:Script_Library&amp;diff=3884"/>
		<updated>2007-04-02T20:32:51Z</updated>

		<summary type="html">&lt;p&gt;Avelldiroll: added helicity_check&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Zero_residues]] -- Renumber residues such that the first residue is 0.  Useful for alignments.&lt;br /&gt;
&lt;br /&gt;
* [[Cealign]] -- Implementation of the CE Structure Alignment algorithm as a PyMOL plugin.&lt;br /&gt;
&lt;br /&gt;
* [[WriteSS]] -- Writes secondary structural elements, for each residues, to a file.&lt;br /&gt;
&lt;br /&gt;
* [[Process_All_Files_In_Directory]] -- Do something to all files in a directory.  The examples show how to print the disulfide bond lengths, then in general all sulfur distances (not necessarily bound).&lt;br /&gt;
&lt;br /&gt;
* [[Kabsch]] -- Kabsch alignment of two sets of vectors.  (Part 2 of a protein alignment.)&lt;br /&gt;
&lt;br /&gt;
* [[Transform_odb]] -- Transform a selection of an existing object and output as a new object.  The transformation matrix is read from an &amp;quot;O&amp;quot;-style tranformation matrix file (.odb) written by &amp;quot;O&amp;quot; or by any of the Uppsala Software Factory programs (from Gerard Klegweit) such as LSQMAN.&lt;br /&gt;
&lt;br /&gt;
* [[Stereo_Ray]] -- This script will create two resolution specific ray traced images rotated appropriately for inclusion into a single file to represent a stereo view of the desired macromolecule.&lt;br /&gt;
&lt;br /&gt;
* [[Translate_And_Measure]] -- prints '''overlap''' if any of the atoms in molA or molB were within 4 Angstrom after translating by 1 along X&lt;br /&gt;
&lt;br /&gt;
* [[Show aromatics]] -- This script will display a backbone &amp;quot;worm&amp;quot; for your protein, with all of the sidechains for aromatic residues displayed as green &amp;quot;sticks&amp;quot;.  Usage: Save this as &amp;quot;show_aromatics.pml&amp;quot;, load your protein in PyMOL, and run the script (select &amp;quot;Run&amp;quot; from the &amp;quot;File&amp;quot; menu). (PyMOL script; TStout)&lt;br /&gt;
&lt;br /&gt;
* [[Show hydrophobics]] -- This script will display a backbone &amp;quot;worm&amp;quot; for your protein, with all of the sidechains for hydrophobic residues displayed as orange &amp;quot;sticks&amp;quot;.  Usage: Same as &amp;quot;show aromatics&amp;quot;. (PyMOL script; TStout)&lt;br /&gt;
&lt;br /&gt;
* [[Show charged]] -- This script will display a backbone &amp;quot;worm&amp;quot; for your protein, with all of the sidechains for charged residues displayed as red (negative) or blue (posititve) &amp;quot;sticks&amp;quot;.  Usage: Same as &amp;quot;show aromatics&amp;quot;. (PyMOL script; TStout)&lt;br /&gt;
&lt;br /&gt;
* [[Show hydrophilic]] -- This script will display a backbone &amp;quot;worm&amp;quot; for your protein, with all of the sidechains for hydrophilic residues displayed as green &amp;quot;sticks&amp;quot;.  Usage: Same as &amp;quot;show aromatics&amp;quot;. (PyMOL script; TStout)&lt;br /&gt;
&lt;br /&gt;
* [[Show NMR constrains]] -- This script will display the NMR constrains used for a structure calculation atop a structure.  Usage: Save this as &amp;quot;NMRcnstr.py&amp;quot; load your protein in PyMOL, and run the script. type upl('fname') or cns('fname') where fname is the filename with the NMR constrains you want to display. &lt;br /&gt;
&lt;br /&gt;
* [[Perp Maker]] -- Creates a perpendicular plane through the center of your protein with respect to the camera's current position.  (If you translate the protein towards the camera a bit, you get a nice surface, sometimes.) A stupid little script I wrote in response to a request a few months ago (and it doesn't even conform to the request!)  Load a protein, run the script (read the documentation in the script). (Jason Vertrees/[[User:Tree|Tree]])&lt;br /&gt;
&lt;br /&gt;
* [[PythonTerminal]] -- Allows execution of python commands from the PyMOL command line.&lt;br /&gt;
&lt;br /&gt;
* [[Axes]] -- Creates a 3D-CGO object that shows the three coordinate axes.&lt;br /&gt;
&lt;br /&gt;
* [[CGO Text]] -- Creates a 3D-CGO text object.&lt;br /&gt;
&lt;br /&gt;
* [[List Selection]] -- Prints a list of all residues in a selection (both Python and .pml).&lt;br /&gt;
&lt;br /&gt;
* [[List Colors]] -- Lists the color of all residues in a selection (both Python and .pml).&lt;br /&gt;
&lt;br /&gt;
* [[List Secondary Structures]] -- Secondary structures (both predefined and those calculated with the 'dss' command) can be exported as a long string ('HHHHLLLLSSS').&lt;br /&gt;
&lt;br /&gt;
* [[Split Movement]] -- Moves two parts of one object into different directions.&lt;br /&gt;
&lt;br /&gt;
* [[Selection Exists]] -- Python method that returns true if a selection of a given name exists.&lt;br /&gt;
&lt;br /&gt;
* [[Get Coordinates I]] -- Retrieves atom coordinates as Python objects.&lt;br /&gt;
&lt;br /&gt;
* [[Get Coordinates II]] -- Retrieves atom coordinates as Python array (list object).&lt;br /&gt;
&lt;br /&gt;
* [[grepset]] -- List all settings matching a given keyword. - ''by EHP''&lt;br /&gt;
&lt;br /&gt;
* [[apropos]] -- List all commands matching a given keyword or whose docs contain the keyword. - ''by EHP''&lt;br /&gt;
&lt;br /&gt;
* [[mouse_modes]] -- customize the default mouse bindings for Viewing or Editing modes. - ''by EHP''&lt;br /&gt;
&lt;br /&gt;
* [[Measure Distance]] -- Measures the distance between two atoms (Python script).&lt;br /&gt;
&lt;br /&gt;
* [[Read PDB-String]] -- Parses a string in PDB format to a PyMOL object.&lt;br /&gt;
&lt;br /&gt;
* [[Color Objects]] -- Colors all objects differently (Python script).&lt;br /&gt;
&lt;br /&gt;
* [[Key Wait]] -- Process key events in a Python script.&lt;br /&gt;
&lt;br /&gt;
* [[Bounding Box]] -- Create a bounding box around a selection (Python script; requires numarray and Scientific; gilleain)&lt;br /&gt;
&lt;br /&gt;
* [[Ellipsoid]] -- Create callback object (opengl) ellipsoids. (Python script;  gilleain)&lt;br /&gt;
&lt;br /&gt;
* [[pdbsurvey]] -- Surveys the pdb for recently added structures that are relevant to a user-specified keywords list (in a text file)&lt;br /&gt;
&lt;br /&gt;
* [[TransformSelectionByCameraView]] -- Transforms the selection by the camera view.&lt;br /&gt;
&lt;br /&gt;
* [[WFMesh]] -- Imports wavefront object mesh files; Starwars as an example!&lt;br /&gt;
&lt;br /&gt;
* [[grepsel]] -- Make named selections using regular expressions (protein sequence).&lt;br /&gt;
&lt;br /&gt;
* [[PowerMate Dial OS X]] -- Script and instructions to use the PowerMate dial on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
* [[Plane Wizard]] -- Wizard to draw planes between three picked points.&lt;br /&gt;
&lt;br /&gt;
* [[Slerpy]] -- Pymol command extensions for key frame animation movie making.&lt;br /&gt;
&lt;br /&gt;
* [[Helicity_check]] -- helicity_check show the evolution of O - N distances over an amino acid sequence&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting|Script Library]]&lt;/div&gt;</summary>
		<author><name>Avelldiroll</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8311</id>
		<title>Helicity check</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8311"/>
		<updated>2007-04-02T20:25:49Z</updated>

		<summary type="html">&lt;p&gt;Avelldiroll: helicity_check show the evolution of O - N distances over an amino acid sequence&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;helicity_check show the evolution of O - N distances over an amino acid sequence&lt;br /&gt;
&lt;br /&gt;
See for further info:&lt;br /&gt;
&lt;br /&gt;
Protein Sci ROHL and DOIG 5 (8) 1687&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Models for the 3(10)-helix/coil, pi-helix/coil, and alpha-helix/3(10)-helix/coil transitions in isolated peptides.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
uses:&lt;br /&gt;
*in the pymol console:&lt;br /&gt;
  &amp;gt;run pymol_helicity_check.py&lt;br /&gt;
    ----&amp;gt; select some consecutive amino acids&lt;br /&gt;
           - this is nicely done with the Display-&amp;gt;Sequence tool&lt;br /&gt;
  &amp;gt;helicity_check()&lt;br /&gt;
*installing helicity_check&lt;br /&gt;
  copy pymol_helicity_check.py in $PYMOL_INSTALL_DIR/modules/pmg_tk/startup&lt;br /&gt;
  launch Pymol: you now have a new option in the Plugin menu&lt;br /&gt;
 &lt;br /&gt;
helicity_check uses gnuplot (http://www.gnuplot.info) to display its results.&lt;br /&gt;
As a consequence gnuplot needs to be installed.&lt;br /&gt;
 &lt;br /&gt;
This plugin was tested on linux only, it my need some modifications to run on&lt;br /&gt;
other OSes. (hints: launching gnuplot and path to dumpfile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# pymol_helicity_check.py&lt;br /&gt;
# Copyright (c) 2006-2007 Julien Lefeuvre &amp;lt;lefeuvrejulien@yahoo.fr&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
Pymol plugin for checking helicity type&lt;br /&gt;
&lt;br /&gt;
helicity_check() takes as input a selection ('sele' by default)&lt;br /&gt;
of at least 5 amino acids and computes the distances between&lt;br /&gt;
O(i) - N(i+3)&lt;br /&gt;
O(i) - N(i+4)&lt;br /&gt;
O(i) - N(i+5)&lt;br /&gt;
See for further info:&lt;br /&gt;
Protein Sci ROHL and DOIG 5 (8) 1687&lt;br /&gt;
'Models for the 3(10)-helix/coil, pi-helix/coil,&lt;br /&gt;
and alpha-helix/3(10)-helix/coil transitions in isolated peptides.'&lt;br /&gt;
&lt;br /&gt;
uses:&lt;br /&gt;
*in the pymol console:&lt;br /&gt;
  &amp;gt;run pymol_helicity_check.py&lt;br /&gt;
    ----&amp;gt; select some consecutive amino acids&lt;br /&gt;
           - this is nicely done with the Display-&amp;gt;Sequence tool&lt;br /&gt;
  &amp;gt;helicity_check()&lt;br /&gt;
*installing helicity_check&lt;br /&gt;
  copy pymol_helicity_check.py in $PYMOL_INSTALL_DIR/modules/pmg_tk/startup&lt;br /&gt;
  launch Pymol: you now have a new option in the Plugin menu&lt;br /&gt;
&lt;br /&gt;
helicity_check uses gnuplot (http://www.gnuplot.info) to display its results&lt;br /&gt;
As a consequence gnuplot needs to be installed.&lt;br /&gt;
&lt;br /&gt;
This plugin was tested on linux only, it my need some modifications to run on&lt;br /&gt;
other OSes (hints: launching gnuplot and path to dumpfile)&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__author__ =    &amp;quot;Julien Lefeuvre &amp;lt;lefeuvrejulien@yahoo.fr&amp;gt;&amp;quot;&lt;br /&gt;
__version__ =   &amp;quot;1.0&amp;quot;&lt;br /&gt;
__date__ =      &amp;quot;2007-04-02&amp;quot;&lt;br /&gt;
__copyright__ = &amp;quot;Copyright (c) 2007 %s. All rights reserved.&amp;quot; % __author__&lt;br /&gt;
__licence__ =   &amp;quot;BSD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
from math import sqrt&lt;br /&gt;
import sys&lt;br /&gt;
import subprocess&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def __init__(self):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;init function in order to have a nice menu option in Pymol&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    self.menuBar.addmenuitem('Plugin', 'command', 'Helicity Check',&lt;br /&gt;
             label='Helicity Check', command = lambda: helicity_check())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Residue(object):&lt;br /&gt;
&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        self.name=None&lt;br /&gt;
        self.index=None&lt;br /&gt;
        self.Ocoord=None&lt;br /&gt;
        self.Ncoord=None&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def calc_distON(Ocoord,Ncoord):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;return the distance between 2 atoms given their coordinates&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    sum = 0&lt;br /&gt;
    for o, n in zip(Ocoord, Ncoord):&lt;br /&gt;
        sum += (o - n)**2&lt;br /&gt;
    return sqrt(sum)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def helicity_check(selection='sele'):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;calcultate distance O[res i]-N[res i+3]&lt;br /&gt;
                           O[res i]-N[res i+4]&lt;br /&gt;
                           O[res i]-N[res i+5]&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    seq_model = cmd.get_model(selection) #get info from selection&lt;br /&gt;
    res_lim = seq_model.get_residues()&lt;br /&gt;
&lt;br /&gt;
    if len(res_lim)&amp;lt;5:&lt;br /&gt;
        sys.stderr.write(&amp;quot;\nPlease select at least 5 residues\n&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    atom_list = seq_model.atom&lt;br /&gt;
    res_data=[]&lt;br /&gt;
&lt;br /&gt;
    for start,end in res_lim:   #extract the data we are interested in&lt;br /&gt;
        res=Residue()&lt;br /&gt;
        for atom in atom_list[start:end]:&lt;br /&gt;
            if atom.name == 'N':&lt;br /&gt;
                res.name = atom.resn&lt;br /&gt;
                res.index = atom.resi&lt;br /&gt;
                res.Ncoord = atom.coord&lt;br /&gt;
            elif atom.name == 'O':&lt;br /&gt;
                res.Ocoord = atom.coord&lt;br /&gt;
        if res.Ocoord and res.Ncoord and res.name and res.index:&lt;br /&gt;
            res_data.append(res)&lt;br /&gt;
        else:&lt;br /&gt;
            sys.stderr.write(&amp;quot;\nPlease select complete protein residues\n&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
    res_list = [int(res.index) for res in res_data]&lt;br /&gt;
&lt;br /&gt;
    if res_list != range(res_list[0], res_list[-1]+1):&lt;br /&gt;
        sys.stderr.write(&amp;quot;\nPlease select a unbrocken residue sequence\n&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    distON3 = []&lt;br /&gt;
    distON4 = []&lt;br /&gt;
    distON5 = []&lt;br /&gt;
    distONs = [distON3, distON4, distON5]&lt;br /&gt;
&lt;br /&gt;
    for i,res in enumerate(res_data[:-5]): #distances calculations&lt;br /&gt;
        resis = res_data[i+3:i+6]&lt;br /&gt;
        for resi, distONi in zip(resis, distONs):&lt;br /&gt;
            distONi.append(calc_distON(res.Ocoord, resi.Ncoord))&lt;br /&gt;
&lt;br /&gt;
    dump = '/tmp/helixdists.tmp'&lt;br /&gt;
    dumpfile = file(dump,'w')&lt;br /&gt;
&lt;br /&gt;
    sys.stdout.write('\n#Distances O(i)---N(i+n)\n'&lt;br /&gt;
           '#ResNum , d(O(i)-N(i+3)) , d(O(i)-N(i+4)) , d(O(i)-N(i+4))\n')&lt;br /&gt;
    for i, d3, d4, d5 in zip(res_list, distON3, distON4, distON5):&lt;br /&gt;
        #writing console output&lt;br /&gt;
        sys.stdout.write(&lt;br /&gt;
              '  %i ,      %f ,       %f ,       %f \n'%(i, d3, d4, d5))&lt;br /&gt;
        #writing data to a dump file for use by gnuplot&lt;br /&gt;
        dumpfile.write(&lt;br /&gt;
              '  %i       %f        %f        %f \n'%(i, d3, d4, d5))&lt;br /&gt;
&lt;br /&gt;
    #launch a gnuplot window to show the distances&lt;br /&gt;
    gnuplotcmd = subprocess.Popen(['/usr/bin/gnuplot'], shell=True,&lt;br /&gt;
                               stdin=subprocess.PIPE)&lt;br /&gt;
    gnuplotcmd.stdin.write('set autoscale\n')&lt;br /&gt;
    gnuplotcmd.stdin.write(&amp;quot;plot &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:2 title 'd(O(i)-N(i+3))' with lines, &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:3 title 'd(O(i)-N(i+4))' with lines, &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:4 title 'd(O(i)-N(i+5))' with lines\n'&amp;quot;&lt;br /&gt;
                          % (dump, dump, dump))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Avelldiroll</name></author>
	</entry>
</feed>