<div dir="ltr">it is caused by the occupancy value -1 in atom:<br><pre><code>ATOM   1886  CA AHIS X 244     -26.757  46.527  49.179 -1.00 44.13           C  </code></pre>It is a disordered atom. in Atom.py, <br><span style="font-family:monospace"><br>class DisorderedAtom(DisorderedEntityWrapper):<br>    def __init__(self, id):<br>        self.last_occupancy=-1<br>        DisorderedEntityWrapper.__init__(self, id)</span><br><br><div class="gmail_extra"><br><div class="gmail_quote">self.last_occupancy is initialized to -1 and later used to help decide which disordered atom will be selected as representative:<br><br><span style="font-family:monospace">    def disordered_add(self, atom):<br>        ...<br>        if occupancy&gt;self.last_occupancy:<br>            self.last_occupancy=occupancy<br>            self.disordered_select(altloc)</span><br><br><br></div><div class="gmail_quote">Since the atom already has -1 occupancy, the comparison was not satisfied and the atom is not selected though there was only one disordered atom at that moment. Hence NoneType error.<br><br>The fix would to initialize self.last_occupancy to some value unrealistically smaller (as occupancy value):<br><br><span style="font-family:monospace">        self.last_occupancy=-9999</span>99<br></div><br></div><div class="gmail_extra">since occupancy value occupies col 55-60 (6 digits). It can never get smaller than -999999 and this issue will never appear again.<br><br></div><div class="gmail_extra">cheers, Hongbo<br></div></div>