In recent posts, we’ve discussed the need for automation, how we tackle the problem in Mestrelab, and have considered several examples of such. But no automation exists in a vacuum. Inputs and outputs to the process (or rather the ease with which these connections can be achieved) can make or break the overall automation. There is no point having a wonderful automation processing 10,000 samples if all the results then need to be transcribed manually into a corporate database!
So how can Mgears page make these integrations, turning your much-loved timesavers into fully fledged enterprise solutions?
Out of the box
Some integrations can work out of the box. For example, connections to certain ELNs or the Mnova Database are built-in to Mgears, and all you need do is simply select a few options to enable that connectivity. Perhaps slightly less high-tech, but nevertheless a viable option, is that many bricks write a CSV file which can be easily imported into another system, allowing a batch update.
Perhaps your environment has some kind of sample manager, and you want Mgears to process samples, perhaps for different workflows, and return results to that system? This can be straightforward to implement. The built in ‘orders’ functionality allows Mgears to listen for small files containing instructions on what to process and with which workflow. Like a good short-order chef, Mgears picks up the order, does its analysis, and then writes out reports and a machine-readable result file that can be swept up by the master system.
But what if the integration you want isn’t supported right now? What can you do?
Scripting to the rescue
Mgears has several script hooks in the engine, so it is possible to create a small script to do a specific task in the process. The Mnova scripting toolkit has utility objects that make connecting to a relational database or a web service a cinch; these scripts will be run automatically for each sample, making the integration seamless.
One example of this is retrieving structures. Perhaps you’ve seen an automation in Mgears that verifies NMR data against a structure, matching the structure to the NMR data by filename. All very clever, but what if you don’t even have the structure files, let alone have them with the correct name? In many organizations, a corporate database is often available, allowing lookup of structures from an ID, often via a web service. Perhaps your structure ID is present somewhere in your NMR file? And if so, wouldn’t it be great if we could just look up the structure directly in Mgears?
Well, this is very straightforward to achieve. Thanks to Mnova’s built-in objects that talk to web services, handle structures, and query an underlying NMR document, we can retrieve an ID from a spectrum parameter, query the web service with it, retrieve a chemical structure, and insert it into the document. Et voilà! Job done with a small script that a suitably skilled user could write, without need for professional services. If that “suitably skilled” user isn’t available, Mestrelab’s professional services will be happy to help.
A second example relates to writing a result to a relational database. Imagine you are using the System Suitability Test brick to evaluate the performance of your LCMS instruments. Mgears makes a nice result report, and a CSV file of the results, but wouldn’t it be nice to have a dashboard that shows those results on a web page? Perhaps you have Spotfire or Power BI and want to make some simple views for your users to access from anywhere? If only Mgears could directly populate the database that fuels such views!
Well, it can. A simple script again makes use of built-in Mnova objects, this time to connect to a database and execute an insert query. Mgears processes a sample, the database is updated, and the dashboard instantly refreshed. All with a few lines of script that run automatically every time Mgears runs this workflow.
Process automation is often part of a much bigger workflow. We get the greatest value if we can embed the process in the workflow so that data flows seamlessly to and from it. We hope this article shows how Mestrelab’s Mgears automation can make this a reality for you.
This article is the last of our four-parts series on analytical data workflows automation and integration. We hope that you have enjoyed this series and found helpful ideas and answers. We’ll be back soon with more content!
Check our previous posts: