<?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=WriteSS</id>
	<title>WriteSS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=WriteSS"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=WriteSS&amp;action=history"/>
	<updated>2026-07-09T08:02:38Z</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=WriteSS&amp;diff=9177&amp;oldid=prev</id>
		<title>Bell: 5 revisions</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=WriteSS&amp;diff=9177&amp;oldid=prev"/>
		<updated>2014-03-28T03:36:28Z</updated>

		<summary type="html">&lt;p&gt;5 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:36, 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=WriteSS&amp;diff=9176&amp;oldid=prev</id>
		<title>Newacct at 08:14, 27 November 2009</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=WriteSS&amp;diff=9176&amp;oldid=prev"/>
		<updated>2009-11-27T08:14:58Z</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;== Overview ==&lt;br /&gt;
This script will write the secondary structural elements for each PDB file in some specified directory, for each alpha carbon in the protein, to an output text file.  Residues without secondary structure definition will get a &amp;quot;.&amp;quot; in the string.&lt;br /&gt;
&lt;br /&gt;
This is untested code and has little chance of working for anyone but me.  Although, it does work for me.&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
# Copy the code to your machine&lt;br /&gt;
# Find '''FIXME''' in the code below and change &amp;quot;files&amp;quot; to either a glob like the one already there (for a whole directory) or a list with one element (for just one file).&lt;br /&gt;
# change the output filename.  By default it's '''PDBCODE.ss'''.&lt;br /&gt;
&lt;br /&gt;
== The Code ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
import os.path&lt;br /&gt;
import glob&lt;br /&gt;
&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
from pymol import stored&lt;br /&gt;
from pymol import selector&lt;br /&gt;
&lt;br /&gt;
files = glob.glob(&amp;quot;/tmp/thy_model/*.pdb&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
for file in files:&lt;br /&gt;
        pdbName = os.path.basename(file).split(&amp;quot;.&amp;quot;)[0]&lt;br /&gt;
        cmd.load(file, pdbName)&lt;br /&gt;
        outFile = open(pdbName + '.ss', 'wb')&lt;br /&gt;
        stored.ss = &amp;quot;&amp;quot;&lt;br /&gt;
        cmd.iterate( '(n. CA)', 'stored.ss = stored.ss + (&amp;quot;%1s&amp;quot;%ss)')&lt;br /&gt;
        for c in stored.ss:&lt;br /&gt;
                if c  == &amp;quot; &amp;quot;:&lt;br /&gt;
                        outFile.write('.')&lt;br /&gt;
                else:&lt;br /&gt;
                        outFile.write(c)&lt;br /&gt;
        cmd.delete(pdbName)&lt;br /&gt;
        outFile.close()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
python ss.pym  # my directory has 1d7p.pdb in it&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
output for 1D7P.pdb:&lt;br /&gt;
&lt;br /&gt;
 ...............HHH.......SSS..SSSHHHHH..................................................................SS..SS..................................................&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library|Write SS]]&lt;br /&gt;
[[Category:Structural_Biology_Scripts]]&lt;/div&gt;</summary>
		<author><name>Newacct</name></author>
	</entry>
</feed>