Re: [Jmol-users] applet -- callback brainstorming
AS A USER, WHAT DO YOU WANT? a) Do you implement callbacks? If so, which ones? yes message and pickcallback. message callback to show messages in textarea and pickcallback to link applet with an alignement or to launch a cgi script on residue selection. see at http://pig-pbil.ibcp.fr/cgi-bin/magos/jmol_afm?file=example1level=high the probleme is that connection between applet and alignment is complex and it will be easiest if information about applet state will be available. And this system is not portable on MacOS system for now. b) What WOULD you use if you had it available? c) What sort of information (exactly) are you looking for? It would be good to have state information of applet about render, select residues, colors,labels. A memory of the last command sent to applet will be fine. d) Is there a particular format that you would like to see, other than just the current text-stream of messages? not particulary e) Is it important to you that this mechanism be backward compatible? no --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid3432bid#0486dat1642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
RE: [Jmol-users] applet -- callback brainstorming
Developers- Thanks for exploring the callback options. In answer to the questions posed, a) Do you implement callbacks? If so, which ones? I use pickcallback to identify atoms for color changes in lecture graphics. I also use the pickcallback function to trigger various JS driven lecture graphic events. To this end, the pickcallback available in Jmol 10.0 is very nice. I am, however, keeping my eye on the current discussion for other possibilities. b) What WOULD you use if you had it available? This may not be related, but a list of applet properties and methods that are available (exposed?) to JavaScript would be useful. This list may already be available. It's very possible that I have simply not located the list. Otis -- Otis Rothenberger Department of Chemistry Illinois State University Normal, IL 61790-4160 http://chemagic.org --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Hi Bob, I highly appreciate your efforts regarding this issue. I have not had the time yet to think more deeply about this. So below you will find only some of my first thoughts. Bob Hanson wrote: a) Do you implement callbacks? If so, which ones? Currently I only implemented message callback to allow somehow the monitoring of script commands. b) What WOULD you use if you had it available? What currently is missing in Jmol is the possibility to dump the current display state (rendering, visibility, etc.) in order to be able to restart later or maybe with a larger Jmol display from the same state. So this kind of information at least on an atom level (or even better already combined for groups,chains etc. or maybe even as a complete script) could be used to build a 'reload script' and could bypass the need for a signed applet. I could even imagine using this for exporting images,povray etc.(maybe ASCII encoded by Base64 or something similar, to be able get this into a textarea that could be saved with copy and paste by the user). I would like to integrate a sequence/alignment view (like that which my script at http://www.fli-leibniz.de/cgi-bin/pdb_alignment.pl?CODE=1a2c; creates) into the Jmol user interface I developed (http://www.fli-leibniz.de/cgi-bin/3d_mapping.pl?CODE=1a2c;). This would already be possible by using 'pick callback' and 'message callback',. But it would be a lot of work and presumably be quite unreliable. If the interface could recognize any selection change and then ask Jmol for the current selection this would simplify that a lot and make it much more reliable. c) What sort of information (exactly) are you looking for? So I would like to have all information on any atom that is necessary to produce exactly the same display. If possible and suitable the same on a higher level (like group, chain) or even as a complete 'reload script'. I would like to get information on selection changes. I would like to get information on the current selection, also on different levels (like atom, group etc.) if possible and suitable. d) Is there a particular format that you would like to see, other than just the current text-stream of messages? No specific format, it should just be easily and efficiently parseable. e) Is it important to you that this mechanism be backward compatible? No, it must not be backward compatible. MORE SPECIFC QUESTION: 1. There are currently four callbacks: animFrameCallback loadStructCallback pickCallback messageCallback Each of these fulfills an obvious need. Should there be more callback-like options? If so, what? I would rather like to avoid callbacks, but maybe a 'selectionChangeCallback'. Regards, Rolf --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Bob Hanson wrote: because I just fixed it. I should have written Why did it still work in Firefox with Linux?, because it already worked there even hours before you told in your response to Dan that you will look into it. Regards, Rolf [EMAIL PROTECTED] wrote: Quoting Bob Hanson [EMAIL PROTECTED]: Thanks, Dan. Well, I see I broke right-mouse click on the prototype. It's not a sync issue, because it's broken even with just one applet on a page and no JavaScript. I'll look into it. But if you broke it, why does it still work in Firefox with Linux? Regards, Rolf This message was sent using IMP, the Internet Messaging Program. --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
beats me, the code couldn't possibly have let it, as the call wasn't there!! Let's not pursue it Rolf Huehne wrote: Bob Hanson wrote: because I just fixed it. I should have written Why did it still work in Firefox with Linux?, because it already worked there even hours before you told in your response to Dan that you will look into it. Regards, Rolf [EMAIL PROTECTED] wrote: Quoting Bob Hanson [EMAIL PROTECTED]: Thanks, Dan. Well, I see I broke right-mouse click on the prototype. It's not a sync issue, because it's broken even with just one applet on a page and no JavaScript. I'll look into it. But if you broke it, why does it still work in Firefox with Linux? Regards, Rolf This message was sent using IMP, the Internet Messaging Program. --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users -- Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:[EMAIL PROTECTED] http://www.stolaf.edu/people/hansonr Imagination is more important than knowledge. - Albert Einstein --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Bob Hanson wrote: Rolf Huehne wrote: unreliable. If the interface could recognize any selection change and then ask Jmol for the current selection this would simplify that a lot and make it much more reliable. The challenge here would be providing anything other than a purely atom-by-atom selection. But would the equivalent be to trace the selection sets and, through that, be able to provide a script of the selections in order? Might be a bit lengthy, but it could provide the current selection automatically -- sort of a selectionHistory idea? I think it might be too slow and would also need a lot of space. To build the start view for a specific PDB entry in my interface there are often hundreds or even thousands of selections involved. And some buttons might add another few hundred selections. I don't think this would be fast enough. And it would get slower and slower with every action the user does. What I have in mind is another idea. I don't know anything about the internal datastructures in Jmol but I would expect that there are some kinds of lists where for each atom is stored to which residue, chain etc. it belongs. And vice versa lists where for each residue, chain etc. is stored which atoms belong to it. Using these lists it could be detrmined from which residues all atoms are in the current selection. The same could then be done for these residues reagarding chains and so on. Whith this approach you should always end up with the most condensed form to describe the current selection. If for example an option like 'set picking group' would be provided, it would be sufficient that a single atom of a residue is selected. I cannot estimate if this might also take too much time, but I think there is room for optimization. The same approach could also be used to build the script for a full dump. Instead of using the selected atoms, the atoms with the same properties could be grouped in a first step. Then the described approach could be used for each of these groups. I know that I have simplified things, but I just wanted to present the general idea. c) What sort of information (exactly) are you looking for? So I would like to have all information on any atom that is necessary to produce exactly the same display. If possible and suitable the same on a higher level (like group, chain) or even as a complete 'reload script'. I would like to get information on selection changes. I would like to get information on the current selection, also on different levels (like atom, group etc.) if possible and suitable. What if it just reproduced the exact script history, say, from the most recent load? (One would assume there are no loops.) I guess it might work, but depending of the kind and number of commands it might even take minutes to follow all the commands. And the combined script might be really large. Regards, Rolf This message was sent using IMP, the Internet Messaging Program. --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
[EMAIL PROTECTED] wrote: The same approach could also be used to build the script for a full dump. Instead of using the selected atoms, the atoms with the same properties could be grouped in a first step. Then the described approach could be used for each of these groups. I know that I have simplified things, but I just wanted to present the general idea. It's certainly an interesting challenge -- the goal, to provide a snapshot of the state of the system. There are two logical approaches I can think of: a) a record of scripts run. b) a dump of properties for every single atom, preferably grouped into sets. While you suggest that there could be hundreds or thousands of selects -- this is not a real problem. A general solution is needed. Let's see what Miguel thinks. I guess it might work, but depending of the kind and number of commands it might even take minutes to follow all the commands. Oh, I doubt that. Remember, no rendering while this is running. Jmol is exceptionally fast. But let's keep thinking about this. At least I should be able to have for you a mechanism that allows script history to be delivered. Orientation is not an issue -- there is only one final orientation. So it's just select/operate, select/operate, etc., and one final orientation setting. And the combined script might be really large. I think it's worth experimenting with. -- Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:[EMAIL PROTECTED] http://www.stolaf.edu/people/hansonr Imagination is more important than knowledge. - Albert Einstein --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
It's certainly an interesting challenge -- the goal, to provide a snapshot of the state of the system. [snip] Let's see what Miguel thinks. Miguel is explicitly sitting on the sidelines to watch this discussion. At one extreme, RasMol supports this in a very simplistic way ... select each atom/bond/etc. and set its characteristics one by one. At the other extreme, an 'optimal' solution is not possible. Between those extremes, I think that there lots of room for experimentation. I think that you need to come up with a set of heuristics and try it out. Miguel --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid3432bid#0486dat1642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Bob Hanson wrote: OK, I'm making my way through the resonses here. In the mean time I have implemented (another) prototype that I would like people to take a look at. See the files in http://www.stolaf.edu/people/hansonr/jmol/test/json in particular: http://www.stolaf.edu/people/hansonr/jmol/test/json/json.htm http://www.stolaf.edu/people/hansonr/jmol/test/json/callback.htm http://www.stolaf.edu/people/hansonr/jmol/test/json/sync.htm snip sync.htm Someone -- sorry, I can't find the message right now -- suggested that this might be used for synchronizing two applets. Well, that sounded fine to me. So I decided to see whether it would work. Why not 4? On this page the jmolSynchronize() command is all you do. Just enter the numbers of the applets you want to synchronize, so, for example: jmolSynchronize(0,1,2,3,4,5) would sync the first 6 applets on the page. You could of course first set them up with different display characteristics. SOMEONE will use this! I tested the 'sync.htm' page. At a 'SuSE Linux 9.3' computer it didn't work with 'Firefox 1.0.7' (no reaction in the other applets) , but worked with 'Konqueror'. At a 'Windows XP SP2' computer it worked with 'Firefox 1.0.7' and 'Internet Explorer', but 1 or 2 of the applets didn't show the molecule, although they responded to the mouse with a rotation. In all cases where the synchronization worked, the Jmol popup menu (right mouse click) didn't work. In the other case the popup menu worked as usual. Regards, Rolf --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
More reports, please. If you have access to JavaScript console or Java Console and it's not working, please check there. It might be just a communication issue. Rolf, what do you see on those other pages? Is the polling working there? My guess is these pages mess up with identifying the applet, resulting in failure to get an applet object, not the getProperty() method itself. Any info you can provide would be helpful. These sound like good platforms to do some more step-by-step debugging on. Also, at http://www.stolaf.edu/people/hansonr/jmol/docs/examples/callback.htm do you see messages being reported in the textarea under the applet? Bob Rolf Huehne wrote: Bob Hanson wrote: OK, I'm making my way through the resonses here. In the mean time I have implemented (another) prototype that I would like people to take a look at. See the files in http://www.stolaf.edu/people/hansonr/jmol/test/json in particular: http://www.stolaf.edu/people/hansonr/jmol/test/json/json.htm http://www.stolaf.edu/people/hansonr/jmol/test/json/callback.htm http://www.stolaf.edu/people/hansonr/jmol/test/json/sync.htm snip sync.htm I tested the 'sync.htm' page. At a 'SuSE Linux 9.3' computer it didn't work with 'Firefox 1.0.7' (no reaction in the other applets) , but worked with 'Konqueror'. At a 'Windows XP SP2' computer it worked with 'Firefox 1.0.7' and 'Internet Explorer', but 1 or 2 of the applets didn't show the molecule, although they responded to the mouse with a rotation. In all cases where the synchronization worked, the Jmol popup menu (right mouse click) didn't work. In the other case the popup menu worked as usual. Regards, Rolf --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users -- Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:[EMAIL PROTECTED] http://www.stolaf.edu/people/hansonr Imagination is more important than knowledge. - Albert Einstein --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
WinXP, Firefox 1.5. First time: molecule didn't display in top-right applet (although click and drag there did rotate the other three!). Second time: all four sync'd. Both times: no right-click effect, no JavaScript Console messages, no text below applet (except Disclaimer link). Bob Hanson wrote: More reports, please. If you have access to JavaScript console or Java Console and it's not working, please check there. It might be just a communication issue. Rolf, what do you see on those other pages? Is the polling working there? My guess is these pages mess up with identifying the applet, resulting in failure to get an applet object, not the getProperty() method itself. Any info you can provide would be helpful. These sound like good platforms to do some more step-by-step debugging on. Also, at http://www.stolaf.edu/people/hansonr/jmol/docs/examples/callback.htm do you see messages being reported in the textarea under the applet? Bob Rolf Huehne wrote: Bob Hanson wrote: OK, I'm making my way through the resonses here. In the mean time I have implemented (another) prototype that I would like people to take a look at. See the files in http://www.stolaf.edu/people/hansonr/jmol/test/json in particular: http://www.stolaf.edu/people/hansonr/jmol/test/json/json.htm http://www.stolaf.edu/people/hansonr/jmol/test/json/callback.htm http://www.stolaf.edu/people/hansonr/jmol/test/json/sync.htm snip sync.htm I tested the 'sync.htm' page. At a 'SuSE Linux 9.3' computer it didn't work with 'Firefox 1.0.7' (no reaction in the other applets) , but worked with 'Konqueror'. At a 'Windows XP SP2' computer it worked with 'Firefox 1.0.7' and 'Internet Explorer', but 1 or 2 of the applets didn't show the molecule, although they responded to the mouse with a rotation. In all cases where the synchronization worked, the Jmol popup menu (right mouse click) didn't work. In the other case the popup menu worked as usual. Regards, Rolf --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Bob Hanson wrote: More reports, please. If you have access to JavaScript console or Java Console and it's not working, please check there. It might be just a communication issue. At the moment I have no time for more (but I'll check more detailed later), just the javascript error message from Firefox 1.0.7 at SuSE 9.3: Error: applet.getPropertyAsString is not a function Source File: http://www.stolaf.edu/people/hansonr/jmol/test/json/sync.htm Line: 25 Regards, Rolf --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Thanks, Dan. Well, I see I broke right-mouse click on the prototype. It's not a sync issue, because it's broken even with just one applet on a page and no JavaScript. I'll look into it. Dan Kirshner wrote: WinXP, Firefox 1.5. First time: molecule didn't display in top-right applet (although click and drag there did rotate the other three!). Second time: all four sync'd. Both times: no right-click effect, no JavaScript Console messages, no text below applet (except Disclaimer link). http://www.stolaf.edu/people/hansonr/jmol/test/json/sync.htm -- Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:[EMAIL PROTECTED] http://www.stolaf.edu/people/hansonr Imagination is more important than knowledge. - Albert Einstein --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Quoting Bob Hanson [EMAIL PROTECTED]: Thanks, Dan. Well, I see I broke right-mouse click on the prototype. It's not a sync issue, because it's broken even with just one applet on a page and no JavaScript. I'll look into it. But if you broke it, why does it still work in Firefox with Linux? Regards, Rolf This message was sent using IMP, the Internet Messaging Program. --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
I'm quite eager to have a simple version of this functionality. Thanks! a) Do you implement callbacks? If so, which ones? No, though I'd like to (once I understood how it works -- your mechanism I think I understand already!) b) What WOULD you use if you had it available? I want to know what residue a user has clicked on. c) What sort of information (exactly) are you looking for? I want to transfer that info back to the web page so I can highlight that residue in the Jmol display and also highlight portions of the web page (corresponding position in a multiple sequence alignment). d) Is there a particular format that you would like to see, other than just the current text-stream of messages? No, I'm not particular... e) Is it important to you that this mechanism be backward compatible? Just let my current javascript/Jmol interactions (using jmol.js) -- which don't do any callbacks -- work as is. A question of my own: Does your (impressive) demonstration at http://www.stolaf.edu/people/ hansonr/jmol/test/json/json.htm involve polling every 1/10 second or some such in order to get updated info (at least for the orientation info link)? Thanks again. --Dan --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
OK, I'm making my way through the resonses here. In the mean time I have implemented (another) prototype that I would like people to take a look at. See the files in http://www.stolaf.edu/people/hansonr/jmol/test/json in particular: http://www.stolaf.edu/people/hansonr/jmol/test/json/json.htm http://www.stolaf.edu/people/hansonr/jmol/test/json/callback.htm http://www.stolaf.edu/people/hansonr/jmol/test/json/sync.htm json.htm This file demonstrates the proposed getProperty() command and its varients, getPropertyAsString() and getPropertyAsJSON(). My favorites is extractModel. callback.htm The JavaScript in callback.htm is just a mess -- sorry -- I would recommend not looking too closely at it. But what you can get from that page is an idea of the SORT of callback-like information you should be able to get soon. sync.htm Someone -- sorry, I can't find the message right now -- suggested that this might be used for synchronizing two applets. Well, that sounded fine to me. So I decided to see whether it would work. Why not 4? On this page the jmolSynchronize() command is all you do. Just enter the numbers of the applets you want to synchronize, so, for example: jmolSynchronize(0,1,2,3,4,5) would sync the first 6 applets on the page. You could of course first set them up with different display characteristics. SOMEONE will use this! Realize there are two related systems here -- status and properties. The status idea is that Jmol now records internally when its state changes. I think it's a pretty efficient method. It isn't a history, so it doesn't grow hugely, and it won't save any status information until you tell it what kind you want to look at. In addition to this, indepenent of the callback issue -- but necessary for its replacement -- Jmol now can deliver properties without accessing the script command. Dan Kirshner wrote: A question of my own: Does your (impressive) demonstration at http://www.stolaf.edu/people/hansonr/jmol/test/json/json.htm involve polling every 1/10 second or some such in order to get updated info (at least for the orientation info link)? yes, exactly. I'm polling every 100 ms. This seems to be quite fast enough. See also the new sync.htm file. Bob Hanson --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Hi Bob, AS A USER, WHAT DO YOU WANT? a) Do you implement callbacks? If so, which ones? AnimFrame to synchronize other Javascript functions with an animation Pick to identify atoms, in particular in our molecule editor Message to return measurements, now largely replaced by monitors though b) What WOULD you use if you had it available? This pretty much serves our needs. Although we do a lot of other things in scripts that are not directly related to callbacks. You suggested reading the second line of an XYZ file, but this can be done by a script outside Jmol as well, where the results are being processed. c) What sort of information (exactly) are you looking for? d) Is there a particular format that you would like to see, other than just the current text-stream of messages? e) Is it important to you that this mechanism be backward compatible? Well yes. We could always maintain a current version of Jmol of course, in case we don't find the time to rewrite our pages. (I wish I had your efficient way of working.) Greetings, Hens --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Bob Hanson a écrit : AS A USER, WHAT DO YOU WANT? a) Do you implement callbacks? If so, which ones? With chime, I use messagecallback and pickcallback. I use message callback to get informations such as : model sequence, names of residues or chains in a selection, end of a script, number of atoms currently selected. I use pick callback to get atoms details, measurements, and allow labeling of a specified atom by clicking. At present, with Jmol I only use message callback to get informations about the proper execution of a script. b) What WOULD you use if you had it available? sequences, content of a selection. c) What sort of information (exactly) are you looking for? residues names and numbers, chains IDs, biochemical type of a chain (DNA, RNA, protein), atoms IDs/type/residue/chain d) Is there a particular format that you would like to see, other than just the current text-stream of messages? It would be far better not to have to parse the text stream. Any kind of javascript object/array would be handfull e) Is it important to you that this mechanism be backward compatible? No. I think that for interactive interactions such as clicks or knowing when the applet is ready, the current callback method does the job well. To get more complex properties, your method seems to be more appropriate Regards, Paul --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Bob Hanson wrote: ... b) What WOULD you use if you had it available? the monitor/measure command, especially if there is no need for atom numbers but select expressions could be used Hmm. Usually for those you need an ordered list, right? But one could imagine following the bonding in some cases. Say more. I don't see a difference whether I say monitor 2087 2088 or monitor ([LIP]3:A.O5) ([LIP]3:A.O6) ( is signaling that a select expression has to be evaluated first to get the monitor command argument the show selected command to evaluate current selection done check out http://www.stolaf.edu/people/hansonr/jmol/test/json/json.htm c) What sort of information (exactly) are you looking for? depends on the status of set picking, in most cases set picking atom show orientation show center RasMolshow selected group RasMolset picking distance these are taken care of by getProperty(). -- no need for callbacks here. OK with that callback would only be luxurious for Jmol console use and especially with a console only mode, if a Jmol --nodisply batch run option would get implemented like in RasMol, if the applet is used, JavaScript is already involved and there is no need for callback via JmolScript, getProperty() is superior, callback is only used for functional compatibility with RasMol scripts. d) Is there a particular format that you would like to see, other than just the current text-stream of messages? I like the ready to use command line like output, e.g. picking should result in a ready to use select expression [LYS]54.CD #798 is OK, it isn't difficult to filter e.g. [LYS]54.CD from this. so, for example: msg: 58,atomPick,296,[ASP]43.O #297 msg: 57,atomPick,223,[CYS]32.N #224 msg: 56,atomPick,222,[GLY]31.O #223 msg: 55,atomPick,226,[CYS]32.O #227 right? as I wrote, I like atomInfo[n].info $ show orientation moveto 1 -1000 0 0 180.0; OR reset; rotate z 180.0; rotate y 180.0; no problem. getProperty(orientationInfo) orientationInfo=new Array() orientationInfo.moveTo=moveto 1 -791 -611 24 78.4; orientationInfo.rotateZYZ=reset; rotate z -126.6; rotate y 78.3; rotate z 128.8; orientationInfo.rotateXYZ=reset; rotate x -75.6; rotate y -35.7; rotate z 30.2; RasMolshow selected group should result in a select expression Hmm. That's an interesting idea. How does it choose the right select expression? But I see what you are after -- so that you can save that and recall that particular selection. This could be tricky The right is *a* short expression, if 16/16 atoms of a group are selected, no doubt, no individual atom should be selected. There is no need for the shortest, but a symbolic human readable expression is preferred over *only* an ordered atom number list (needed for compare operations). e.g. =1 model? model expression =1 chain?chain expression =1 group? group expression 0.5 group? group expression and not ( atom expression ) 4 atoms? group expression and ( atom expression ) backbone?group expression and backbone :atom expression Regards, Jan ... --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Bob Hanson wrote: Jan wrote: I don't see a difference whether I say monitor 2087 2088 or monitor ([LIP]3:A.O5) ([LIP]3:A.O6) Oh, sure. OK. I don't know that we are headed that way wth the monitor command, because there are some programming issues with putting two atom expressions in the same command -- nothing really insurmountable, really, but not exactly trivial. I thought you were talking about, say, specifying four atoms and then somehow Jmol was to decide what arrangement you wanted for a dihedral. THAT seems prone to problems. But I don't see why we couldn't have: getProperty(getDistance, [LIP]3:A.O5, [LIP]3:A.O6) Mostly I don't like special cases. So the challenge would be to make this extensible to getProperty(getAngle, [LIP]3:A.O5,[LIP]3:A.O6,[LIP]3:A.O7) we already have monitor 111 112 113 why not getProperty(measure,[LIP]3:A.O5,[LIP]3:A.O6,[LIP]3:A.O7) no additional keyword has to be remembered ... some seconds later ... this is not necessary, something like getProperty('monitor ' + getPorperty('select [LIP]3:A.O5').atomInfo[0].atomno + ' ' + ... would do it until the script parser itself managed to parse multiple select expressions (or Jmol.js) getProperty(getTorsionAngle, [LIP]3:A.O5,[LIP]3:A.O6,[LIP]3:A.O7,[LIP]3:A.O8) Anyway -- these would be in the category not a callback, I think. But it's a great idea, and one that we'll definitely implement somehow. I'm assuming for this idea: 1) You don't want to (necessarily) display the monitor line w/ or w/o numbers agreed 2) You want to be able to display the monitor line w/ or w/o numbers (do that separately, with a script command, but that command format could be returned as one of the elements of the data structure). yes 3) All three -- getDistance, getAngle, getTorsionAngle -- should be available. Maybe a simple getPosition as well, just to head off the obvious request. Yes, I could imagine this to be very useful. Yes, this would be comfortable, it saves me from using atomInfo[0].x atomInfo[0].y atomInfo[0].z By the way, Jmol caches up to 16 measurements. (Something the applet has never had an interface to.) That is, you can make up to 16 measurements by clicking the mouse, and they are all saved automatically. The Jmol application utilizes this for its table; there's no reason not to expose it as a JSON structure to the web page. a monitoring function on your callback.htm monitor: measurementsChange works for me, but I miss the corresponding e.g. monitor 1 2 3 command which would be much more readable if 1 2 3 where atomInfo[0].info strings monitor:measureSelection didn't work? The distinction I think I want to make here is the .script() method used solely/primarily for driving the display; the .getProperty() method for retrieving information. We can talk about .setProperty() or .scriptSynchronous() later callback would only be luxurious for Jmol console use and especially with a console only mode, if a Jmol --nodisply batch run option would get implemented like in RasMol, if the applet is used, JavaScript is already involved and there is no need for callback via JmolScript, getProperty() is superior, callback is only used for functional compatibility with RasMol scripts. callbacks don't have any relation to the console -- those are just messages. The function of callbacks -- or their replacement with getProperty(callbackStatus,...) -- is to deliver timely information about user activity. When there is no user, there is no issue with callbacks, I think. I use callbacks in RasMol to query e.g. which amino acids are in 3.2 A distance to a hetero component (echo load pdb inline\nselect within(3.2, [LIP]3) and not [LIP]3\nshow selected group\nexit\n;cut 1imb.pdb) | rasmol -nodisplay | evaluateMakeRasMolScriptFromIt.pl | rasmol without any user, the startup JmolScript could replace the interacting user, that is the main use for messageCallback RasMolshow selected group should result in a select expression Hmm. That's an interesting idea. How does it choose the right select expression? But I see what you are after -- so that you can save that and recall that particular selection. This could be tricky The right is *a* short expression, if 16/16 atoms of a group are selected, no doubt, no individual atom should be selected. There is no need for the shortest, but a symbolic human readable expression is preferred over *only* an ordered atom number list (needed for compare operations). e.g. =1 model? model expression =1 chain?chain expression =1 group? group expression 0.5 group? group expression and not ( atom expression ) 4 atoms? group expression and ( atom expression ) backbone?group expression and backbone :atom expression This would be a major challenge, I think. But at least you can do getProperty(atomInfo,(atom selection))) so if you like that, maybe that's all we need
Re: [Jmol-users] applet -- callback brainstorming
Jan wrote: we already have monitor 111 112 113 why not getProperty(measure,[LIP]3:A.O5,[LIP]3:A.O6,[LIP]3:A.O7) sure, we'll do something like this. a monitoring function on your callback.htm monitor: measurementsChange works for me, but I miss the corresponding e.g. monitor 1 2 3 command which would be much more readable if 1 2 3 where atomInfo[0].info strings OK monitor:measureSelection didn't work? It doesn't do what you think. First click on load caffeine.xyz;set picking DISTANCE Now start clicking, while monitoring that property. I use callbacks in RasMol to query e.g. which amino acids are in 3.2 A distance to a hetero component (echo load pdb inline\nselect within(3.2, [LIP]3) and not [LIP]3\nshow selected group\nexit\n;cut 1imb.pdb) | rasmol -nodisplay | evaluateMakeRasMolScriptFromIt.pl | rasmol without any user, the startup JmolScript could replace the interacting user, that is the main use for messageCallback Ah, I see. OK. Well, it's an interesting question how to do: PDB FILE | (cut off a chunck) | (do something with it) | Jmol I don't know how Jmol is set up for command-line work like this. It hardly seems like it would be necessary to run Jmol twice (like you are running rasmol twice). Maybe this is a nice use for rasmol instead of Jmol. It does work there --- so why Jmol? Bob -- Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:[EMAIL PROTECTED] http://www.stolaf.edu/people/hansonr Imagination is more important than knowledge. - Albert Einstein --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Bob Hanson wrote: ... I use callbacks in RasMol to query e.g. which amino acids are in 3.2 A distance to a hetero component (echo load pdb inline\nselect within(3.2, [LIP]3) and not [LIP]3\nshow selected group\nexit\n;cut 1imb.pdb) | rasmol -nodisplay | evaluateMakeRasMolScriptFromIt.pl | rasmol without any user, the startup JmolScript could replace the interacting user, that is the main use for messageCallback Ah, I see. OK. Well, it's an interesting question how to do: PDB FILE | (cut off a chunck) | (do something with it) | Jmol PDB FILE | (extract some information form it, e.g. ligands of a hetero component, and generate a script to visualize) | Jmol or RasMol or Chime that is what already runes using (rasmol -nodisplay) to extract e.g. ligand information, rasmol with the -nodisplay option has the flexibility to be used as a simple automatic script driven structure analysis tool but I don't know how Jmol is set up for command-line work like this. It hardly seems like it would be necessary to run Jmol twice (like you are running rasmol twice). Maybe this is a nice use for rasmol instead of Jmol. It does work there --- so why Jmol? with the Jmol applet, web server side processing isn't necessary any more, the idea is, that all the automatic structure analysis could be done on client side while a startup JmolScript is running and a structure specific visualization script is generate, which completes the start process (generating structure specific interaction panels ...). ( at this time I'm sad that both, RasMol and Jmol didn't support the PDB format completely e.g. ^insCode versus ;altLoc but I count on you and Jmol which is evolving and will make it some day, and is relay a great applet. ) Regards, Jan --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
I'm quite eager to have a simple version of this functionality. Thanks! a) Do you implement callbacks? If so, which ones? No, though I'd like to (once I understood how it works -- your mechanism I think I understand already!) b) What WOULD you use if you had it available? I want to know what residue a user has clicked on. c) What sort of information (exactly) are you looking for? I want to transfer that info back to the web page so I can highlight that residue in the Jmol display and also highlight portions of the web page (corresponding position in a multiple sequence alignment). d) Is there a particular format that you would like to see, other than just the current text-stream of messages? No, I'm not particular... e) Is it important to you that this mechanism be backward compatible? Just let my current javascript/Jmol interactions (using jmol.js) -- which don't do any callbacks -- work as is. A question of my own: Does your (impressive) demonstration at http://www.stolaf.edu/people/hansonr/jmol/test/json/json.htm involve polling every 1/10 second or some such in order to get updated info (at least for the orientation info link)? Thanks again. --Dan --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
I'm sad that both, RasMol and Jmol didn't support the PDB format completely e.g. ^insCode versus ;altLoc but I count on you and Jmol which is evolving and will make it some day, and is relay a great applet. ) Regards, Jan Jan, As you know that I have tried several times to add altLoc support into Jmol. You have made a number of suggestions as to how this should be implemented. Nevertheless, I have not been able to understand the problem enough to be able to design a solution that would fit within the Jmol architecture. At some point I hope to get this resolved. Miguel --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid3432bid#0486dat1642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Bob Hanson wrote: ... AS A USER, WHAT DO YOU WANT? a) Do you implement callbacks? If so, which ones? I only use pickCallback to monitor user picking and messageCallback to evaluate current orientation. b) What WOULD you use if you had it available? the monitor/measure command, especially if there is no need for atom numbers but select expressions could be used the show selected command to evaluate current selection c) What sort of information (exactly) are you looking for? depends on the status of set picking, in most cases set picking atom show orientation show center RasMolshow selected group RasMolset picking distance d) Is there a particular format that you would like to see, other than just the current text-stream of messages? I like the ready to use command line like output, e.g. picking should result in a ready to use select expression [LYS]54.CD #798 is OK, it isn't difficult to filter e.g. [LYS]54.CD from this. $ show orientation moveto 1 -1000 0 0 180.0; OR reset; rotate z 180.0; rotate y 180.0; RasMolshow selected group should result in a select expression e) Is it important to you that this mechanism be backward compatible? As long as the information is still accessible, no. MORE SPECIFC QUESTION: 1. There are currently four callbacks: animFrameCallback loadStructCallback pickCallback select expression messageCallback moveto select expression distance/angle measurement data Each of these fulfills an obvious need. Should there be more callback-like options? If so, what? picking ident|position|measure status orientation center structure bound selection group|atom measure distance|angle|torsion|phipsi Regards, Jan The evolving test page for this project can be found at http://www.stolaf.edu/people/hansonr/jmol/test/json/callback.htm nice, atomInfo especially the tailing select expression atomInfo[0].info Bob Hanson --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
On Feb 9, 2006, at 2:07 p, Bob Hanson wrote: I'm looking at the Jmol callback issue. snip I propose that there be a fundamentally different mechanism that does not rely upon callback functions (but could be backward- compatible with these if desired). I think this is an excellent idea. Miguel has been hinting at something like this for a while, but the need for it never reached 'critical mass' in the user community (or so I infer from the responses over the months). The details of the implementation aren't particularly important right now (on this list). But, basically, it would involve one JavaScript timer per applet and the idea of polling -- the web page periodically polls the applet -- say, 10 times per second, -- looking for changes of interest to particular properties of the model. It's relatively simple to implement -- that's not the issue. The issue is this: AS A USER, WHAT DO YOU WANT? as a resource developer, I want a way to ask the applet for the status of something, have the applet respond in some logical syntax, and then do with that info whatever I please. for example: what atom was last picked? what is the orientation of the molecule? which atoms are colored red? what color is this atom? what is the format of this atom? is this atom visible? how many Fe atoms are present in the structure? what is the currently selected atomset? which protein residues are in alpha helices? ... a) Do you implement callbacks? If so, which ones? yes, pickCallback and messageCallback. in some applications, I use these extensively. it is painful, does not work consistently, and severely hampers platform and browser compatibility. this is no reflection at all on Miguel's implementation of them; as he has said many times before, callbacks are not the ideal solution. b) What WOULD you use if you had it available? callbacks? none, if I didn't have to. :-) c) What sort of information (exactly) are you looking for? see examples above. mainly, state of atoms. but given some time, I could probably think up a few new ideas. d) Is there a particular format that you would like to see, other than just the current text-stream of messages? that will depend on the data, I think. ask for a number, get a number. ask for a set, get an array. ask for a color, get a string. perhaps some kind of javascript Object could handle all cases? e) Is it important to you that this mechanism be backward compatible? since this is a brand new mechanism, I don't think that backwards- compatibility is even an issue. MORE SPECIFC QUESTION: 1. There are currently four callbacks: animFrameCallback loadStructCallback pickCallback messageCallback Each of these fulfills an obvious need. Should there be more callback-like options? My primary use of callbacks revolves around polling the applet for information about the structure, or for capturing commands sent to the applet by the user. and really, the former is simply a modification of the latter - with my javascript code in place of the user, since I have to send a command to the applet in order to find out something useful. to me, this functionality should not be in the realm of the callbacks, but handled by something else - exactly what you are proposing, Bob. as far as querying the applet for its own state - I suppose callbacks could have a purpose here, though I don't use them as such (I generally just watch the applets[] array, for example). regards, tim -- Timothy Driscollem: [EMAIL PROTECTED] molvisions - see. grasp. learn. ph: 919-368-2667 http://www.molvisions.com/im: molvisions usa:virginia:blacksburg tx: [EMAIL PROTECTED] Let each and every cell rejoice! For today we celebrate the first, glorious anniversary of the Information Purification Directive! We have created, for the first time in all history, a garden of pure ideology, where each worker may bloom secure from the pests of contradictory and confusing truths. --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Timothy Driscoll wrote: On Feb 9, 2006, at 2:07 p, Bob Hanson wrote: AS A USER, WHAT DO YOU WANT? as a resource developer, I want a way to ask the applet for the status of something, have the applet respond in some logical syntax, and then do with that info whatever I please. for example: what atom was last picked? * what is the orientation of the molecule? * which atoms are colored red? what color is this atom? what is the format of this atom? (eh?) is this atom visible? how many Fe atoms are present in the structure? * what is the currently selected atomset? * which protein residues are in alpha helices? * Super. This is just what I'm looking for. The ones with * I have already implemented for the applet, at least. Do take a look at http://www.stolaf.edu/people/hansonr/jmol/test/json/callback.htm. There are no actual callbacks here. ... a) Do you implement callbacks? If so, which ones? yes, pickCallback and messageCallback. in some applications, I use these extensively. it is painful, does not work consistently, and severely hampers platform and browser compatibility. this is no reflection at all on Miguel's implementation of them; as he has said many times before, callbacks are not the ideal solution. Please do try that prototype site. I'll cross my fingers that it works better. b) What WOULD you use if you had it available? callbacks? none, if I didn't have to. :-) done c) What sort of information (exactly) are you looking for? see examples above. mainly, state of atoms. but given some time, I could probably think up a few new ideas. d) Is there a particular format that you would like to see, other than just the current text-stream of messages? that will depend on the data, I think. ask for a number, get a number. ask for a set, get an array. ask for a color, get a string. perhaps some kind of javascript Object could handle all cases? Are we talking applet or app here for you, Tim? e) Is it important to you that this mechanism be backward compatible? since this is a brand new mechanism, I don't think that backwards- compatibility is even an issue. It's easy enough to leave the current callback mechanism in, I suppose. MORE SPECIFC QUESTION: 1. There are currently four callbacks: animFrameCallback loadStructCallback pickCallback messageCallback Each of these fulfills an obvious need. Should there be more callback-like options? My primary use of callbacks revolves around polling the applet for information about the structure, or for capturing commands sent to the applet by the user. and really, the former is simply a modification of the latter - with my javascript code in place of the user, since I have to send a command to the applet in order to find out something useful. to me, this functionality should not be in the realm of the callbacks, but handled by something else - exactly what you are proposing, Bob. Here's what I found already lying around under the hood in Jmol, and so I implemented on that prototype page: atomPick fileLoad fileLoadError frameChange measureSelection(atom picking with SET PICKING ) measurementsChange (rubber-band-like measurement calculating/displaying) scriptStart scriptEcho scriptStatus scriptTermination statusMessage viewerRefresh (orientation, zoom, etc.) All these were in place, just not identified externally as such. It may be too long a list. Tim, I'd like you to try the extractModel and tell me what you think. Using 1crn.pdb, create an interesting atom selection, then extract it. Useful? Bob --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] applet -- callback brainstorming
Jan wrote: Bob Hanson wrote: ... AS A USER, WHAT DO YOU WANT? a) Do you implement callbacks? If so, which ones? I only use pickCallback to monitor user picking and messageCallback to evaluate current orientation. Great, those are easy. Check out http://www.stolaf.edu/people/hansonr/jmol/test/json/callback.htm b) What WOULD you use if you had it available? the monitor/measure command, especially if there is no need for atom numbers but select expressions could be used Hmm. Usually for those you need an ordered list, right? But one could imagine following the bonding in some cases. Say more. the show selected command to evaluate current selection done check out http://www.stolaf.edu/people/hansonr/jmol/test/json/json.htm c) What sort of information (exactly) are you looking for? depends on the status of set picking, in most cases set picking atom show orientation show center RasMolshow selected group RasMolset picking distance these are taken care of by getProperty(). -- no need for callbacks here. d) Is there a particular format that you would like to see, other than just the current text-stream of messages? I like the ready to use command line like output, e.g. picking should result in a ready to use select expression [LYS]54.CD #798 is OK, it isn't difficult to filter e.g. [LYS]54.CD from this. so, for example: msg: 58,atomPick,296,[ASP]43.O #297 msg: 57,atomPick,223,[CYS]32.N #224 msg: 56,atomPick,222,[GLY]31.O #223 msg: 55,atomPick,226,[CYS]32.O #227 right? $ show orientation moveto 1 -1000 0 0 180.0; OR reset; rotate z 180.0; rotate y 180.0; no problem. getProperty(orientationInfo) orientationInfo=new Array() orientationInfo.moveTo=moveto 1 -791 -611 24 78.4; orientationInfo.rotateZYZ=reset; rotate z -126.6; rotate y 78.3; rotate z 128.8; orientationInfo.rotateXYZ=reset; rotate x -75.6; rotate y -35.7; rotate z 30.2; RasMolshow selected group should result in a select expression Hmm. That's an interesting idea. How does it choose the right select expression? But I see what you are after -- so that you can save that and recall that particular selection. This could be tricky e) Is it important to you that this mechanism be backward compatible? As long as the information is still accessible, no. MORE SPECIFC QUESTION: 1. There are currently four callbacks: animFrameCallback loadStructCallback pickCallback select expression messageCallback moveto select expression distance/angle measurement data got it. Each of these fulfills an obvious need. Should there be more callback-like options? If so, what? picking ident|position|measure done, I think. status orientation center structure bound selection group|atom not callbacks -- getProperty() measure distance|angle|torsion|phipsi I like this idea for a getProperty(). Might take a little work. Bob --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users