<?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=Helicity_check</id>
	<title>Helicity check - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Helicity_check"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;action=history"/>
	<updated>2026-05-04T15:40:41Z</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=Helicity_check&amp;diff=13313&amp;oldid=prev</id>
		<title>Bell: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=13313&amp;oldid=prev"/>
		<updated>2015-11-16T05:01:05Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:01, 16 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Bell</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=13312&amp;oldid=prev</id>
		<title>Bell at 18:07, 31 October 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=13312&amp;oldid=prev"/>
		<updated>2015-10-31T18:07:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:07, 31 October 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Bell</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=13158&amp;oldid=prev</id>
		<title>Bell at 18:06, 31 October 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=13158&amp;oldid=prev"/>
		<updated>2015-10-31T18:06:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:06, 31 October 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l168&quot; &gt;Line 168:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 168:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Download==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Download==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Media:Helicity_check-1.0.tar.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;bz2&lt;/del&gt;|Helicity_check-1.0.tar.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;bz2&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Media:Helicity_check-1.0.tar.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zip&lt;/ins&gt;|Helicity_check-1.0.tar.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;zip&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Plugins]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Plugins]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Script_Library|Helicity Check]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Script_Library|Helicity Check]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Structural_Biology_Scripts]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Structural_Biology_Scripts]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bell</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8320&amp;oldid=prev</id>
		<title>Bell: 9 revisions</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8320&amp;oldid=prev"/>
		<updated>2014-03-28T03:06:31Z</updated>

		<summary type="html">&lt;p&gt;9 revisions&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:06, 28 March 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Bell</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=7791&amp;oldid=prev</id>
		<title>Pyadmin: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=7791&amp;oldid=prev"/>
		<updated>2014-03-28T02:16:15Z</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;'''helicity_check''' shows the evolution of O&amp;amp;mdash;N distances over an amino acid sequence&lt;br /&gt;
&lt;br /&gt;
See for further info:&lt;br /&gt;
&lt;br /&gt;
[http://www.proteinscience.org/cgi/content/abstract/5/8/1687 &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;]. ''Protein Sci'' ROHL and DOIG 5 (8) 1687.&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  [http://www.gnuplot.info gnuplot] 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;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[[Media:Helicity_check-1.0.tar.bz2|Helicity_check-1.0.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Script_Library|Helicity Check]]&lt;br /&gt;
[[Category:Structural_Biology_Scripts]]&lt;/div&gt;</summary>
		<author><name>Pyadmin</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8316&amp;oldid=prev</id>
		<title>Desastre at 17:44, 12 January 2008</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8316&amp;oldid=prev"/>
		<updated>2008-01-12T17:44:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''helicity_check''' shows 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;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[[Media:Helicity_check-1.0.tar.bz2|Helicity_check-1.0.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Script_Library|Helicity Check]]&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8313&amp;oldid=prev</id>
		<title>Avelldiroll at 18:52, 20 April 2007</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8313&amp;oldid=prev"/>
		<updated>2007-04-20T18:52:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:52, 20 April 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l20&quot; &gt;Line 20:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As a consequence gnuplot needs to be installed.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As a consequence gnuplot needs to be installed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This plugin was tested on linux only, it &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;my &lt;/del&gt;need some modifications to run on&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This plugin was tested on linux only, it &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;might &lt;/ins&gt;need some modifications to run on&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;other OSes. (hints: launching gnuplot and path to dumpfile)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;other OSes. (hints: launching gnuplot and path to dumpfile)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Avelldiroll</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8312&amp;oldid=prev</id>
		<title>Avelldiroll: update to improve portability</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8312&amp;oldid=prev"/>
		<updated>2007-04-03T12:44:51Z</updated>

		<summary type="html">&lt;p&gt;update to improve portability&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:44, 3 April 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l68&quot; &gt;Line 68:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 68:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from math import sqrt&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from math import sqrt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import sys&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import sys&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;import os&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import subprocess&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import subprocess&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;import time&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;def __init__(self):&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;def __init__(self):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l140&quot; &gt;Line 140:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 141:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             distONi.append(calc_distON(res.Ocoord, resi.Ncoord))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             distONi.append(calc_distON(res.Ocoord, resi.Ncoord))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     dump = '&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;/tmp/helixdists&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;tmp&lt;/del&gt;'&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     dump = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;os.tmpnam()+&lt;/ins&gt;'.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dat&lt;/ins&gt;'&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     dumpfile = file(dump,'w')&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     dumpfile = file(dump, 'w')&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     sys.stdout.write('\n#Distances O(i)---N(i+n)\n'&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     sys.stdout.write('\n#Distances O(i)---N(i+n)\n'&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l152&quot; &gt;Line 152:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 153:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         dumpfile.write(&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         dumpfile.write(&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               '  %i       %f        %f        %f \n'%(i, d3, d4, d5))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               '  %i       %f        %f        %f \n'%(i, d3, d4, d5))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    dumpfile.flush()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     #launch a gnuplot window to show the distances&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     #launch a gnuplot window to show the distances&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l162&quot; &gt;Line 162:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 164:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          &amp;quot;'%s' using 1:4 title 'd(O(i)-N(i+5))' with lines\n'&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          &amp;quot;'%s' using 1:4 title 'd(O(i)-N(i+5))' with lines\n'&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                           % (dump, dump, dump))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                           % (dump, dump, dump))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    time.sleep(3)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    dumpfile.close()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    os.remove(dump)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Avelldiroll</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8311&amp;oldid=prev</id>
		<title>Avelldiroll: helicity_check show the evolution of O - N distances over an amino acid sequence</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8311&amp;oldid=prev"/>
		<updated>2007-04-02T20:25:49Z</updated>

		<summary type="html">&lt;p&gt;helicity_check show the evolution of O - N distances over an amino acid sequence&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&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>