Hi Joe,

There can be atoms without coordinates. In particular, when loading mmCIF 
files, PyMOL fills in dummy-CA atoms for missing residues, to provide a 
complete sequence display in the sequence viewer.

"alter" iterates over all atoms, including those without coordinates. 
"iterate_state" only includes those *with* coordinates.

Your issue can be handled in several ways:

1) Make a selection on the atoms with coordinates in state 1:
   select mysele, state 1, enable=0
   alter mysele, b = next(di)
   spectrum b, selection=mysele

2) Or just remove atoms which don't have coordinates in state 1:
   remove not state 1
   alter all, b = next(di)
   spectrum b

See "Coordinates" section here:
https://pymolwiki.org/index.php/Selection_Algebra

Cheers,
  Thomas

> On Sep 12, 2019, at 6:09 PM, Heffron, Joseph <joseph.heff...@marquette.edu> 
> wrote:
> 
> Hello all, 
> 
> I am trying to color several proteins by different factors, e.g., distance 
> from a given point (here the origin). To do this, I replace the q-factor (or 
> b-factor) with my variable of choice. However, most of my files have one or a 
> few residues that are for some reason not affected by the alter_state (e.g., 
> pdb = 1ihm). I can't see any distinction in these residues compared to the 
> others.  
> 
> example code: 
> 
>     fetch 1ihm
>     alldist = []
>     iterate_state 1, all, alldist.append((x**2+y**2+z**2)**0.5)
>     di = iter(alldist)
>     alter all, b = next(di)
>     spectrum b
> 
> Thank you, 
> Joe 
> _______________________________________________
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe: 
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.



_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Reply via email to