Dear Kristian, Where would I store the reference to the object (containing my data) so that I can retrieve it on the second call? Can I link it to the CGO object or something?
Thanks! Mike ----- Original Message ----- From: "Kristian Rother" <kristian.rot...@charite.de> To: "Mike Liang" <mli...@stanford.edu> Cc: <pymol-users@lists.sourceforge.net> Sent: Thursday, January 30, 2003 3:53 AM Subject: Re: [PyMOL] Associating data structure with CGO object > > Dear Mike, > > You can at least do the following: > > *** first call of command *** > - parse the file > - store the data in an object (dictionary, list, etc.) - you can probably > store the Strings that make up the CGO object. > - refine the data using the cutoff > - create CGO object from refined data > > *** second call of command *** > - delete CGO object > - refine the data using the cutoff > - create CGO object from refined data > > Message: You can create objects in Python scripts that are persistent as long > as PyMOL is running. > This should work a lot faster than parsing the file several times. > > Kristian > > > > What I want to do is parse a file that has a bunch of coordinates and draw > > the spheres in PyMOL. But then I want to be able to adjust the cutoff for > > which points are to be drawn. > > > > What I was doing now was first to run the script to bind the function to a > > command. Then the function will load the file and draw the spheres at a > > particular cutoff. If I rerun the function, it will delete the old CGO > > object, parse the file again, and recreate a new CGO. But if the file is > > really big, this becomes cumbersome. > > > > Or maybe what I need to do is create a "pymol object" and then have it > > create the CGO object everytime it needs to be drawn. Then have my > > function be able to update the cutoff parameter for the object. > > > > Thanks! > > Mike > > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld http://www.vasoftware.com > _______________________________________________ > PyMOL-users mailing list > PyMOL-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pymol-users >