TABLE OF CONTENTS


::pwtk::smilesToCoor

SYNOPSIS

proc ::pwtk::smilesToCoor {smiles} {

PURPOSE

Transform molecular SMILES specs into Cartesian coordinates.

For info about SMILES, see: https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system

BEWARE

This routine requires the "obabel" program.

ARGUMENT

RETURN VALUE

Cartesian molecular coordinates, e.g.:

      C          1.06626        0.07457        0.00696
      H          2.15846        0.07457        0.00696
      H          0.70220       -0.59722       -0.77346
      H          0.70219        1.08633       -0.18463
      H          0.70219       -0.26539        0.97895    

SOURCE

    set xyz [fileutil::tempfile].xyz
    try_exec -ignorestderr -- obabel -:$smiles -oxyz -O $xyz --gen3D --best >& /dev/null

    set xyzl [split [string trim [readFile $xyz]] \n]
    catch { file delete $xyz }
    return [join [lrange $xyzl 2 end] \n]
}