Re: [Jmol-users] Save/load state command
finally catching up here Let's talk more about this. When you read a state script, you use the script command, so perhaps what we are talking about is an option that allows conversion of directories there. That said, you can do this: var x = load("myscript.spt").replace("file:/Volumes/nggroup/external/test/","../jmol/") script inline @x x = none Wouldn't this suffice? Anything else is just convenience, I think. By the way, that third line guarantees that x itself does not become part of the state. (VAR should do that as well, though). Bob Bob Angel Herraez wrote: >>Web: load /*file*/"http://chemapps.stolaf.edu/jmol/docs/examples- >>11/data/quartz.cif" {1.0 1.0 1.0}; >>DW:load /*file*/"file:/Volumes/nggroup/external/test/histidine.cif"; >>(this is on Mac OS X) >>Both fixed paths. >> >> > > >Yes. I now remember seing this before, though I don't use state >often. >The question is that since the Jmol app can load files from anywhere >in the local file system, it adds the full path to the state script, >even if Jmol and the model are in the same folder. So you basically >end up editing the state script file always. > >I think it would be more useful for general development if the saved >path was relative --at least when Jmol and the model are in the same >folder, or the model is in a subfolder below Jmol--. Of course, this >usefulness depends on what the developer has in mind, mainly moving >or publishing those files or just using them in the local computer >only. > > > >- >This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >Build the coolest Linux based applications with Moblin SDK & win great prizes >Grand prize is a trip for two to an Open Source event anywhere in the world >http://moblin-contest.org/redirect.php?banner_id=100&url=/ >___ >Jmol-users mailing list >Jmol-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/jmol-users > > -- Robert M. Hanson Professor of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr If nature does not answer first what we want, it is better to take what answer we get. -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900 - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Save/load state command
right now, that's an intended limitation of the state functionality. The EXACT state is saved -- which means the exact files are read. No relative paths. My conclusions after much consideration, particularly with Jmol Protein Explorer, is that files read from disk are problematic, (because, for example, now with remediated files, "1crn.pdb" on your drive may not be the same as "1crn.pdb" at RCSB, even if some time ago that's where you got it. My feeling was that the solution is for specialized sites to parse the /*file*/ locator to their own specifications. If you want to make a relative path, there should be a regular expression for replacing /*file*/"../.xxx" with "yy/.xxx" It's true, one might have to "do this by hand" -- but if you are clever you can design a bit of code that will fix this automatically for your site in all spt files. Maybe a Perl script, for example. Bob Nick Greeves wrote: > Good point Angel, > The load command also shows different behaviour on a website (Bob's) > or in Dreamweaver. > Web: load > /*file*/"http://chemapps.stolaf.edu/jmol/docs/examples-11/data/quartz.cif"; > {1.0 1.0 1.0}; > DW: load /*file*/"file:/Volumes/nggroup/external/test/histidine.cif"; > (this is on Mac OS X) > that's just because histidine.cif was read from your hard drive. > Both fixed paths. > > All the best > > Nick > > > -- > > 3D Organic Animations http://www.chemtube3d.com > > Tel: +44 (0)151-794-3506 (3500 secretary) > > > > > On 16 Jul 2008, at 08:14, [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> wrote: > >> Message: 5 >> Date: Wed, 16 Jul 2008 09:15:23 +0200 >> From: "Angel Herraez" <[EMAIL PROTECTED] >> <mailto:[EMAIL PROTECTED]>> >> Subject: Re: [Jmol-users] Save/load state command > > To: jmol-users@lists.sourceforge.net > <mailto:jmol-users@lists.sourceforge.net> > Message-ID: <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> > Content-Type: text/plain; charset=US-ASCII > > I also think that a fixed path is not good. > However, from Nick's quote > >> >> # Jmol state version 11.4.4 2007-12-20 06:37; > >> # fullName = "jmolApplet0[343951889313757]"; > >> # documentBase = "file:/Users/ngreeves/Sites/external/JmolPopup.htm"; > >> # codeBase = "file:/Users/ngreeves/Sites/external/"; > > > The initial # will prevent Jmol from reading those lines, so that's > really just a comment and will not have any effect on final behaviour > of the state script. > Check the line that starts with "load " and see which is the path > there. > > > >- >This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >Build the coolest Linux based applications with Moblin SDK & win great prizes >Grand prize is a trip for two to an Open Source event anywhere in the world >http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > > >___ >Jmol-users mailing list >Jmol-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/jmol-users > > -- Robert M. Hanson Professor of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr If nature does not answer first what we want, it is better to take what answer we get. -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900 - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Save/load state command
> Web: load /*file*/"http://chemapps.stolaf.edu/jmol/docs/examples- > 11/data/quartz.cif" {1.0 1.0 1.0}; > DW:load /*file*/"file:/Volumes/nggroup/external/test/histidine.cif"; > (this is on Mac OS X) > Both fixed paths. Yes. I now remember seing this before, though I don't use state often. The question is that since the Jmol app can load files from anywhere in the local file system, it adds the full path to the state script, even if Jmol and the model are in the same folder. So you basically end up editing the state script file always. I think it would be more useful for general development if the saved path was relative --at least when Jmol and the model are in the same folder, or the model is in a subfolder below Jmol--. Of course, this usefulness depends on what the developer has in mind, mainly moving or publishing those files or just using them in the local computer only. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
[Jmol-users] Save/load state command
Good point Angel, The load command also shows different behaviour on a website (Bob's) or in Dreamweaver. Web: load /*file*/"http://chemapps.stolaf.edu/jmol/docs/examples-11/data/quartz.cif " {1.0 1.0 1.0}; DW: load /*file*/"file:/Volumes/nggroup/external/test/histidine.cif"; (this is on Mac OS X) Both fixed paths. All the best Nick -- 3D Organic Animations http://www.chemtube3d.com Tel: +44 (0)151-794-3506 (3500 secretary) On 16 Jul 2008, at 08:14, [EMAIL PROTECTED] wrote: Message: 5 Date: Wed, 16 Jul 2008 09:15:23 +0200 From: "Angel Herraez" <[EMAIL PROTECTED]> Subject: Re: [Jmol-users] Save/load state command To: jmol-users@lists.sourceforge.net Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=US-ASCII I also think that a fixed path is not good. However, from Nick's quote # Jmol state version 11.4.4 2007-12-20 06:37; # fullName = "jmolApplet0[343951889313757]"; # documentBase = "file:/Users/ngreeves/Sites/external/JmolPopup.htm"; # codeBase = "file:/Users/ngreeves/Sites/external/"; The initial # will prevent Jmol from reading those lines, so that's really just a comment and will not have any effect on final behaviour of the state script. Check the line that starts with "load " and see which is the path there. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Save/load state command
I also think that a fixed path is not good. However, from Nick's quote > > # Jmol state version 11.4.4 2007-12-20 06:37; > # fullName = "jmolApplet0[343951889313757]"; > # documentBase = "file:/Users/ngreeves/Sites/external/JmolPopup.htm"; > # codeBase = "file:/Users/ngreeves/Sites/external/"; The initial # will prevent Jmol from reading those lines, so that's really just a comment and will not have any effect on final behaviour of the state script. Check the line that starts with "load " and see which is the path there. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
[Jmol-users] Save/load state command
Thanks Angel and Bob, That works well provided the state is generated from a real live web server version of the original Jmol page and then reloaded on it. When I tried to create the state from a Dreamweaver version of the site the base paths were incorrect for the ultimate web server location. # Jmol state version 11.4.4 2007-12-20 06:37; # fullName = "jmolApplet0[343951889313757]"; # documentBase = "file:/Users/ngreeves/Sites/external/JmolPopup.htm"; # codeBase = "file:/Users/ngreeves/Sites/external/"; So this seems to be a limitation. The files must be in the final location for the state to work in the future and if the site was renamed or moved all the base references would have to be changed manually. Is there a way for state to generate relative paths? e.g. codebase= "." or something similar All the best Nick -- 3D Organic Animations http://www.chemtube3d.com Tel: +44 (0)151-794-3506 (3500 secretary) 4. Save/load state command (Nick Greeves) 5. Re: Save/load state command ( Angel Herr?ez ) 9. Re: Save/load state command (Bob Hanson) -- --- Message: 4 Date: Mon, 14 Jul 2008 21:03:03 +0100 From: Nick Greeves <[EMAIL PROTECTED]> Subject: [Jmol-users] Save/load state command To: jmol-users@lists.sourceforge.net Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="us-ascii" Is it possible to save a state and then reload that state from disk or as part of a very long command? save state, move molecule, restore state works just fine but I'd like to be able to load such a state from scratch without having saved it in the same session. All the best Nick -- 3D Organic Animations http://www.chemtube3d.com Tel: +44 (0)151-794-3506 (3500 secretary) Message: 5 Date: Tue, 15 Jul 2008 00:02:25 +0200 From: " Angel Herr?ez " <[EMAIL PROTECTED]> Subject: Re: [Jmol-users] Save/load state command To: jmol-users@lists.sourceforge.net Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=US-ASCII Hi Nick Yes, you can save the state: With the application you can save to disk. The command is write state Or, from the menu, File > Export > State With the applet, show state then copy from the console and paste where you want. Or from the pop-up menu, both app and applet: Show > Current state then copy from the console and paste where you want. The saved state is "loaded" as any script, from file or from command. Message: 9 Date: Tue, 15 Jul 2008 08:39:18 -0500 From: Bob Hanson <[EMAIL PROTECTED]> Subject: Re: [Jmol-users] Save/load state command To: jmol-users@lists.sourceforge.net Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed use "write state" and then run it with the SCRIPT command. The state consists of a set of functions that are run. It's also possible to get just one of the functions of the state and save just that piece. -- Robert M. Hanson Professor of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Save/load state command
Nick Greeves wrote: > Is it possible to save a state and then reload that state from disk or > as part of a very long command? > save state, move molecule, restore state works just fine but I'd like > to be able to load such a state from scratch without having saved it > in the same session. > use "write state" and then run it with the SCRIPT command. The state consists of a set of functions that are run. It's also possible to get just one of the functions of the state and save just that piece. > All the best > > Nick > > -- > > 3D Organic Animations http://www.chemtube3d.com > > Tel: +44 (0)151-794-3506 (3500 secretary) > > > > > > >- >Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >Studies have shown that voting for your favorite open source project, >along with a healthy diet, reduces your potential for chronic lameness >and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > > > >___ >Jmol-users mailing list >Jmol-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/jmol-users > > -- Robert M. Hanson Professor of Chemistry St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr If nature does not answer first what we want, it is better to take what answer we get. -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900 - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Save/load state command
Hi Nick Yes, you can save the state: With the application you can save to disk. The command is write state Or, from the menu, File > Export > State With the applet, show state then copy from the console and paste where you want. Or from the pop-up menu, both app and applet: Show > Current state then copy from the console and paste where you want. The saved state is "loaded" as any script, from file or from command. > Is it possible to save a state and then reload that state from disk or as > part of a very long > command? save state, move molecule, restore state works just fine but I'd > like to be able to load > such a state from scratch without having saved it in the same session. - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
[Jmol-users] Save/load state command
Is it possible to save a state and then reload that state from disk or as part of a very long command? save state, move molecule, restore state works just fine but I'd like to be able to load such a state from scratch without having saved it in the same session. All the best Nick -- 3D Organic Animations http://www.chemtube3d.com Tel: +44 (0)151-794-3506 (3500 secretary) - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users