[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reply to: [list | sender only]
Re: Draft JSON specification, round 2
- Subject: Re: Draft JSON specification, round 2
- From: Robert Hanson <hansonr@xxxxxxxxxx>
- Date: Fri, 21 Apr 2017 11:11:31 -0500
- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stolaf.edu; s=stolaf;h=mime-version:in-reply-to:references:from:date:message-id:subject:to;bh=QV8eOaOuMq640fQVdgYYP+A6D6XM4BkmYTTJkws4XbM=;b=XHSHJoULVClxNQEViX4HLNytCHlCBgzNV4gL1OAaK7MKFrXKYexqFDuZQJkJ3SR4ZxHJEyrk3J7nKLDxpVLEt8PoDM6OX9Ma33J5KNIjnuauRjVoNI+gIkyxzvgtqgDnQdKMPJe64l8wblZTpFjRuvj51Rvqcc+mfcZ1b+5YC1o=
- In-Reply-To: <5082d652-448d-2495-6cc7-6e46f91e729a@gmail.com>
- References: <CAM+dB2d4HcnH7PZRC4jYO8KLyNxs4pws_baT7WKi6vRiD2z1ow@mail.gmail.com><MWHPR04MB0512B6E3745834DB2C6C74BCE01B0@MWHPR04MB0512.namprd04.prod.outlook.com><CAM+dB2cGUWSsnR782iRn4aJ3NU7GqNZV3bGQ5yJ8dVxBD2Xvtw@mail.gmail.com><5082d652-448d-2495-6cc7-6e46f91e729a@gmail.com>
On Fri, Apr 21, 2017 at 8:43 AM, Andrius Merkys <andrius.merkys@gmail.com> wrote:
But more importantly, the Jmol/JSmol user can tap into this "local database" of structural information to, say, query the symmetry operators, or check the modulation vector, or look at the unit cell information. This, effectively, is what people call structural annotations. And I suggest this is another use of CIF-JSON not mentioned above. The JSON-based data provide easy access to annotations to a structure that are in an array-based format that is familiar to JavaScript and Java programmers. In Jmol it's not quite JSON, but it is just as good (better?), and its use is Java/JavaScript transparent.
--
We have devised our COD-JSON format for three reasons: (i) to pass
parsed CIF data to scripts in programming languages that do not have CIF
parsers, (ii) to avoid multiple CIF parsing in pipelines (JSON parsing
is somewhat faster than CIF) and (iii) to experiment with CIF data in
document-oriented databases. Applications (i) and (ii) benefit from the
syntactic approach, especially if they output CIF (we would like to have
it as similar to the original as possible). For application (iii)
semantic approach should be sufficient.
This makes total sense to me. Clearly any program that utilizes CIF data to extract structural information has to be able to decipher the data source, be it CIF, PDB, MMTF, or JSON, and transform the data into its own internal form of data structures. Fundamentally, these formats are no different from each other. They all encode string and numeric data in the form of bits. Well, MMTF is binary, but the others are character-based formats. Numbers aren't really "numbers" - even they are just strings of characters.
OK, that said, what Jmol does is to stream the CIF data into temporary internal Java/JavaScript data formats that can be used efficiently for further processing. It doesn't care about block order (mostly; can't be 100% sure of that in complex CIF subsystem files); it just streams the data in. In addition, though, it can read the entire CIF data structure into an internal "Jmol math" data structure (which is basically a superset of JSON, allowing additional data types such as Point3F, Point4F, and BitSet). This internal structure, though not used by Jmol itself, can be read out using script commands into JSON string format for quick display or for saving to a file or for transmitting to another program or platform.
So one of my interests would be to add a CIF-JSON generator to Jmol so that Jmol could be used to create this data format if desired.
But more importantly, the Jmol/JSmol user can tap into this "local database" of structural information to, say, query the symmetry operators, or check the modulation vector, or look at the unit cell information. This, effectively, is what people call structural annotations. And I suggest this is another use of CIF-JSON not mentioned above. The JSON-based data provide easy access to annotations to a structure that are in an array-based format that is familiar to JavaScript and Java programmers. In Jmol it's not quite JSON, but it is just as good (better?), and its use is Java/JavaScript transparent.
Since Jmol has both CIF1 and CIF2 parsers, Jmol has no need of a JSON equivalent for file reading. A web page using JSmol would never, for example, need to request that COD deliver a CIF-JSON file. However, I or someone with more of an interest in this, could certainly write a CIF-JSON file reader adapter for Jmol. I probably would not do it myself, because "CIF" in Jmol is a lot more than "CIF" for many programs. We have standard small-molecule CIF, macromolecular CIF, incommensurately and commensurately modulated CIF, magnetic CIF, modulated magnetic CIF, and CIF2. These subclasses, of course, are all built on top of a basic CIF parser, but they have a lot of nuances, and those would all have to be processed differently from a CIF-JSON format.
Jmol, by the way, already has a JSON format reader, but it is a simple, rather idiosyncratic format developed specifically for ChemDoodle. As far as I know, it's never used.
So, there are two use cases involving Jmol:
-- outputting CIF data as some official JSON format (relatively trivial)
-- easy access to crystallographic structural annotationsBob
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
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
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
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
_______________________________________________ cif-developers mailing list cif-developers@iucr.org http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers
Reply to: [list | sender only]
- References:
- Draft JSON specification, round 2 (James Hester)
- RE: Draft JSON specification, round 2 (Bollinger, John C)
- Re: Draft JSON specification, round 2 (James Hester)
- Re: Draft JSON specification, round 2 (Andrius Merkys)
- Prev by Date: Re: Draft JSON specification, round 2
- Next by Date: Re: Treatment of Greek characters in CIF2
- Prev by thread: Re: Draft JSON specification, round 2
- Next by thread: Re: Draft JSON specification, round 2
- Index(es):