Hi Mungo,

Introspecting the settings wrapper is a bit more tricky, but also possible:

from pymol import setting, stored
stored.s2dict = lambda s: dict((setting.name_dict[n], s[n]) for n in s)
iterate all, print(stored.s2dict(s))


I've updated the print() syntax in the documentation, thanks for the hint 
Blaine!

Cheers,
  Thomas


> On May 19, 2020, at 1:12 PM, Mungo Carstairs (Staff) 
> <g.m.carsta...@dundee.ac.uk> wrote:
> 
> Hi Blaine,
> 
> Thanks for that!
> 
> And is there an equivalent for the settings in 's'?
> So for example I can
> PyMOL> iterate 4zho//A/26/CA,print(s.transparency)
> PyMOL> 0.0
> but how to find all values in 's'?
> 
> Best regards,
> 
> Mungo
> 
> 
> 
>  
>                       
> Mungo Carstairs
> Jalview Computational Scientist
> The Barton Group
> Division of Computational Biology
> School of Life Sciences
> University of Dundee, Dundee, Scotland, UK
> www.jalview.org
> www.compbio.dundee.ac.uk 
> g.m.carsta...@dundee.ac.uk
>       
> We're Scottish University of the Year again!
> The Times / Sunday Times Good University Guide 2016 and 2017
> From: Mooers, Blaine H.M. (HSC) <blaine-moo...@ouhsc.edu>
> Sent: 19 May 2020 11:47
> To: Mungo Carstairs (Staff) <g.m.carsta...@dundee.ac.uk>; 
> pymol-users@lists.sourceforge.net<pymol-users@lists.sourceforge.net>
> Subject: RE: How to inspect contents of 's' and 'p' for an atom?
>  
> Hi Mungo,
> 
> See https://pymol.org/dokuwiki/doku.php?id=properties.
> 
> This command will print the dictionary of properties for all of the atoms:
> 
> iterate /4zho//A/*/*, print(properties.all)
> 
> Note the Python3 print() function.
> The documentation needs to be updated.
> 
> Best regards,
> 
> Blaine
> 
> Blaine Mooers, Ph.D.
> Associate Professor
> Department of Biochemistry and Molecular Biology
> College of Medicine
> University of Oklahoma Health Sciences Center
> S.L. Young Biomedical Research Center (BRC) Rm. 466
> 975 NE 10th Street, BRC 466
> Oklahoma City, OK 73104-5419
> 
> ________________________________________
> From: Mungo Carstairs (Staff) [g.m.carsta...@dundee.ac.uk]
> Sent: Tuesday, May 19, 2020 2:59 AM
> To: pymol-users@lists.sourceforge.net
> Subject: [EXTERNAL] [PyMOL] How to inspect contents of 's' and 'p' for an 
> atom?
> 
> A PyMOL novice question here.
> 
> I can write custom atom properties to its 'p' dictionary, and print them:
> PyMOL>fetch 4zho
> 
> PyMOL>iterate 4zho//A/26/CA, p.metal_binding='Fe'
> 
> PyMOL>iterate 4zho//A/26/CA, print(p.metal_binding)
> 
> Fe
> 
> but how do I list the contents of the dictionary if I don't know what is in 
> it?
> PyMOL>iterate 4zho//A/26/CA, print(p)
> <wrapper.PropertyWrapper object at 0x1140dcdb0>
> 
> Same question for 's':
> PyMOL>iterate 4zho//A/26/CA, print(s)
> <wrapper.SettingWrapper object at 0x1140dcdb0>
> 
> Better still, where would I find documentation for this?
> 
> Thanks,
> 
> Mungo
> 
> 
> Mungo Carstairs
> Jalview Computational Scientist
> 
> The Barton Group
> Division of Computational Biology
> 
> School of Life Sciences
> 
> University of Dundee, Dundee, Scotland, UK

--
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