TechnologyΒΆ
The ACNMR app is written in Python using the Flask framework. For chemical data processing it uses the CML parser and molecule analysis from Indigo the similarity and substructure search from Rdkit.
The core is the data model as described in The NMR Document Object JSON Format. This data model represents an entry in the database. It contains one molecular structure, one literature reference, and NMR data sets from this literature source. Entries with the same molecule are grouped in the detailed view of the entry but stored as independent entries. For grouping identical molecules, the system uses InChI Keys where applicable and arbitrary Molecule IDs if the structure can not represented as InChI.
As one literature reference may contain multiple compounds the literature references can also be duplicates across entries. Literature references are uniquely identified by a hash because we prefer global unique IDs over serial IDs in this system.
The data format is JSON which is a very versatile format especially for use in web applications. These files are stored in Couchdb which is an append only NoSQL database with powerful replication features. This is the authoritative data base. It manages the history of documents and replication or synchronization with other instances of the ACNMR application. Its job is, to have a consistent collection of a large number of ACNMR documents safely on the disk at all time. That it is designed to do. It is however, not suited to do complex dynamic queries, this is the job of SQL Databases.
For this purpose when you start the ACNMR WSGI server, it creates a process that connects to the CouchDB and listens for changes. This process will fetch the changes and write the data into the SQL Database distributed over a couple of tables suitable to perform the searches on the data. While doing that also the substructure and similarity finger-prints will be calculated and stored in suitable tables.
This SQL database currently is Sqlite. The changes monitor process fetches the changes since the last version, computes the changes and saves them to the SQL data base.