From: Matthias S. <mat...@gm...> - 2011-04-08 17:01:39
|
Hi, I have a few pml scripts for pymol that I would like to rewrite properly in python, making use of Pymol's ability to interprete Python scripts. Do you know of an interpreter that converts pml scripts automatically to python scripts for Pymol? Since the number of tasks that you can do in pml is finite, this should be possible, or not? Best, Matthias -- Structural Bioinformatics and Computational Biochemistry Unit Dept. of Biochemistry University of Oxford South Parks Road Oxford OX1 3QU U.K. Telephone: 01865 613304 Fax: 01865 613238 |
From: Jason V. <jas...@sc...> - 2011-04-08 18:09:36
|
Hi Matthias, There is no script that I'm aware of, but writing one should be rather straightforward because of how the API is organized: commandName arg1, arg2, arg3 becomes cmd.commandName(arg1, arg2, arg3) The hardest part would be determining when to quote strings versus not quoting numbers and variables. You might be able to reflect against the API for a more robust script (http://diveintopython.org/power_of_introspection/index.html). Java's great at that, not sure about Python. Good luck. Cheers, -- Jason On Fri, Apr 8, 2011 at 1:01 PM, Matthias Schmidt <mat...@gm...> wrote: > Hi, > > I have a few pml scripts for pymol that I would like to rewrite > properly in python, making use of Pymol's ability to interprete Python > scripts. > > Do you know of an interpreter that converts pml scripts automatically > to python scripts for Pymol? Since the number of tasks that you can do > in pml is finite, this should be possible, or not? > > Best, > > Matthias > > -- > Structural Bioinformatics and Computational Biochemistry Unit > Dept. of Biochemistry > University of Oxford > South Parks Road > Oxford > OX1 3QU > U.K. > > Telephone: 01865 613304 > Fax: 01865 613238 > > ------------------------------------------------------------------------------ > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games. > http://p.sf.net/sfu/verizon-sfdev > _______________________________________________ > 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: Michael L. <mgl...@gm...> - 2011-04-08 18:17:17
|
It's not elegant at all, but it's worth knowing that you can use cmd.do("...") as a quick fix for lines that aren't immediately easy to convert. Even a mostly-working pml2py tool would be a useful addition to the wiki. Cheers, -Michael On Fri, Apr 8, 2011 at 2:09 PM, Jason Vertrees < jas...@sc...> wrote: > Hi Matthias, > > There is no script that I'm aware of, but writing one should be rather > straightforward because of how the API is organized: > > commandName arg1, arg2, arg3 > > becomes > > cmd.commandName(arg1, arg2, arg3) > > The hardest part would be determining when to quote strings versus not > quoting numbers and variables. You might be able to reflect against > the API for a more robust script > (http://diveintopython.org/power_of_introspection/index.html). Java's > great at that, not sure about Python. Good luck. > > Cheers, > > -- Jason > > > On Fri, Apr 8, 2011 at 1:01 PM, Matthias Schmidt > <mat...@gm...> wrote: > > Hi, > > > > I have a few pml scripts for pymol that I would like to rewrite > > properly in python, making use of Pymol's ability to interprete Python > > scripts. > > > > Do you know of an interpreter that converts pml scripts automatically > > to python scripts for Pymol? Since the number of tasks that you can do > > in pml is finite, this should be possible, or not? > > > > Best, > > > > Matthias > > > > -- > > Structural Bioinformatics and Computational Biochemistry Unit > > Dept. of Biochemistry > > University of Oxford > > South Parks Road > > Oxford > > OX1 3QU > > U.K. > > > > Telephone: 01865 613304 > > Fax: 01865 613238 > > > > > ------------------------------------------------------------------------------ > > Xperia(TM) PLAY > > It's a major breakthrough. An authentic gaming > > smartphone on the nation's most reliable network. > > And it wants your games. > > http://p.sf.net/sfu/verizon-sfdev > > _______________________________________________ > > 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 > > > ------------------------------------------------------------------------------ > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games. > http://p.sf.net/sfu/verizon-sfdev > _______________________________________________ > PyMOL-users mailing list (PyM...@li...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pym...@li... > -- Michael Lerner, Ph.D. IRTA Postdoctoral Fellow Laboratory of Computational Biology NIH/NHLBI 5635 Fishers Lane, Room T909, MSC 9314 Rockville, MD 20852 (UPS/FedEx/Reality) Bethesda MD 20892-9314 (USPS) |
From: Thomas H. <sp...@us...> - 2011-04-09 08:18:49
|
Jason Vertrees wrote, On 04/08/11 20:09: > Hi Matthias, > > There is no script that I'm aware of, but writing one should be rather > straightforward because of how the API is organized: > > commandName arg1, arg2, arg3 > > becomes > > cmd.commandName(arg1, arg2, arg3) I would use the cmd.keyword dictionary for the translation, I thinks not all commands have the exact same name in PyMOl API. Also pml scripts can contain python code which must not be translated. > The hardest part would be determining when to quote strings versus not > quoting numbers and variables. It should be save to just quote everything. Cheers, Thomas |
From: Thomas H. <sp...@us...> - 2011-04-09 09:18:09
Attachments:
pml2py.py
|
Michael Lerner wrote, On 04/08/11 20:16: > It's not elegant at all, but it's worth knowing that you can use > cmd.do("...") as a quick fix for lines that aren't immediately easy to > convert. > > Even a mostly-working pml2py tool would be a useful addition to the wiki. mostly-working script attached, have fun! Cheers, Thomas -- Thomas Holder MPI for Developmental Biology Spemannstr. 35 D-72076 Tübingen |
From: Thomas H. <sp...@us...> - 2011-04-09 17:15:06
|
it's on the wiki now: http://pymolwiki.org/index.php/Pml2py Cheers, Thomas Thomas Holder wrote, On 04/09/11 11:17: > Michael Lerner wrote, On 04/08/11 20:16: >> It's not elegant at all, but it's worth knowing that you can use >> cmd.do("...") as a quick fix for lines that aren't immediately easy to >> convert. >> >> Even a mostly-working pml2py tool would be a useful addition to the wiki. > > mostly-working script attached, have fun! > > Cheers, > Thomas -- Thomas Holder MPI for Developmental Biology Spemannstr. 35 D-72076 Tübingen |