Thanks alot Robert for the support.
What is going on is the following.
The server displays a Jmol applet showing a model(VDW spheres representing an ionized residue, in total around 100 spheres). The user rotates the sphere model, then I want to save the coordinates of the rotated model (its used as the input for another calculation). We are doing this at the moment through CGI and Python
I'll give it try.

Martin






On 08.09.11 12:29, Robert Hanson wrote:
Martin, the signed applet can save the coordinates in PDB file format to disk:

write ?.pdb  # lets the user pick a name
write xxxx.pdb # lets the user confirm a name

atomList = write("pdb") # stores the PDB ATOM/HETATOM/records in variable atomList
x = load("myserver/page?POST?name=xxxx?atoms=" + atomList)

# posts this information to your server, which would presumably have some sort of PHP or ASP script ready to accept and process it.


All these commands work on the currently selected atoms only and include just the MODEL, ATOM, HETATOM, and ENDMDL records, so it does not solely replace the atom locations in a given PDB file. It does not include TER records, CONECT, or any REMARK records. So I'm not sure that's really what you are after. But if you have this specific need, to replace just the COORDINATES in a file, a little PHP programming would probably do it. Or you could write a little script in Jmol that would do that.

The Jmol script would look something like this:

function replacePDBCoords(outFileName) {
 var oldData = getProperty("fileContents")
 var atomData = write("PDB")
 var newData = [ ]
 var newpt = 1
 var atompt = 1
 for (var i = 1; i <= oldData.length; i++) {
  var line = oldData[i]
newData[pt++] = (find(line, "ATOM") == 1 || find(line,"HETATM") == 1 ? atomData[atompt++] : line)
 }
 write var newData @outFileName
}

On Wed, Sep 7, 2011 at 7:43 PM, Martin Hediger <[email protected] <mailto:[email protected]>> wrote:

    It would be great to have an illustration of it, i didnt find
    anything in the documentation.
    The simpler the better, improvements can always be made, but as
    long as the most basic functionality works, thats the best.

    Martin




    Am 07.09.11 23:37, schrieb Robert Hanson:
    No need for the signed applet if you are just communicating with
    your server. Just pass the information via a POST to your server
    from the applet (I can show you how to do that; not sure that's
    documented) or using AJAX from the page itself.

    On Wed, Sep 7, 2011 at 4:07 PM, Martin Hediger <[email protected]
    <mailto:[email protected]>> wrote:

        Hi Angel
        Thanks for the reply. Actually, at the moment it would be
        enough if Jmol
        could write to the disk of the server (which provides the
        page with the
        Jmol Applet). So i dont require a write to the local disk. Do
        i still
        require the signed applet for that?

        Thanks again
        Martin






        Am 07.09.11 18:50, schrieb Angel Herráez:
        > Hello Martin
        >
        > I'm responding without testing, but here are some hints
        until you get a more sound reply
        >
        > 1. The unsigned applet cannot save to disk, One possible
        bypass is to try "show coord" that
        > will output to the console (check the doc for precise
        syntax). I'm not sure if it can be used for
        > your purpose.
        >
        > 2. regarding the procedure of substituting signed for
        unsigned, a recent post in this list by
        > Jonathan Gutow explained how to do it. Basically you
        replace the html code (maybe
        > accessing document nodes)  AND  you need to pass the state
        script from one applet to the
        > new one, so that the model is replicated.
        >
        >
        >
        >
        
------------------------------------------------------------------------------
        > Using storage to extend the benefits of virtualization and
        iSCSI
        > Virtualization increases hardware utilization and delivers
        a new level of
        > agility. Learn what those decisions are and how to
        modernize your storage
        > and backup environments for virtualization.
        > http://www.accelacomm.com/jaw/sfnl/114/51434361/
        > _______________________________________________
        > Jmol-users mailing list
        > [email protected]
        <mailto:[email protected]>
        > https://lists.sourceforge.net/lists/listinfo/jmol-users
        >


        
------------------------------------------------------------------------------
        Using storage to extend the benefits of virtualization and iSCSI
        Virtualization increases hardware utilization and delivers a
        new level of
        agility. Learn what those decisions are and how to modernize
        your storage
        and backup environments for virtualization.
        http://www.accelacomm.com/jaw/sfnl/114/51434361/
        _______________________________________________
        Jmol-users mailing list
        [email protected]
        <mailto:[email protected]>
        https://lists.sourceforge.net/lists/listinfo/jmol-users




-- Robert M. Hanson
    Professor of Chemistry
    St. Olaf College
    1520 St. Olaf Ave.
    Northfield, MN 55057
    http://www.stolaf.edu/people/hansonr
    phone: 507-786-3107 <tel:507-786-3107>


    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


    
------------------------------------------------------------------------------
    Using storage to extend the benefits of virtualization and iSCSI
    Virtualization increases hardware utilization and delivers a new level of
    agility. Learn what those decisions are and how to modernize your storage
    and backup environments for virtualization.
    http://www.accelacomm.com/jaw/sfnl/114/51434361/


    _______________________________________________
    Jmol-users mailing list
    [email protected]  <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/jmol-users


    
------------------------------------------------------------------------------
    Doing More with Less: The Next Generation Virtual Desktop
    What are the key obstacles that have prevented many mid-market
    businesses
    from deploying virtual desktops?   How do next-generation virtual
    desktops
    provide companies an easier-to-deploy, easier-to-manage and more
    affordable
    virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
    _______________________________________________
    Jmol-users mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/jmol-users




--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


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


------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/


_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to