Hi Jason, sorry for last message .. To label a residue by an mdo command cmd.mdo(int frame, string command) I can pass as command one among these strings:
1) 'label %s, "%s %s"' % (..) works fine but prints a message (I don't want) to the output window 1+) 'label %s, "%s %s", quiet=1' % (..) doesn't work, I get a SyntaxError: can't assign to literal 2) 'cmd.label("%s", "\'%s %s\'")' % (..) works fine and doesn't print a message to the output window (is my choise) 2+) 'cmd.label("%s", "\'%s %s\'", "quiet=1")' % (..) doesn't work, pyMOL crashes A similar behaviour I've got about alter_state and cmd.alter_state() So the 'label ..' command appears not having a 'quiet' option and appears not being the same than 'cmd.label ..' This was strange to me and (hoping I didn't make a mistake in the script) I was curious to know the raison of this behaviour if simple to tell. If not, please don't care: I solved (thanks to you) my problem and so you can skip my request. Thanks a lot. Cheers Roberto >----Messaggio originale---- >Da: jason.vertr...@schrodinger.com >Data: 01/03/2011 18.29 >A: "rv...@libero.it"<rv...@libero.it> >Ogg: Re: Re: [PyMOL] labeling by a pseudoatom > >Hi Roberto, > >I'm not sure what you're asking here. Can you please rephrase this. > >Also, are you trying "quite=1" or "quiet=1". > >Cheers, > >-- Jason > >On Tue, Mar 1, 2011 at 2:17 AM, rv...@libero.it <rv...@libero.it> wrote: >> Hi Jason, >> thanks for your hints. >> >> I tried. All fine: >> cmd.alter_state doesn't message the user also without a quite=1 option. >> cmd.label makes the same. >> >> I used (as suggested) >> cmd.alter_state >> cmd.label >> >> 'cmd.alter_state' appears not be the same than 'alter_state' >> and so >> 'cmd.label' appears not be the same than 'label'. >> >> I've got errors when I setted quite=1 options in >> 'alter_state' and in 'label' >> >> So thanks for your hints. >> >> Cheers >> roberto >> >> >> >> Tjha >> >> alter_state >> and >> label >> instead message the >> the output window and don't suppor >> >> If I set a quite=1 option in >> alter_state >> label >> I get errors. >> >> .. but probably you already know. >> >> >>>----Messaggio originale---- >>>Da: jason.vertr...@schrodinger.com >>>Data: 28/02/2011 6.36 >>>A: "rv...@libero.it"<rv...@libero.it> >>>Cc: <pymol-users@lists.sourceforge.net> >>>Ogg: Re: [PyMOL] labeling by a pseudoatom >>> >>>Hi Roberto, >>> >>>It's nice to see people learning how to script and putting PyMOL >>>through its paces. >>> >>>> trying to use a pseudoatom as label I met several problems: >>>> >>>> 1) How to move the label (pseudoatom) to a target residue? >>>> Is there a simple command to do? >>> >>>The easiest way would be to get the coordinates of the target residue, >>>I'd choose the alpha carbon (replace "X" with your residue number): >>> >>># query residue X's alpha carbon, store the position in targetResPosition >>> >>>targetResPosition = cmd.get_atom_coords("resi X and n. CA") >>> >>># next, just assign that position to the pseudoatom: >>> >>>cmd.alter_state(1, "myPseudoAtom", "(x,y,z) = targetResPosition") >>> >>> >>>> 2) How to change the label without messaging the user? >>>> The 'label' command appears not have a 'quiet' option. >>> >>>This is interesting, and not what I'd expect from PyMOL, however it works: >>> >>># make a new text label as a Python string >>> >>>newLabel = "New Pseudoatom label" >>> >>># assign that label >>> >>>cmd.label("myPseudoAtom", "newLabel") >>> >>>Interestingly, PyMOL picks up the 2nd parameter as a variable name. >>>Also, label does have a quiet option: >>> >>># assign that label, quietly >>> >>>cmd.label("myPseudoAtom", "newLabel", quiet=1) >>> >>> >>> >>>> 3) (less important) How to hide the pseudoatom? >>>> I wish not have the pseudoatom listed among models in the GUI panel. >>> >>>To hide a pseudoatom (just the + symbol): >>> >>>hide nonbonded, myPseudoAtom >>> >>># or, just hide the labels >>> >>>hide labels, myPseudoAtom >>> >>># or, hide all >>> >>>hide everything, myPseudoAtom >>> >>> >>>> 4) (less important) I need to execute all these operations by script (mdo >>>> commands during a movie) >>>> To simplify the movie I wish use only one mdo command >>>> >>>> def doAll() >>>> .. all my script here .. >>>> >>>> extending the cmd just before the movie start >>>> >>>> cmd.extend('doAll', doAll) >>>> >>>> and clearing the cmd just at the end of the movie but I don't know >>>> how. >>>> Is there a way to clear a command? >>> >>>The mdo command takes a frame number and a string. For that frame it >>>stores the string, and then applies it prior to setting the scene. >>>PyMOL overwrites the string each time, so you need to cache all your >>>commands for one frame and use the mdo command once per fram. Create >>>a small class that stores all the mdo commands as one string. Then, >>>when you want those command executed ask the class to call mdo on the >>>given frame, using that long string. That might look something like: >>> >>> >>>mcache 50, "show sticks" >>> >>>mcache 50, "as spheres, het" >>> >>>mcache 50, "show surface, poly within 10 or org" >>> >>>... >>> >>>store scenes, plan movie, etc. >>> >>>... >>> >>>mCacheApply 50 >>> >>>I made something similar for making movie fades, just cache the string >>>an apply it when necessary. >>> >>>Cheers, >>> >>>-- Jason >>> >>>-- >>>Jason Vertrees, PhD >>>PyMOL Product Manager >>>Schrodinger, LLC >>> >>>(e) jason.vertr...@schrodinger.com >>>(o) +1 (603) 374-7120 >>> >> >> >> > > > >-- >Jason Vertrees, PhD >PyMOL Product Manager >Schrodinger, LLC > >(e) jason.vertr...@schrodinger.com >(o) +1 (603) 374-7120 > ------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net