From: John R. <lam...@gm...> - 2011-02-17 07:20:39
|
Hi, I'm sorry for making such beginner's questions but searching the manual, google or the wiki didn't help me. I know how to extend pymol by writing python functions (through the extend command). But is it possible to do the opposite? I want to write a script that loads a molecule, does something to it and then displays the pymol window or outputs a png file. I want to this without having to enter commands in the pymol command line, since I need to put these operations in a script, without interactive control on pymol. Example. I want to write a script examply.py with which I can do ./examply.py mymolecule.xyz And for output I want to get mymolecule.png or the pymol window with all the operations already done. Any hints? Thank you. John |
From: Tsjerk W. <ts...@gm...> - 2011-02-17 07:33:18
|
Hi John, Is this what you're looking for?: http://www.pymolwiki.org/index.php/Launching_From_a_Script Cheers, Tsjerk On Thu, Feb 17, 2011 at 8:19 AM, John Russo <lam...@gm...> wrote: > Hi, > I'm sorry for making such beginner's questions but searching the manual, > google > or the wiki didn't help me. > > I know how to extend pymol by writing python functions (through the > extend command). > But is it possible to do the opposite? I want to write a script that > loads a molecule, does something > to it and then displays the pymol window or outputs a png file. I want > to this without having to > enter commands in the pymol command line, since I need to put these > operations in a script, > without interactive control on pymol. > > Example. I want to write a script examply.py with which I can do > > ./examply.py mymolecule.xyz > > And for output I want to get mymolecule.png or the pymol window with all > the operations > already done. > > Any hints? Thank you. > > > John > > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... > -- Tsjerk A. Wassenaar, Ph.D. post-doctoral researcher Molecular Dynamics Group * Groningen Institute for Biomolecular Research and Biotechnology * Zernike Institute for Advanced Materials University of Groningen The Netherlands |
From: John R. <lam...@gm...> - 2011-02-17 08:06:57
|
Thanks, that is what I was looking for! I just made a simple script out of it which looks like this #!/usr/bin/env python import pymol from pymol import cmd import mymodule pymol.finish_launching() cmd.load("mymolecule.xyz") cmd.hide() cmd.show("spheres") mymodule.dosomething() I've noticed something strange though. The dosomething() function just colors atoms according to some order parameter. If I execute in the script above it is quite slow, I can see individual atoms being colored. Instead if I execute dosomething() from within the pymol interpreter it is much faster. Any reason for this? On 02/17/2011 04:33 PM, Tsjerk Wassenaar wrote: > Hi John, > > Is this what you're looking for?: > > http://www.pymolwiki.org/index.php/Launching_From_a_Script > > Cheers, > > Tsjerk > > On Thu, Feb 17, 2011 at 8:19 AM, John Russo<lam...@gm...> wrote: >> Hi, >> I'm sorry for making such beginner's questions but searching the manual, >> google >> or the wiki didn't help me. >> >> I know how to extend pymol by writing python functions (through the >> extend command). >> But is it possible to do the opposite? I want to write a script that >> loads a molecule, does something >> to it and then displays the pymol window or outputs a png file. I want >> to this without having to >> enter commands in the pymol command line, since I need to put these >> operations in a script, >> without interactive control on pymol. >> >> Example. I want to write a script examply.py with which I can do >> >> ./examply.py mymolecule.xyz >> >> And for output I want to get mymolecule.png or the pymol window with all >> the operations >> already done. >> >> Any hints? Thank you. >> >> >> John >> >> >> >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> PyMOL-users mailing list (PyM...@li...) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pym...@li... >> > > |
From: David H. <li...@co...> - 2011-02-17 11:01:14
|
No idea if this will fix your problem, but what I've found is portable across binaries from Delano Scientific/Schroedinger and OS/self-compiled versions of pymol is to instead run: pymol -r examply.py -- mymolecule.xyz (or if I'm making pngs, usually pymol -qrck examply.py -- mymolecule.xyz ) The -- makes it so mymolecule.xyz is passed as an argument to the python script instead of as an argument to pymol Then examply.py is just from pymol import cmd import argv import mymodule cmd.load(sys.argv[1]) cmd.hide() cmd.show("spheres") mymodule.dosomething() Note, that pymol has to be able to find mymodule, which if you're using a Delano Scientific/Schrodinger binary can be annoying, but it looks like that is already working for you. Also, http://pymolwiki.org/index.php/Python_Integration makes it look like pymol -l examply.py -- mymolecule.xyz may work, but I've never done it, so no idea how the behavior differs. -David On Thu, Feb 17, 2011 at 3:05 AM, John Russo <lam...@gm...> wrote: > Thanks, that is what I was looking for! I just made a simple > script out of it which looks like this > > #!/usr/bin/env python > > import pymol > from pymol import cmd > import mymodule > > pymol.finish_launching() > > cmd.load("mymolecule.xyz") > cmd.hide() > cmd.show("spheres") > mymodule.dosomething() > > > I've noticed something strange though. The dosomething() function just > colors atoms according to some order parameter. If I execute in the script > above it is quite slow, I can see individual atoms being colored. Instead if > I execute dosomething() from within the pymol interpreter it is much faster. > Any reason for this? > > > > > > > On 02/17/2011 04:33 PM, Tsjerk Wassenaar wrote: >> Hi John, >> >> Is this what you're looking for?: >> >> http://www.pymolwiki.org/index.php/Launching_From_a_Script >> >> Cheers, >> >> Tsjerk >> >> On Thu, Feb 17, 2011 at 8:19 AM, John Russo<lam...@gm...> wrote: >>> Hi, >>> I'm sorry for making such beginner's questions but searching the manual, >>> google >>> or the wiki didn't help me. >>> >>> I know how to extend pymol by writing python functions (through the >>> extend command). >>> But is it possible to do the opposite? I want to write a script that >>> loads a molecule, does something >>> to it and then displays the pymol window or outputs a png file. I want >>> to this without having to >>> enter commands in the pymol command line, since I need to put these >>> operations in a script, >>> without interactive control on pymol. >>> >>> Example. I want to write a script examply.py with which I can do >>> >>> ./examply.py mymolecule.xyz >>> >>> And for output I want to get mymolecule.png or the pymol window with all >>> the operations >>> already done. >>> >>> Any hints? Thank you. >>> >>> >>> John >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>> Pinpoint memory and threading errors before they happen. >>> Find and fix more than 250 security defects in the development cycle. >>> Locate bottlenecks in serial and parallel code that limit performance. >>> http://p.sf.net/sfu/intel-dev2devfeb >>> _______________________________________________ >>> PyMOL-users mailing list (PyM...@li...) >>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>> Archives: http://www.mail-archive.com/pym...@li... >>> >> >> > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... > |
From: John R. <lam...@gm...> - 2011-02-17 11:22:31
|
Thank you, this indeed solves the problem! Now everything seems to work smoothely. I also set an alias to mypymol="pyplot -r script.py -- " so now everything is very simple. Thanks to all for the help. John On 02/17/2011 07:30 PM, David Hall wrote: > No idea if this will fix your problem, but what I've found is portable > across binaries from Delano Scientific/Schroedinger and > OS/self-compiled versions of pymol is to instead run: > > pymol -r examply.py -- mymolecule.xyz > > (or if I'm making pngs, usually pymol -qrck examply.py -- mymolecule.xyz ) > > The -- makes it so mymolecule.xyz is passed as an argument to the > python script instead of as an argument to pymol > > Then examply.py is just > > from pymol import cmd > import argv > import mymodule > > cmd.load(sys.argv[1]) > cmd.hide() > cmd.show("spheres") > mymodule.dosomething() > > > Note, that pymol has to be able to find mymodule, which if you're > using a Delano Scientific/Schrodinger binary can be annoying, but it > looks like that is already working for you. > > Also, http://pymolwiki.org/index.php/Python_Integration makes it look like > pymol -l examply.py -- mymolecule.xyz > > may work, but I've never done it, so no idea how the behavior differs. > > -David > > > On Thu, Feb 17, 2011 at 3:05 AM, John Russo<lam...@gm...> wrote: >> Thanks, that is what I was looking for! I just made a simple >> script out of it which looks like this >> >> #!/usr/bin/env python >> >> import pymol >> from pymol import cmd >> import mymodule >> >> pymol.finish_launching() >> >> cmd.load("mymolecule.xyz") >> cmd.hide() >> cmd.show("spheres") >> mymodule.dosomething() >> >> >> I've noticed something strange though. The dosomething() function just >> colors atoms according to some order parameter. If I execute in the script >> above it is quite slow, I can see individual atoms being colored. Instead if >> I execute dosomething() from within the pymol interpreter it is much faster. >> Any reason for this? >> >> >> >> >> >> >> On 02/17/2011 04:33 PM, Tsjerk Wassenaar wrote: >>> Hi John, >>> >>> Is this what you're looking for?: >>> >>> http://www.pymolwiki.org/index.php/Launching_From_a_Script >>> >>> Cheers, >>> >>> Tsjerk >>> >>> On Thu, Feb 17, 2011 at 8:19 AM, John Russo<lam...@gm...> wrote: >>>> Hi, >>>> I'm sorry for making such beginner's questions but searching the manual, >>>> google >>>> or the wiki didn't help me. >>>> >>>> I know how to extend pymol by writing python functions (through the >>>> extend command). >>>> But is it possible to do the opposite? I want to write a script that >>>> loads a molecule, does something >>>> to it and then displays the pymol window or outputs a png file. I want >>>> to this without having to >>>> enter commands in the pymol command line, since I need to put these >>>> operations in a script, >>>> without interactive control on pymol. >>>> >>>> Example. I want to write a script examply.py with which I can do >>>> >>>> ./examply.py mymolecule.xyz >>>> >>>> And for output I want to get mymolecule.png or the pymol window with all >>>> the operations >>>> already done. >>>> >>>> Any hints? Thank you. >>>> >>>> >>>> John >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>>> Pinpoint memory and threading errors before they happen. >>>> Find and fix more than 250 security defects in the development cycle. >>>> Locate bottlenecks in serial and parallel code that limit performance. >>>> http://p.sf.net/sfu/intel-dev2devfeb >>>> _______________________________________________ >>>> PyMOL-users mailing list (PyM...@li...) >>>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>>> Archives: http://www.mail-archive.com/pym...@li... >>>> >>> >> >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> PyMOL-users mailing list (PyM...@li...) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pym...@li... >> |
From: John R. <lam...@gm...> - 2011-02-18 07:47:47
|
I'm sorry to bother this mailing list so much but it seems that I cannot save images. This is the script examply.py from pymol import cmd cmd.load(sys.argv[1]) cmd.hide() cmd.show("spheres") cmd.set('sphere_scale',0.3) cmd.set('orthoscopic',1) cmd.png("printme.png") which I execute like this: pymol -qrc examply.py -- mymolecule.xyz But I don't get the file printme.png. Executing the script interactively pymol -r examply.py -- mymolecule.xyz I can see that the molecule looks ok but still I don't get a png image. I have to type "png printme.png" in the pymol command line to get it. Does anybody now why is this? Thanks. On 02/17/2011 07:30 PM, David Hall wrote: > No idea if this will fix your problem, but what I've found is portable > across binaries from Delano Scientific/Schroedinger and > OS/self-compiled versions of pymol is to instead run: > > pymol -r examply.py -- mymolecule.xyz > > (or if I'm making pngs, usually pymol -qrck examply.py -- mymolecule.xyz ) > > The -- makes it so mymolecule.xyz is passed as an argument to the > python script instead of as an argument to pymol > > Then examply.py is just > > from pymol import cmd > import argv > import mymodule > > cmd.load(sys.argv[1]) > cmd.hide() > cmd.show("spheres") > mymodule.dosomething() > > > Note, that pymol has to be able to find mymodule, which if you're > using a Delano Scientific/Schrodinger binary can be annoying, but it > looks like that is already working for you. > > Also, http://pymolwiki.org/index.php/Python_Integration makes it look like > pymol -l examply.py -- mymolecule.xyz > > may work, but I've never done it, so no idea how the behavior differs. > > -David > > > On Thu, Feb 17, 2011 at 3:05 AM, John Russo<lam...@gm...> wrote: >> Thanks, that is what I was looking for! I just made a simple >> script out of it which looks like this >> >> #!/usr/bin/env python >> >> import pymol >> from pymol import cmd >> import mymodule >> >> pymol.finish_launching() >> >> cmd.load("mymolecule.xyz") >> cmd.hide() >> cmd.show("spheres") >> mymodule.dosomething() >> >> >> I've noticed something strange though. The dosomething() function just >> colors atoms according to some order parameter. If I execute in the script >> above it is quite slow, I can see individual atoms being colored. Instead if >> I execute dosomething() from within the pymol interpreter it is much faster. >> Any reason for this? >> >> >> >> >> >> >> On 02/17/2011 04:33 PM, Tsjerk Wassenaar wrote: >>> Hi John, >>> >>> Is this what you're looking for?: >>> >>> http://www.pymolwiki.org/index.php/Launching_From_a_Script >>> >>> Cheers, >>> >>> Tsjerk >>> >>> On Thu, Feb 17, 2011 at 8:19 AM, John Russo<lam...@gm...> wrote: >>>> Hi, >>>> I'm sorry for making such beginner's questions but searching the manual, >>>> google >>>> or the wiki didn't help me. >>>> >>>> I know how to extend pymol by writing python functions (through the >>>> extend command). >>>> But is it possible to do the opposite? I want to write a script that >>>> loads a molecule, does something >>>> to it and then displays the pymol window or outputs a png file. I want >>>> to this without having to >>>> enter commands in the pymol command line, since I need to put these >>>> operations in a script, >>>> without interactive control on pymol. >>>> >>>> Example. I want to write a script examply.py with which I can do >>>> >>>> ./examply.py mymolecule.xyz >>>> >>>> And for output I want to get mymolecule.png or the pymol window with all >>>> the operations >>>> already done. >>>> >>>> Any hints? Thank you. >>>> >>>> >>>> John >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>>> Pinpoint memory and threading errors before they happen. >>>> Find and fix more than 250 security defects in the development cycle. >>>> Locate bottlenecks in serial and parallel code that limit performance. >>>> http://p.sf.net/sfu/intel-dev2devfeb >>>> _______________________________________________ >>>> PyMOL-users mailing list (PyM...@li...) >>>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>>> Archives: http://www.mail-archive.com/pym...@li... >>>> >>> >> >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> PyMOL-users mailing list (PyM...@li...) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pym...@li... >> |
From: Tsjerk W. <ts...@gm...> - 2011-02-18 07:52:16
|
Hi John, It's what we're here for. If we care not to be bothered, we can unsubscribe. Anyway, you have to raytrace the image if you don't have an OpenGL window. Add cmd.ray(xresolution,yresolution) before, or add it to the cmd.png command directly. Cheers, Tsjerk On Fri, Feb 18, 2011 at 8:46 AM, John Russo <lam...@gm...> wrote: > I'm sorry to bother this mailing list so much but it > seems that I cannot save images. > > This is the script examply.py > > from pymol import cmd > > cmd.load(sys.argv[1]) > cmd.hide() > cmd.show("spheres") > cmd.set('sphere_scale',0.3) > cmd.set('orthoscopic',1) > > cmd.png("printme.png") > > which I execute like this: > > pymol -qrc examply.py -- mymolecule.xyz > > > But I don't get the file printme.png. Executing the > script interactively > > pymol -r examply.py -- mymolecule.xyz > > I can see that the molecule looks ok but still I don't get a png image. > I have to type "png printme.png" in the pymol command line to get it. > > > Does anybody now why is this? > > Thanks. > > > On 02/17/2011 07:30 PM, David Hall wrote: >> No idea if this will fix your problem, but what I've found is portable >> across binaries from Delano Scientific/Schroedinger and >> OS/self-compiled versions of pymol is to instead run: >> >> pymol -r examply.py -- mymolecule.xyz >> >> (or if I'm making pngs, usually pymol -qrck examply.py -- mymolecule.xyz ) >> >> The -- makes it so mymolecule.xyz is passed as an argument to the >> python script instead of as an argument to pymol >> >> Then examply.py is just >> >> from pymol import cmd >> import argv >> import mymodule >> >> cmd.load(sys.argv[1]) >> cmd.hide() >> cmd.show("spheres") >> mymodule.dosomething() >> >> >> Note, that pymol has to be able to find mymodule, which if you're >> using a Delano Scientific/Schrodinger binary can be annoying, but it >> looks like that is already working for you. >> >> Also, http://pymolwiki.org/index.php/Python_Integration makes it look like >> pymol -l examply.py -- mymolecule.xyz >> >> may work, but I've never done it, so no idea how the behavior differs. >> >> -David >> >> >> On Thu, Feb 17, 2011 at 3:05 AM, John Russo<lam...@gm...> wrote: >>> Thanks, that is what I was looking for! I just made a simple >>> script out of it which looks like this >>> >>> #!/usr/bin/env python >>> >>> import pymol >>> from pymol import cmd >>> import mymodule >>> >>> pymol.finish_launching() >>> >>> cmd.load("mymolecule.xyz") >>> cmd.hide() >>> cmd.show("spheres") >>> mymodule.dosomething() >>> >>> >>> I've noticed something strange though. The dosomething() function just >>> colors atoms according to some order parameter. If I execute in the script >>> above it is quite slow, I can see individual atoms being colored. Instead if >>> I execute dosomething() from within the pymol interpreter it is much faster. >>> Any reason for this? >>> >>> >>> >>> >>> >>> >>> On 02/17/2011 04:33 PM, Tsjerk Wassenaar wrote: >>>> Hi John, >>>> >>>> Is this what you're looking for?: >>>> >>>> http://www.pymolwiki.org/index.php/Launching_From_a_Script >>>> >>>> Cheers, >>>> >>>> Tsjerk >>>> >>>> On Thu, Feb 17, 2011 at 8:19 AM, John Russo<lam...@gm...> wrote: >>>>> Hi, >>>>> I'm sorry for making such beginner's questions but searching the manual, >>>>> google >>>>> or the wiki didn't help me. >>>>> >>>>> I know how to extend pymol by writing python functions (through the >>>>> extend command). >>>>> But is it possible to do the opposite? I want to write a script that >>>>> loads a molecule, does something >>>>> to it and then displays the pymol window or outputs a png file. I want >>>>> to this without having to >>>>> enter commands in the pymol command line, since I need to put these >>>>> operations in a script, >>>>> without interactive control on pymol. >>>>> >>>>> Example. I want to write a script examply.py with which I can do >>>>> >>>>> ./examply.py mymolecule.xyz >>>>> >>>>> And for output I want to get mymolecule.png or the pymol window with all >>>>> the operations >>>>> already done. >>>>> >>>>> Any hints? Thank you. >>>>> >>>>> >>>>> John >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>>>> Pinpoint memory and threading errors before they happen. >>>>> Find and fix more than 250 security defects in the development cycle. >>>>> Locate bottlenecks in serial and parallel code that limit performance. >>>>> http://p.sf.net/sfu/intel-dev2devfeb >>>>> _______________________________________________ >>>>> PyMOL-users mailing list (PyM...@li...) >>>>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>>>> Archives: http://www.mail-archive.com/pym...@li... >>>>> >>>> >>> >>> ------------------------------------------------------------------------------ >>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>> Pinpoint memory and threading errors before they happen. >>> Find and fix more than 250 security defects in the development cycle. >>> Locate bottlenecks in serial and parallel code that limit performance. >>> http://p.sf.net/sfu/intel-dev2devfeb >>> _______________________________________________ >>> PyMOL-users mailing list (PyM...@li...) >>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>> Archives: http://www.mail-archive.com/pym...@li... >>> > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... > -- Tsjerk A. Wassenaar, Ph.D. post-doctoral researcher Molecular Dynamics Group * Groningen Institute for Biomolecular Research and Biotechnology * Zernike Institute for Advanced Materials University of Groningen The Netherlands |
From: John R. <lam...@gm...> - 2011-02-18 08:02:03
|
Thanks for the reply (and the welcome). With your suggestion I can get a raytraced image. Is there a way to get a normal/OpenGL image staying in batch mode? All those shades are quite disturbing, since real molecules don't have a shade! :-) On 02/18/2011 04:52 PM, Tsjerk Wassenaar wrote: > Hi John, > > It's what we're here for. If we care not to be bothered, we can unsubscribe. > Anyway, you have to raytrace the image if you don't have an OpenGL > window. Add cmd.ray(xresolution,yresolution) before, or add it to the > cmd.png command directly. > > Cheers, > > Tsjerk > > On Fri, Feb 18, 2011 at 8:46 AM, John Russo<lam...@gm...> wrote: >> I'm sorry to bother this mailing list so much but it >> seems that I cannot save images. >> >> This is the script examply.py >> >> from pymol import cmd >> >> cmd.load(sys.argv[1]) >> cmd.hide() >> cmd.show("spheres") >> cmd.set('sphere_scale',0.3) >> cmd.set('orthoscopic',1) >> >> cmd.png("printme.png") >> >> which I execute like this: >> >> pymol -qrc examply.py -- mymolecule.xyz >> >> >> But I don't get the file printme.png. Executing the >> script interactively >> >> pymol -r examply.py -- mymolecule.xyz >> >> I can see that the molecule looks ok but still I don't get a png image. >> I have to type "png printme.png" in the pymol command line to get it. >> >> >> Does anybody now why is this? >> >> Thanks. >> >> >> On 02/17/2011 07:30 PM, David Hall wrote: >>> No idea if this will fix your problem, but what I've found is portable >>> across binaries from Delano Scientific/Schroedinger and >>> OS/self-compiled versions of pymol is to instead run: >>> >>> pymol -r examply.py -- mymolecule.xyz >>> >>> (or if I'm making pngs, usually pymol -qrck examply.py -- mymolecule.xyz ) >>> >>> The -- makes it so mymolecule.xyz is passed as an argument to the >>> python script instead of as an argument to pymol >>> >>> Then examply.py is just >>> >>> from pymol import cmd >>> import argv >>> import mymodule >>> >>> cmd.load(sys.argv[1]) >>> cmd.hide() >>> cmd.show("spheres") >>> mymodule.dosomething() >>> >>> >>> Note, that pymol has to be able to find mymodule, which if you're >>> using a Delano Scientific/Schrodinger binary can be annoying, but it >>> looks like that is already working for you. >>> >>> Also, http://pymolwiki.org/index.php/Python_Integration makes it look like >>> pymol -l examply.py -- mymolecule.xyz >>> >>> may work, but I've never done it, so no idea how the behavior differs. >>> >>> -David >>> >>> >>> On Thu, Feb 17, 2011 at 3:05 AM, John Russo<lam...@gm...> wrote: >>>> Thanks, that is what I was looking for! I just made a simple >>>> script out of it which looks like this >>>> >>>> #!/usr/bin/env python >>>> >>>> import pymol >>>> from pymol import cmd >>>> import mymodule >>>> >>>> pymol.finish_launching() >>>> >>>> cmd.load("mymolecule.xyz") >>>> cmd.hide() >>>> cmd.show("spheres") >>>> mymodule.dosomething() >>>> >>>> >>>> I've noticed something strange though. The dosomething() function just >>>> colors atoms according to some order parameter. If I execute in the script >>>> above it is quite slow, I can see individual atoms being colored. Instead if >>>> I execute dosomething() from within the pymol interpreter it is much faster. >>>> Any reason for this? >>>> >>>> >>>> >>>> >>>> >>>> >>>> On 02/17/2011 04:33 PM, Tsjerk Wassenaar wrote: >>>>> Hi John, >>>>> >>>>> Is this what you're looking for?: >>>>> >>>>> http://www.pymolwiki.org/index.php/Launching_From_a_Script >>>>> >>>>> Cheers, >>>>> >>>>> Tsjerk >>>>> >>>>> On Thu, Feb 17, 2011 at 8:19 AM, John Russo<lam...@gm...> wrote: >>>>>> Hi, >>>>>> I'm sorry for making such beginner's questions but searching the manual, >>>>>> google >>>>>> or the wiki didn't help me. >>>>>> >>>>>> I know how to extend pymol by writing python functions (through the >>>>>> extend command). >>>>>> But is it possible to do the opposite? I want to write a script that >>>>>> loads a molecule, does something >>>>>> to it and then displays the pymol window or outputs a png file. I want >>>>>> to this without having to >>>>>> enter commands in the pymol command line, since I need to put these >>>>>> operations in a script, >>>>>> without interactive control on pymol. >>>>>> >>>>>> Example. I want to write a script examply.py with which I can do >>>>>> >>>>>> ./examply.py mymolecule.xyz >>>>>> >>>>>> And for output I want to get mymolecule.png or the pymol window with all >>>>>> the operations >>>>>> already done. >>>>>> >>>>>> Any hints? Thank you. >>>>>> >>>>>> >>>>>> John >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>>>>> Pinpoint memory and threading errors before they happen. >>>>>> Find and fix more than 250 security defects in the development cycle. >>>>>> Locate bottlenecks in serial and parallel code that limit performance. >>>>>> http://p.sf.net/sfu/intel-dev2devfeb >>>>>> _______________________________________________ >>>>>> PyMOL-users mailing list (PyM...@li...) >>>>>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>>>>> Archives: http://www.mail-archive.com/pym...@li... >>>>>> >>>> ------------------------------------------------------------------------------ >>>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>>> Pinpoint memory and threading errors before they happen. >>>> Find and fix more than 250 security defects in the development cycle. >>>> Locate bottlenecks in serial and parallel code that limit performance. >>>> http://p.sf.net/sfu/intel-dev2devfeb >>>> _______________________________________________ >>>> PyMOL-users mailing list (PyM...@li...) >>>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>>> Archives: http://www.mail-archive.com/pym...@li... >>>> >> >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> PyMOL-users mailing list (PyM...@li...) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pym...@li... >> > > |
From: Jason V. <jas...@sc...> - 2011-02-18 08:04:39
|
Hi John, You don't actually need to ray trace before saying any more. That was an older "feature". Here's what worked for me: # save this to examply.py from pymol import cmd cmd.load(sys.argv[1]) cmd.hide() cmd.show("spheres") cmd.set('sphere_scale',0.3) cmd.set('orthoscopic',1) cmd.png("printme.png") using the command line: pymol -qcr examply.py -- 1rsy.pdb This quietly loads PyMOL, runs the commands, renders the image and quits. The command, pymol -qcr examply.py -- 1rsy.pdb keeps PyMOL open, but still renders the image. Did you ensure that you actually had the PDB file (or in your case mymolecule.xyz) in the current working directory? Cheers, -- Jason On Fri, Feb 18, 2011 at 2:46 AM, John Russo <lam...@gm...> wrote: > I'm sorry to bother this mailing list so much but it > seems that I cannot save images. > > This is the script examply.py > > from pymol import cmd > > cmd.load(sys.argv[1]) > cmd.hide() > cmd.show("spheres") > cmd.set('sphere_scale',0.3) > cmd.set('orthoscopic',1) > > cmd.png("printme.png") > > which I execute like this: > > pymol -qrc examply.py -- mymolecule.xyz > > > But I don't get the file printme.png. Executing the > script interactively > > pymol -r examply.py -- mymolecule.xyz > > I can see that the molecule looks ok but still I don't get a png image. > I have to type "png printme.png" in the pymol command line to get it. > > > Does anybody now why is this? > > Thanks. > > > On 02/17/2011 07:30 PM, David Hall wrote: >> No idea if this will fix your problem, but what I've found is portable >> across binaries from Delano Scientific/Schroedinger and >> OS/self-compiled versions of pymol is to instead run: >> >> pymol -r examply.py -- mymolecule.xyz >> >> (or if I'm making pngs, usually pymol -qrck examply.py -- mymolecule.xyz ) >> >> The -- makes it so mymolecule.xyz is passed as an argument to the >> python script instead of as an argument to pymol >> >> Then examply.py is just >> >> from pymol import cmd >> import argv >> import mymodule >> >> cmd.load(sys.argv[1]) >> cmd.hide() >> cmd.show("spheres") >> mymodule.dosomething() >> >> >> Note, that pymol has to be able to find mymodule, which if you're >> using a Delano Scientific/Schrodinger binary can be annoying, but it >> looks like that is already working for you. >> >> Also, http://pymolwiki.org/index.php/Python_Integration makes it look like >> pymol -l examply.py -- mymolecule.xyz >> >> may work, but I've never done it, so no idea how the behavior differs. >> >> -David >> >> >> On Thu, Feb 17, 2011 at 3:05 AM, John Russo<lam...@gm...> wrote: >>> Thanks, that is what I was looking for! I just made a simple >>> script out of it which looks like this >>> >>> #!/usr/bin/env python >>> >>> import pymol >>> from pymol import cmd >>> import mymodule >>> >>> pymol.finish_launching() >>> >>> cmd.load("mymolecule.xyz") >>> cmd.hide() >>> cmd.show("spheres") >>> mymodule.dosomething() >>> >>> >>> I've noticed something strange though. The dosomething() function just >>> colors atoms according to some order parameter. If I execute in the script >>> above it is quite slow, I can see individual atoms being colored. Instead if >>> I execute dosomething() from within the pymol interpreter it is much faster. >>> Any reason for this? >>> >>> >>> >>> >>> >>> >>> On 02/17/2011 04:33 PM, Tsjerk Wassenaar wrote: >>>> Hi John, >>>> >>>> Is this what you're looking for?: >>>> >>>> http://www.pymolwiki.org/index.php/Launching_From_a_Script >>>> >>>> Cheers, >>>> >>>> Tsjerk >>>> >>>> On Thu, Feb 17, 2011 at 8:19 AM, John Russo<lam...@gm...> wrote: >>>>> Hi, >>>>> I'm sorry for making such beginner's questions but searching the manual, >>>>> google >>>>> or the wiki didn't help me. >>>>> >>>>> I know how to extend pymol by writing python functions (through the >>>>> extend command). >>>>> But is it possible to do the opposite? I want to write a script that >>>>> loads a molecule, does something >>>>> to it and then displays the pymol window or outputs a png file. I want >>>>> to this without having to >>>>> enter commands in the pymol command line, since I need to put these >>>>> operations in a script, >>>>> without interactive control on pymol. >>>>> >>>>> Example. I want to write a script examply.py with which I can do >>>>> >>>>> ./examply.py mymolecule.xyz >>>>> >>>>> And for output I want to get mymolecule.png or the pymol window with all >>>>> the operations >>>>> already done. >>>>> >>>>> Any hints? Thank you. >>>>> >>>>> >>>>> John >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>>>> Pinpoint memory and threading errors before they happen. >>>>> Find and fix more than 250 security defects in the development cycle. >>>>> Locate bottlenecks in serial and parallel code that limit performance. >>>>> http://p.sf.net/sfu/intel-dev2devfeb >>>>> _______________________________________________ >>>>> PyMOL-users mailing list (PyM...@li...) >>>>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>>>> Archives: http://www.mail-archive.com/pym...@li... >>>>> >>>> >>> >>> ------------------------------------------------------------------------------ >>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>> Pinpoint memory and threading errors before they happen. >>> Find and fix more than 250 security defects in the development cycle. >>> Locate bottlenecks in serial and parallel code that limit performance. >>> http://p.sf.net/sfu/intel-dev2devfeb >>> _______________________________________________ >>> PyMOL-users mailing list (PyM...@li...) >>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>> Archives: http://www.mail-archive.com/pym...@li... >>> > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... > -- Jason Vertrees, PhD PyMOL Product Manager Schrodinger, LLC (e) Jas...@sc... (o) +1 (603) 374-7120 |
From: John R. <lam...@gm...> - 2011-02-18 08:12:38
|
Hi, your program looks exactly like mine, but I don't get the png image if I don't raytrace it before. I think everything else is working because if I run interectively the molecule is loaded properly, and by just adding the cmd.ray command gives me a correct image (but raytraced). I'm running version Version 1.2r2. John On 02/18/2011 05:04 PM, Jason Vertrees wrote: > Hi John, > > You don't actually need to ray trace before saying any more. That was > an older "feature". > > Here's what worked for me: > > # save this to examply.py > from pymol import cmd > > cmd.load(sys.argv[1]) > cmd.hide() > cmd.show("spheres") > cmd.set('sphere_scale',0.3) > cmd.set('orthoscopic',1) > cmd.png("printme.png") > > using the command line: > > pymol -qcr examply.py -- 1rsy.pdb > > This quietly loads PyMOL, runs the commands, renders the image and > quits. The command, > > pymol -qcr examply.py -- 1rsy.pdb > > keeps PyMOL open, but still renders the image. > > Did you ensure that you actually had the PDB file (or in your case > mymolecule.xyz) in the current working directory? > > Cheers, > > -- Jason > > > > On Fri, Feb 18, 2011 at 2:46 AM, John Russo<lam...@gm...> wrote: >> I'm sorry to bother this mailing list so much but it >> seems that I cannot save images. >> >> This is the script examply.py >> >> from pymol import cmd >> >> cmd.load(sys.argv[1]) >> cmd.hide() >> cmd.show("spheres") >> cmd.set('sphere_scale',0.3) >> cmd.set('orthoscopic',1) >> >> cmd.png("printme.png") >> >> which I execute like this: >> >> pymol -qrc examply.py -- mymolecule.xyz >> >> >> But I don't get the file printme.png. Executing the >> script interactively >> >> pymol -r examply.py -- mymolecule.xyz >> >> I can see that the molecule looks ok but still I don't get a png image. >> I have to type "png printme.png" in the pymol command line to get it. >> >> >> Does anybody now why is this? >> >> Thanks. >> >> >> On 02/17/2011 07:30 PM, David Hall wrote: >>> No idea if this will fix your problem, but what I've found is portable >>> across binaries from Delano Scientific/Schroedinger and >>> OS/self-compiled versions of pymol is to instead run: >>> >>> pymol -r examply.py -- mymolecule.xyz >>> >>> (or if I'm making pngs, usually pymol -qrck examply.py -- mymolecule.xyz ) >>> >>> The -- makes it so mymolecule.xyz is passed as an argument to the >>> python script instead of as an argument to pymol >>> >>> Then examply.py is just >>> >>> from pymol import cmd >>> import argv >>> import mymodule >>> >>> cmd.load(sys.argv[1]) >>> cmd.hide() >>> cmd.show("spheres") >>> mymodule.dosomething() >>> >>> >>> Note, that pymol has to be able to find mymodule, which if you're >>> using a Delano Scientific/Schrodinger binary can be annoying, but it >>> looks like that is already working for you. >>> >>> Also, http://pymolwiki.org/index.php/Python_Integration makes it look like >>> pymol -l examply.py -- mymolecule.xyz >>> >>> may work, but I've never done it, so no idea how the behavior differs. >>> >>> -David >>> >>> >>> On Thu, Feb 17, 2011 at 3:05 AM, John Russo<lam...@gm...> wrote: >>>> Thanks, that is what I was looking for! I just made a simple >>>> script out of it which looks like this >>>> >>>> #!/usr/bin/env python >>>> >>>> import pymol >>>> from pymol import cmd >>>> import mymodule >>>> >>>> pymol.finish_launching() >>>> >>>> cmd.load("mymolecule.xyz") >>>> cmd.hide() >>>> cmd.show("spheres") >>>> mymodule.dosomething() >>>> >>>> >>>> I've noticed something strange though. The dosomething() function just >>>> colors atoms according to some order parameter. If I execute in the script >>>> above it is quite slow, I can see individual atoms being colored. Instead if >>>> I execute dosomething() from within the pymol interpreter it is much faster. >>>> Any reason for this? >>>> >>>> >>>> >>>> >>>> >>>> >>>> On 02/17/2011 04:33 PM, Tsjerk Wassenaar wrote: >>>>> Hi John, >>>>> >>>>> Is this what you're looking for?: >>>>> >>>>> http://www.pymolwiki.org/index.php/Launching_From_a_Script >>>>> >>>>> Cheers, >>>>> >>>>> Tsjerk >>>>> >>>>> On Thu, Feb 17, 2011 at 8:19 AM, John Russo<lam...@gm...> wrote: >>>>>> Hi, >>>>>> I'm sorry for making such beginner's questions but searching the manual, >>>>>> google >>>>>> or the wiki didn't help me. >>>>>> >>>>>> I know how to extend pymol by writing python functions (through the >>>>>> extend command). >>>>>> But is it possible to do the opposite? I want to write a script that >>>>>> loads a molecule, does something >>>>>> to it and then displays the pymol window or outputs a png file. I want >>>>>> to this without having to >>>>>> enter commands in the pymol command line, since I need to put these >>>>>> operations in a script, >>>>>> without interactive control on pymol. >>>>>> >>>>>> Example. I want to write a script examply.py with which I can do >>>>>> >>>>>> ./examply.py mymolecule.xyz >>>>>> >>>>>> And for output I want to get mymolecule.png or the pymol window with all >>>>>> the operations >>>>>> already done. >>>>>> >>>>>> Any hints? Thank you. >>>>>> >>>>>> >>>>>> John >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>>>>> Pinpoint memory and threading errors before they happen. >>>>>> Find and fix more than 250 security defects in the development cycle. >>>>>> Locate bottlenecks in serial and parallel code that limit performance. >>>>>> http://p.sf.net/sfu/intel-dev2devfeb >>>>>> _______________________________________________ >>>>>> PyMOL-users mailing list (PyM...@li...) >>>>>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>>>>> Archives: http://www.mail-archive.com/pym...@li... >>>>>> >>>> ------------------------------------------------------------------------------ >>>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >>>> Pinpoint memory and threading errors before they happen. >>>> Find and fix more than 250 security defects in the development cycle. >>>> Locate bottlenecks in serial and parallel code that limit performance. >>>> http://p.sf.net/sfu/intel-dev2devfeb >>>> _______________________________________________ >>>> PyMOL-users mailing list (PyM...@li...) >>>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >>>> Archives: http://www.mail-archive.com/pym...@li... >>>> >> >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> PyMOL-users mailing list (PyM...@li...) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pym...@li... >> > > |
From: Jason V. <jas...@sc...> - 2011-02-18 08:45:29
|
Hi John, > I'm running version Version 1.2r2. This is probably why. I don't recall the exact version in which this became doable, but it's now available in the latest version. Cheers, -- Jason -- Jason Vertrees, PhD PyMOL Product Manager Schrodinger, LLC (e) Jas...@sc... (o) +1 (603) 374-7120 |
From: John R. <lam...@gm...> - 2011-02-18 09:12:17
|
Thanks, it seems that Ubuntu has a quite updated pymol version in its repositories. I will install a new version by hand. John On 02/18/2011 05:43 PM, Jason Vertrees wrote: > Hi John, > >> I'm running version Version 1.2r2. > This is probably why. I don't recall the exact version in which this > became doable, but it's now available in the latest version. > > Cheers, > > -- Jason > |
From: Folmer F. <fo...@gm...> - 2011-02-17 08:12:08
|
Dear John 2011/2/17 John Russo <lam...@gm...>: > Hi, > I'm sorry for making such beginner's questions but searching the manual, > google > or the wiki didn't help me. > You're welcome to ask here. > I know how to extend pymol by writing python functions (through the > extend command). > But is it possible to do the opposite? I want to write a script that > loads a molecule, does something > to it and then displays the pymol window or outputs a png file. I want > to this without having to > enter commands in the pymol command line, since I need to put these > operations in a script, > without interactive control on pymol. > > Example. I want to write a script examply.py with which I can do > > ./examply.py mymolecule.xyz > > And for output I want to get mymolecule.png or the pymol window with all > the operations > already done. > I saw Tsjerks comment, ( and now yours since I write too slow) but was wondering maybe what you need is more simple. Do require to load PyMOL from a python script? If not, then simply put the commands you need into a text file with the .pml extension and PyMOL will recognize this when you run it. An example file (example.pml) load mymolecule.xyz zoom residue 45-60 png mymolecule.png Then do like this pymol -c example.pml And you get mymolecule.png Best regards, -- Folmer Fredslund |
From: Tsjerk W. <ts...@gm...> - 2011-02-17 08:25:01
|
Hi John, Folmer, First, in reply to Folmer's comment, it did cross my mind whether it was necessary to call Pymol from a script, rather than the reverse. But John gave an example with the file to load as command line argument (./examply.py mymolecule.xyz). If the filename is required internally in the script, that is, AFAIK, cumbersome in Pymol. You could of course have a script that only uses global identifiers (all, n. ca, etc) and run pymol mymolecule.xyz script.py or pymol mymolecule.xyz script.pml That's what I usually do. The approach shouldn't matter that much though. Yet it is a bit puzzling why the response is slower with Pymol called from Python as compared to direct interaction. To be able to try it, we'd need the definition of 'dosomething'. I've tried a script which called cmd.spectrum instead of the 'dosomething', but couldn't say it was much slower than expected. Cheers, Tsjerk On Thu, Feb 17, 2011 at 9:12 AM, Folmer Fredslund <fo...@gm...> wrote: > Dear John > > 2011/2/17 John Russo <lam...@gm...>: >> Hi, >> I'm sorry for making such beginner's questions but searching the manual, >> google >> or the wiki didn't help me. >> > > You're welcome to ask here. > >> I know how to extend pymol by writing python functions (through the >> extend command). >> But is it possible to do the opposite? I want to write a script that >> loads a molecule, does something >> to it and then displays the pymol window or outputs a png file. I want >> to this without having to >> enter commands in the pymol command line, since I need to put these >> operations in a script, >> without interactive control on pymol. >> >> Example. I want to write a script examply.py with which I can do >> >> ./examply.py mymolecule.xyz >> >> And for output I want to get mymolecule.png or the pymol window with all >> the operations >> already done. >> > > I saw Tsjerks comment, ( and now yours since I write too slow) but was > wondering maybe what you need is more simple. > Do require to load PyMOL from a python script? > > If not, then simply put the commands you need into a text file with > the .pml extension and PyMOL will recognize this when you run it. > > An example file (example.pml) > > load mymolecule.xyz > zoom residue 45-60 > png mymolecule.png > > > Then do like this > pymol -c example.pml > > And you get mymolecule.png > > Best regards, > > -- > Folmer Fredslund > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... > -- Tsjerk A. Wassenaar, Ph.D. post-doctoral researcher Molecular Dynamics Group * Groningen Institute for Biomolecular Research and Biotechnology * Zernike Institute for Advanced Materials University of Groningen The Netherlands |