SourceForge has been redesigned. Learn more.

#226 echo atom numbers


At the moment there is no way to determine the atom number of an
atom in Jmol, aside from reading it in the pdb file. IT would be
great if this info echoed to the console, through the pickCallBack in
the applet, and was shown in the 'hover' data.




  • Nobody/Anonymous

    Logged In: NO

    The third parameter in the callback is the atom number, but
    I, ah, ECHO your request to generalize the pick callback 2nd
    paramter to be based on the label %character format. The
    command we are looking for is something like

    pickcallback "This is atom %i with coordinates %x %y %z"

    Right now the 3rd parameter to the callback function is the
    atom index, starting with 0 for atom 1. (Same issue as frame
    callback giving "0" for frame 1. Is this something that
    should get fixed?) So if that is all you want, you have it.
    But I do note that with 1blu this callback is NOT the number
    in the third pdb column, because (a) it starts with 0, not
    1, and (b) there is a "TER" record that is numbered but has
    no atoms, so by the time you get to 614 the numbers reported
    are the rasmol "serial number--may have gaps" (%i) minus 2.
    The command "label %i" on the other hand, (as well as select
    atomno=n) reports the "gapped" PDB number. So, for example,
    in 1blu there is no "atomno=613" and no label with a 613 on
    it using

    select atomno>600 and atomno<620
    label %i

    select atomno=613
    reports "0 atoms selected"

    but picking atomno=615 reports to the pickCallback "613" in
    that third parameter.

    Bob Hanson

  • Miguel

    Miguel - 2004-06-29

    Logged In: YES

    I am not sure what you are trying to do ... I need a simple

    This is complicated but ... the third parameter to the
    PickCallback is *not* the atom number. Rather, it is the
    atom *index*. Atom numbers are something specific to .pdb
    files. The atom index is used internally by Jmol.

    I am actually quite reluctant to use this atom index. It
    will be a source of confusion until we get a well-defined
    API in place.


  • molvisions

    molvisions - 2004-06-29

    Logged In: YES

    Chime and RasMol report the value of the atom number column in the pdb
    file when an atom is clicked. this is useful (almost necessary) for setting
    monitor lines between atoms in a script file:

    monitor 134 1677

    it is also useful for dynamic actions based on the pick event in the Jmol
    applet - for example, color a picked atom, add a picked atom to the
    selected set, etc.

    function colorPicked(atomnum)
    #atomnum comes from the pickcallback
    document.jmol.script('select atomno='+atomnum+';color goldenrod;');



  • Miguel

    Miguel - 2004-09-17
    • status: open --> closed-fixed
  • Miguel

    Miguel - 2004-09-17

    Logged In: YES

    atom number is now reported as part of hover, default label,
    and atom click info


Log in to post a comment.