On Thu, 19 Feb 2004, Miguel Howard wrote:

> Tommi,
>
> Can you tell me a little about the ghemical?

It's a molecular modelling program written in C++. Currently it is split
in 2 parts:

libghemical : only contains the core functionality (no graphics
        or file I/O), has a built-in molecular mechanics implementation
        links to external libs to implement quantum-mechanics methods
        (libmopac7 and scientific toolkit from the MPQC program); the
        following list shows what can(+) and can't be done(-) currently:
                +compute energy/forces
                +do geometry optimization
                +do a molecular dynamics run
                +run different conformational searches
                -do a normal-mode analysis (vibrations/IR)

ghemical : contains a GUI part for gnome.

> What is the input format?

There is a native file format, and many other file formats are accessible
through file import/export capabilities that depend on OpenBabel.

However, I think none of the file formats directly fit into the plugin
use, and a new communication protocol is needed.

> > I'll learn about cgi and web servers before I start anything at the
> > server side.
>
> Good.

Yesterday evening I read a few tutorials about CGI, so here is the current
plan (please correct if needed).

Indeed using CGI we can achieve more or less the situation where
inputs/outputs of the plugin and the server are connected; the only
limitation seems to be that plugin can only send a single request and
only after the server has received it, it can send a single reply. But
this is not too bad, especially since it makes the server quite simple.

So the server would read standard input and write into standard output.
Now I see that it doesn't make sense to use the gnome/bonobo
ghemical-server, but instead a completely separate server is needed. Let's
call it "ghemical-cgi"; it will be a rather simple C++ console program
that uses resources from libghemical. Later it could be optimized into
this purpose (say smaller size and on-demand loading of parameter files).

So a web server should be installed and set functional, and the
ghemcal-cgi program should be copied into the cgi-bin directory. Then the
web server would launch it for each request separately, and connect it
into the plugin.

The plugin should ask user for server URL, say

        http://www.something.net        or
        http://www.something.net:80

Then internally it should add to URL a path to the cgi program:

        http://www.something.net:80/cgi-bin/ghemical-cgi

Now if such a request is sent to the web server, it should launch the
ghemical-cgi program, right?

Ok then the web-server launches ghemical-cgi so that some environmental
variables are set. Now the request form plugin should be sent to the
ghemical-cgi program. Since the request can be a large one (it could
contain the structure of a peptide or a whole protein molecule perhaps)
the simple means are not enough; by this I mean ghemical-cgi should get
the request from standard input.

How to do that then? My docs say that this the way it works if the html
request the plugin makes is of type POST. How this is done, is still a bit
unclear, and I'm studying it. Basically a socket should be opened to

        http://www.something.net:80

and a proper html request string should be sent that accesses
/cgi-bin/ghemical-cgi file using the POST method. The data to be sent is
included in this html request. The data should contain a description of
atoms and bonds, and instructions to ghemical-cgi what to do with them.
The protocol could be something like this:

-a header part for checking protocol versions etc.
        "hello, I have a job for you"

-descriptions of atoms/bonds etc.
        "there a x atoms and y bonds ; atom0 = ... atom1 = ..."

-the comp.chem. method to be used and related settings.
        "use molecular mechanics"
        "use a semi-empirical QM method, AM1, with total charge = 0"

-instructions about the operation to be done.
        "just calculate the energy"
        "do a geom-optimization and send structures after each x steps"

At this stage ghemical-cgi knows what to do, and can start working. It
should add only a simple header to the data it sends using stdout to the
web server, and then it can send data directly to the plugin; the start
of the reply to web-server and finally to plugin is

        Content-type: text/plain

        this is the first line of reply to the plugin.

Then the plugin just reads and interprets the reply stream until it ends.
The ghemical-cgi process is shut down and the operation is ready.

Any comments or enhancements?

> > I can start from client side by first figuring out how to
> > get and set atoms and bonds from/to Jmol classes.
>
> Be advised that these classes are subject to change.

Ok.

        Tommi



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to