Re: [PyMOL] Python script with iterate_state and selection command

2020-06-24 Thread ABEL Stephane
: Re: [PyMOL] Python script with iterate_state and selection command Hi Stéphane, Pedro is correct, you should change the selection like he suggested. You also need to: - Make a state specific selection with cmd.select(..., state=i) - Adjust the loop to start at 1 and not at 0 - Use

Re: [PyMOL] Python script with iterate_state and selection command

2020-06-23 Thread Thomas Holder
> Stéphane Abel, Ph.D. > CEA Centre de Saclay > DRF/JOLIOT/I2BC-S/SB2SM/LBMS > Bat 528, Office 138C > Gif-sur-Yvette, F-91191 FRANCE > Phone (portable) : +33 6 49 37 70 60 > ____________ > De : Pedro Lacerda [psl

Re: [PyMOL] Python script with iterate_state and selection command

2020-06-22 Thread ABEL Stephane
60 De : Pedro Lacerda [pslace...@gmail.com] Envoyé : lundi 22 juin 2020 16:26 À : ABEL Stephane Cc : pymol-users Objet : Re: [PyMOL] Python script with iterate_state and selection command Hi, Not sure if I understood your code but maybe you want change

Re: [PyMOL] Python script with iterate_state and selection command

2020-06-22 Thread Pedro Lacerda
Hi, Not sure if I understood your code but maybe you want change Myselection to: Myselection="resname SOL within 3.5 of resname CHO" -- Pedro Lacerda Em seg, 22 de jun de 2020 10:44, ABEL Stephane escreveu: > Hello all, > > I would like to write a basic python script to select residues for ea

Re: [PyMOL] python command to get b-factor and occupancy of a single atom?

2015-08-27 Thread Thomas Holder
Hi Dirk, cmd.iterate is actually the most efficient function to access atom properties. If you want a wrapper which directly gets b and q for one atom, it could look like this (returns a dictionary): from pymol import cmd @cmd.extend def get_signle_atom_props(selection, props=['b', 'q'], quiet=

Re: [PyMOL] Python from PyMOL or PyMOL from Python?

2015-08-14 Thread David Hall
I vastly prefer calling the python program from pymol You can call any python program using pymol as: pymol -r program.py — arg1 arg2 arg3 Or, my full preferred method is: pymol -qrck program.py — arg1 arg2 arg3 These make it quieter, stay on the command line, and not read the .pymolrc file

Re: [PyMOL] python script to define an extra pymol function and then use it during the same session

2014-09-02 Thread Matthew Baumgartner
Hi, When you call cmd.extend(), it does not add the function to pymol.cmd. Just call it directly: Change pymol.cmd.align_all_to_all() to align_all_to_all() You may need to import it if you haven't already (and make sure it is in the PYTHONPATH). HTH, Matt Baumgartner On 09/02/2014 10:38 AM

Re: [PyMOL] python scripting in pymol

2014-04-06 Thread Folmer Fredslund
Hi James, On the pymol-wiki there is a script called findseq ( http://pymolwiki.org/index.php/Findseq) That does what you want (or at least the first part of your request) Best regards, Folmer 2014-04-05 13:29 GMT+02:00 James Starlight : > Dear PyMol users! > > I'm learning of the python scrip

Re: [PyMOL] python module in pymol

2013-07-09 Thread Jérôme Pansanel
Dear Pascal, Do you have any errors/warning when launching PyMOL? If you fetch a structure in your PML file, be sure that the structure is downloaded before to start the plugin (use: fetch pdb_code, async=0) Can you send me some part of your PML file, so I can help you to debug? Best regards,

Re: [PyMOL] python module in pymol

2013-07-09 Thread Jason Vertrees
Hi Pascal, PyMOL treats .pml and .py files differently. The "cluster_count" script was written as a .py file as needs to be used as such. run cluster_count.py cluster_count PO4 worked just fine when run as a Python file. Cheers, -- Jason On Tue, Jul 9, 2013 at 6:06 AM, Pascal Auffinger wrot

Re: [PyMOL] python

2010-07-12 Thread Robert Campbell
On Mon, 12 Jul 2010 10:37:07 -0400 Vivek Ranjan wrote: > Hello, > > How can I find out what version of python my current installation of > pymol is using ? One way is simply to type "python" in a terminal window and you should see something like: Python 2.6.5+ (release26-maint, Jul 1 2010, 00

Re: [PyMOL] python

2010-07-12 Thread Schubert, Carsten [PRDUS]
import sys print sys.version > -Original Message- > From: Vivek Ranjan [mailto:vran...@gmail.com] > Sent: Monday, July 12, 2010 10:37 AM > To: Pymol > Subject: [PyMOL] python > > Hello, > > How can I find out what version of python my current installation of > pymol is using ? > > -- >

Re: [PyMOL] Python Function with Unlimited Positional Arguments

2009-08-02 Thread Warren DeLano
Sean, You need a keyword argument list as well, so that the effective PyMOL class instance (_self) can be passed in by keyword (actual use of _self is only strictly required when you have multiple PyMOLs active in a single Python interpreter). # pml input: python def my_fn(*arg, **kwd): pri

Re: [PyMOL] python/pymol malfunction on new Ubuntu installation

2008-07-22 Thread Daniel Rigden
rors, there is little chance of PyMOL > building or running correctly. > > Cheers, > Warren > > -Original Message- > From: pymol-users-boun...@lists.sourceforge.net > [mailto:pymol-users-boun...@lists.sourceforge.net] On Behalf Of Daniel Rigden > Sent: Tuesda

Re: [PyMOL] python/pymol malfunction on new Ubuntu installation

2008-07-22 Thread Daniel Rigden
Warren Thanks for the quick reply. I tried what you suggested but I get the same error. How can I check how the path has been configured? It seems as if there is only one python so there shouldn't be scope for confusion; I can only find one site.py, for example, in /usr/lib/python2.5/site.py

Re: [PyMOL] python/pymol malfunction on new Ubuntu installation

2008-07-22 Thread Daniel Rigden
Michael Like I said, the problem is not pymol-specific; no modules can be found even when explicitly pointing PYTHONHOME to them. Pymol0.99 off the website works fine since it comes packaged with its own python modules. The one I'd like to get to work is a 1.0rc2 obtained from synaptic. It loca

Re: [PyMOL] python/pymol malfunction on new Ubuntu installation

2008-07-22 Thread DeLano Scientific
Daniel, Any time you see the "import site failed" error from Python, you can infer that there is a problem with the Python interpreter being unable to access its required libraries. Messages after that aren't typically informative. This usually a path configuration issue, but I think it can al

Re: [PyMOL] python/pymol malfunction on new Ubuntu installation

2008-07-22 Thread Michael Banck
On Tue, Jul 22, 2008 at 03:38:53PM +0100, Daniel Rigden wrote: > First let me confess that my problem does not just involved pymol. > However, it is hampering my use of pymol amongst other things and there > must be many python experts who read this list. > > My problem, on a completely fresh Ubun

Re: [PyMOL] python for loop with pymol command usage

2007-07-04 Thread Robert Campbell
Hi Louis, * Clark, Louis [2007-07-04 12:01] wrote: > Dear user-group, > > I'm trying to learn how to use python commands inside pymol .pml > scripts. I seem to be missing some understanding about how the > interface works. Could somebody tell me how to fix this command below? > > > > PyM

Re: [PyMOL] python for loop with pymol command usage

2007-07-04 Thread gilleain torrance
Hmmm. With a little messing around, it seems that this works at the pymol prompt: for x in range(10): cmd.label("(name ca and resi %d)" % x, '"%s%s\" % (resi, resn)') The only difference is in the quoting. Double quotes inside single quotes. gilleain On 7/4/07, Clark, Louis wrote: Dear

RE: [PyMOL] Python scripting for Pymol

2006-01-08 Thread Jerome Pansanel
Hi, pymol.cmd.refresh() doesn't work when the function is placed before cmd.png(), but works when placed after. As cmd.refresh() is much faster than time.sleep(1), the script is now quicker (I used this function to get the 2D pictures from a sdf file containing less than 100 structures). here is

RE: [PyMOL] Python scripting for Pymol

2006-01-06 Thread Warren DeLano
Jerome, Try calling pymol.cmd.refresh() before pymol.cmd.png(name) Cheers, Warren -- Warren L. DeLano, Ph.D. Principal Scientist . DeLano Scientific LLC . 400 Oyster Point Blvd., Suite 213 . South San Francisco, CA 94080 USA . Biz:(650)-872-0942

Re: [PyMOL] Python scripting for Pymol

2006-01-06 Thread gilleain torrance
Hi, I tried a similar, but simpler, example : def mol2png(name): cmd.png(name) cmd.delete(name) called as 'mol2png("1a2pA")', given that I have an object called "1a2pA" loaded. It works just fine on my laptop (mac). Odd. gilleain torrance On 1/6/06, Jerome PANSANEL wrote: > > Hi, >

RE: [PyMOL] Python commands and variables

2003-08-27 Thread Warren L. DeLano
Yes, but you need to write in Python directly. For example: from pymol import cmd cmd.select("mysel","none") for i in range(10,20): cmd.select("mysel","mysel or resi %d"%i) Would work in a ".py" file. Cheers, Warren -- mailto:war...@delanoscientific.com Warren L. DeLano, Ph.D. Principal Scient

Re: [PyMOL] python as a satellite virus

2003-04-30 Thread Terry M. Gray
At 10:50 AM -0700 4/30/03, wgsc...@chemistry.ucsc.edu wrote: Coincidently that was the exact same program that hosed my python installation too. I had set up my computer to run the python based AutoDock Tools interface to the docking program AutoDock. The installer for this program puts its ow