#210 Load molecule data in ChemDoodle format?

v10
open
nobody
None
5
2014-11-27
2013-11-12
Mike Casey
No

I’ve been working on projects that rely on the extensive feature set of ChemDoodle web components. ChemDoodle is attractive because it includes almost every feature I need in a Javascript molecular structure editor, the full API is available, and its native molecule data format (2D data in Javascript Object Notation, that is easily convertible into a one-line string) contains a full description of every object created in a format that is easy to read, and to parse. ChemDoodle also writes comprehensive data for "shapes" objects (arrows, curved arrows, brackets, etc.) in JSON format, but they may not be so relevant to Jmol users?

May I request that the ability to read strings in the native ChemDoodle JSON molecule format be added to Jmol?

With thanks, Mike.

Related

Feature Requests: #210

Discussion

  • Bob Hanson

    Bob Hanson - 2013-11-13

    ___JmolVersion="13.3.9_dev_2013.11.13"

    code: experimenting with ambient occlusion

    new feature: write JSON xxx.json

    new feature: JSON {"mol":...} reader
    -- "m" instead of "mol" or filter "CD" (for "ChemDoodle"; applies 1/20, -1/20, 1/20 coordinate scaling)
    -- example (penicillin; no actual line breaks)
    {"mol":{
    "a":[{"x":3.9236999,"y":-0.9222,"z":0.1835},{"x":3.2479,"y":-3.2106004,"z":0.3821},{"x":5.1731,"y":-1.3284999,"z":-0.24640003},{"x":4.4973,"y":-3.6169,"z":-0.0478},{"x":5.4598002,"y":-2.6759,"z":-0.3623},{"x":1.599,"y":-1.4203,"z":0.9663},{"x":-4.2137,"y":0.8188001,"z":2.5929},{"x":-5.7525997,"y":0.1604,"z":0.70350003},{"l":"H","x":-0.92130005,"y":-0.6858,"z":0.8503},{"x":2.961,"y":-1.8632,"z":0.49760002},{"l":"O","x":-4.989,"y":2.5026002,"z":-1.2333001},{"l":"O","x":-1.2756001,"y":1.6640999,"z":-1.9360001},{"l":"O","x":1.104,"y":-1.4738001,"z":-1.3405999},{"l":"O","x":-4.604,"y":3.4702,"z":0.7158},{"x":-4.4305005,"y":2.47,"z":-0.1623},{"x":0.68810004,"y":-1.2541,"z":-0.2227},{"x":-3.5391,"y":1.3063,"z":0.1875},{"x":-1.4742,"y":-0.7,"z":-1.1997},{"x":-1.8847001,"y":0.7218999,"z":-1.4753001},{"l":"H","x":-5.185,"y":4.1949,"z":0.44660002},{"l":"N","x":-0.5887,"y":-0.86149997,"z":-0.043799996},{"x":-2.9578,"y":-0.84800005,"z":-0.8823999},{"x":-4.298,"y":0.3443,"z":1.1408},{"l":"S","x":-3.3189998,"y":-1.1949,"z":0.8809},{"l":"N","x":-3.159,"y":0.59889996,"z":-1.0386},{"l":"H","x":-2.6423,"y":1.6747,"z":0.6855},{"l":"H","x":-3.5207,"y":-1.4693998,"z":-1.5789001},{"l":"H","x":-4.6569,"y":1.8111,"z":2.6771998},{"l":"H","x":-4.7551003,"y":0.123500004,"z":3.2344003},{"l":"H","x":-3.1692,"y":0.86,"z":2.9017},{"l":"H","x":-5.7794,"y":-0.2569,"z":-0.3031},{"l":"H","x":-6.2558002,"y":-0.5187,"z":1.3918},{"l":"H","x":-6.2588997,"y":1.1256,"z":0.71029997},{"l":"H","x":-1.1443,"y":-1.2523,"z":-2.0796},{"l":"H","x":1.1846,"y":-2.1707997,"z":1.6393999},{"l":"H","x":1.6871,"y":-0.46960002,"z":1.4921},{"l":"H","x":3.7012,"y":0.1303,"z":0.2784},{"l":"H","x":2.4957001,"y":-3.9457002,"z":0.62750006},{"l":"H","x":5.9251003,"y":-0.5933,"z":-0.4921},{"l":"H","x":4.7215,"y":-4.6695,"z":-0.13759999},{"l":"H","x":6.4357004,"y":-2.9933,"z":-0.6989}],
    "b":[{"b":10,"e":14,"o":2},{"b":13,"e":14},{"b":14,"e":16},{"b":16,"e":24},{"b":16,"e":22},{"b":21,"e":24},{"b":18,"e":24},{"b":6,"e":22},{"b":7,"e":22},{"b":22,"e":23},{"b":21,"e":23},{"b":17,"e":21},{"b":17,"e":18},{"b":11,"e":18,"o":2},{"b":17,"e":20},{"b":15,"e":20},{"b":5,"e":15},{"b":12,"e":15,"o":2},{"b":5,"e":9},{"b":0,"e":9,"o":2},{"b":1,"e":9},{"b":0,"e":2},{"b":1,"e":3,"o":2},{"b":2,"e":4,"o":2},{"b":3,"e":4},{"b":13,"e":19},{"b":16,"e":25},{"b":21,"e":26},{"b":6,"e":27},{"b":6,"e":28},{"b":6,"e":29},{"b":7,"e":30},{"b":7,"e":31},{"b":7,"e":32},{"b":17,"e":33},{"b":8,"e":20},{"b":5,"e":34},{"b":5,"e":35},{"b":0,"e":36},{"b":1,"e":37},{"b":2,"e":38},{"b":3,"e":39},{"b":4,"e":40}]
    }}

     
  • Mike Casey

    Mike Casey - 2013-11-13

    Excellent! Thank you Bob, I look forward to trying it out later today, and will also try your suggestions about “hiding” JSmol.

    Best regards,

    Mike

    From: Bob Hanson [mailto:hansonr@users.sf.net]
    Sent: 13 November 2013 13:35
    To: [jmol:feature-requests]
    Subject: [jmol:feature-requests] #210 Load molecule data in ChemDoodle format?

    ___JmolVersion="13.3.9_dev_2013.11.13"

    code: experimenting with ambient occlusion

    new feature: write JSON xxx.json

    new feature: JSON {"mol":...} reader
    -- "m" instead of "mol" or filter "CD" (for "ChemDoodle"; applies 1/20, -1/20, 1/20 coordinate scaling)
    -- example (penicillin; no actual line breaks)
    {"mol":{
    "a":[{"x":3.9236999,"y":-0.9222,"z":0.1835},{"x":3.2479,"y":-3.2106004,"z":0.3821},{"x":5.1731,"y":-1.3284999,"z":-0.24640003},{"x":4.4973,"y":-3.6169,"z":-0.0478},{"x":5.4598002,"y":-2.6759,"z":-0.3623},{"x":1.599,"y":-1.4203,"z":0.9663},{"x":-4.2137,"y":0.8188001,"z":2.5929},{"x":-5.7525997,"y":0.1604,"z":0.70350003},{"l":"H","x":-0.92130005,"y":-0.6858,"z":0.8503},{"x":2.961,"y":-1.8632,"z":0.49760002},{"l":"O","x":-4.989,"y":2.5026002,"z":-1.2333001},{"l":"O","x":-1.2756001,"y":1.6640999,"z":-1.9360001},{"l":"O","x":1.104,"y":-1.4738001,"z":-1.3405999},{"l":"O","x":-4.604,"y":3.4702,"z":0.7158},{"x":-4.4305005,"y":2.47,"z":-0.1623},{"x":0.68810004,"y":-1.2541,"z":-0.2227},{"x":-3.5391,"y":1.3063,"z":0.1875},{"x":-1.4742,"y":-0.7,"z":-1.1997},{"x":-1.8847001,"y":0.7218999,"z":-1.4753001},{"l":"H","x":-5.185,"y":4.1949,"z":0.44660002},{"l":"N","x":-0.5887,"y":-0.86149997,"z":-0.043799996},{"x":-2.9578,"y":-0.84800005,"z":-0.8823999},{"x":-4.298,"y":0.3443,"z":1.1408},{"l":"S","x":-3.3189998,"y":-1.1949,"z":0.8809},{"l":"N","x":-3.159,"y":0.59889996,"z":-1.0386},{"l":"H","x":-2.6423,"y":1.6747,"z":0.6855},{"l":"H","x":-3.5207,"y":-1.4693998,"z":-1.5789001},{"l":"H","x":-4.6569,"y":1.8111,"z":2.6771998},{"l":"H","x":-4.7551003,"y":0.123500004,"z":3.2344003},{"l":"H","x":-3.1692,"y":0.86,"z":2.9017},{"l":"H","x":-5.7794,"y":-0.2569,"z":-0.3031},{"l":"H","x":-6.2558002,"y":-0.5187,"z":1.3918},{"l":"H","x":-6.2588997,"y":1.1256,"z":0.71029997},{"l":"H","x":-1.1443,"y":-1.2523,"z":-2.0796},{"l":"H","x":1.1846,"y":-2.1707997,"z":1.6393999},{"l":"H","x":1.6871,"y":-0.46960002,"z":1.4921},{"l":"H","x":3.7012,"y":0.1303,"z":0.2784},{"l":"H","x":2.4957001,"y":-3.9457002,"z":0.62750006},{"l":"H","x":5.9251003,"y":-0.5933,"z":-0.4921},{"l":"H","x":4.7215,"y":-4.6695,"z":-0.13759999},{"l":"H","x":6.4357004,"y":-2.9933,"z":-0.6989}],
    "b":[{"b":10,"e":14,"o":2},{"b":13,"e":14},{"b":14,"e":16},{"b":16,"e":24},{"b":16,"e":22},{"b":21,"e":24},{"b":18,"e":24},{"b":6,"e":22},{"b":7,"e":22},{"b":22,"e":23},{"b":21,"e":23},{"b":17,"e":21},{"b":17,"e":18},{"b":11,"e":18,"o":2},{"b":17,"e":20},{"b":15,"e":20},{"b":5,"e":15},{"b":12,"e":15,"o":2},{"b":5,"e":9},{"b":0,"e":9,"o":2},{"b":1,"e":9},{"b":0,"e":2},{"b":1,"e":3,"o":2},{"b":2,"e":4,"o":2},{"b":3,"e":4},{"b":13,"e":19},{"b":16,"e":25},{"b":21,"e":26},{"b":6,"e":27},{"b":6,"e":28},{"b":6,"e":29},{"b":7,"e":30},{"b":7,"e":31},{"b":7,"e":32},{"b":17,"e":33},{"b":8,"e":20},{"b":5,"e":34},{"b":5,"e":35},{"b":0,"e":36},{"b":1,"e":37},{"b":2,"e":38},{"b":3,"e":39},{"b":4,"e":40}]
    }}


    [feature-requests:#210] http://sourceforge.net/p/jmol/feature-requests/210/ Load molecule data in ChemDoodle format?

    Status: open
    Created: Tue Nov 12, 2013 09:53 AM UTC by Mike Casey
    Last Updated: Tue Nov 12, 2013 09:53 AM UTC
    Owner: nobody

    I’ve been working on projects that rely on the extensive feature set of ChemDoodle web components. ChemDoodle is attractive because it includes almost every feature I need in a Javascript molecular structure editor, the full API is available, and its native molecule data format (2D data in Javascript Object Notation, that is easily convertible into a one-line string) contains a full description of every object created in a format that is easy to read, and to parse. ChemDoodle also writes comprehensive data for "shapes" objects (arrows, curved arrows, brackets, etc.) in JSON format, but they may not be so relevant to Jmol users?

    May I request that the ability to read strings in the native ChemDoodle JSON molecule format be added to Jmol?

    With thanks, Mike.


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jmol/feature-requests/210/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Feature Requests: #210

  • Bob Hanson

    Bob Hanson - 2013-11-13

    see http://chemapps.stolaf.edu/jmol/zip/jmol-13.3.9_2013.11.13b.zip
    I added two additional features -- is2D and scale (both optional) and dropped the "m"-for-ChemDoodle business.

    "is2D":true

    from 2D sketcher; run an MMFF94 minimization (not necessarily recommended; sending the SMILES string to NIH or just back to Jmol via LOAD SMILES would be better.)

    "scale":{"x":1,"y":1,"z":1}

    data are scaled, as for example, from 2D or older ChemDoodle 3D, which required "scale":{"x":20,"y":-20,"z":20}.

    Note that the file must start with

    {"mol":{

    but "is2D" and "scale" can be anywhere.

    Should be quite general, not just for ChemDoodle.

     
  • Mike Casey

    Mike Casey - 2013-11-14

    Hi Bob,

    I put the new JSON reader through its paces last night, using the “load data” method to load a JSON string from ChemDoodle, after modification to put ‘{“mol”:’ at the start of the string and add ‘“is2D”:true}’ at the end. It worked well, apart from a couple of issues in handling chirality centres. First, implicit hydrogens at chirality centres (methine hydrogens generally?) are not added to the JSmol model. Second, the configuration at the chirality centres in JSmol does not always match the original 2D model in ChemDoodle. The ChemDoodle JSON format indicates bond stereochemistry using "s":"recessed" or "s":"protruding", and I guess I could modify the z coordinates of the relevant atoms accordingly, but that would probably mess up your algorithm?

    You can experiment with this at http://www.ucd.ie/chem/chemint/retrosynthesis.htm, by drawing structures in the lower of the two ChemDoodle windows and clicking on the “Test” button at the bottom left to load the molecule into JSmol.

    With thanks again,

    Mike

    From: Bob Hanson [mailto:hansonr@users.sf.net]
    Sent: 13 November 2013 16:03
    To: [jmol:feature-requests]
    Subject: [jmol:feature-requests] #210 Load molecule data in ChemDoodle format?

    see http://chemapps.stolaf.edu/jmol/zip/jmol-13.3.9_2013.11.13b.zip
    I added two additional features -- is2D and scale (both optional) and dropped the "m"-for-ChemDoodle business.

    "is2D":true

    from 2D sketcher; run an MMFF94 minimization (not necessarily recommended; sending the SMILES string to NIH or just back to Jmol via LOAD SMILES would be better.)

    "scale":{"x":1,"y":1,"z":1}

    data are scaled, as for example, from 2D or older ChemDoodle 3D, which required "scale":{"x":20,"y":-20,"z":20}.

    Note that the file must start with

    {"mol":{

    but "is2D" and "scale" can be anywhere.

    Should be quite general, not just for ChemDoodle.

     

Log in to post a comment.