n>
    <span class="c1"># convention to what Pymol expects</span>
    <span class="n">state_mapping</span> <span class="o">=</span> <span class="p">{</span>
        <span class="s2">&quot;H&quot;</span><span class="p">:</span> <span class="s2">&quot;H&quot;</span><span class="p">,</span>
        <span class="s2">&quot;E&quot;</span><span class="p">:</span> <span class="s2">&quot;S&quot;</span><span class="p">,</span>
    <span class="p">}</span>

    <span class="c1"># go through all residues</span>
    <sp