In a recent post Batch processing with BeautifulJASON – JEOL JASON , we described how you can automate your NMR data processing using JASON and our python package BeautifulJASON. In this post, I’m going to take a step back and demonstrate some of the simple automation features available just by calling JASON directly from the command line.
Setting up your environment
In order to make using JASON from the command line nice and simple, you should add the location of the JASON executable to your path. On Windows, you can do this via the Control Panel, and edit the Path variable, whereas on macOS you can add JASON to the PATH environment variable or place a symbolic link in e.g. your /usr/local/bin
folder to the location of the JASON executable. On Windows, JASON.exe is typically found in C:\Program Files\JEOL\JASON\JASON.exe
, while on macOS the corresponding location is /Applications/JASON.app/Contents/MacOS/JASON
.
JASON command line options
You can launch JASON with the --help
flag to see a list of the options available on the command line. There are the typical options you would expect, help, version information etc, specifying the locations of files and other options. Some of the more useful options will be described below.
Loading data from the command line
You can load data into JASON just by calling JASON with the names of the files or folders after it. For example the command:
JASON.exe Proton.jdf
will launch JASON and load the proton spectrum contained in the Proton.jdf file. This way you can load any data which JASON understands, i.e. all high field and benchtop vendor formats.
Saving data and working headless
A common task is to read a data set, apply some processing and/or analysis and then save the output. The following command does this:
JASON.exe Proton.jdf --save Proton.jjh5 --save Proton.pdf
Saving two documents, one in JASON’s JJH5 file format, and the second in PDF format. You can specify multiple --save
options and JASON will determine the format from the extension you supply with the filename. If you want automatic processing and analysis to be performed as well, this can be done using JASON’s rules feature, see our previous posts on this topic Batch processing with BeautifulJASON – JEOL JASON, and https://www.jeoljason.com/2024/12/02/quality-control-with-beautifuljason-automatic-analysis-of-styrene-butadiene-rubber/.
Sometimes you want to process a large amount of data, and don’t want the JASON window to pop up and get in the way. In this case the --headless
option will tell JASON to work in the background and not bother you with any windows.
Sending data to a running JASON
One of the powerful features of using JASON via the command line is to be able to send data to an already running instance of JASON. For example, you might want new data to be sent to JASON as it is acquired or coming from another part of your workflow. The --appid
option allow you to do this. What is does it give a “name” to a running instance of JASON. If you issue another command using the same appid data will be opening that instance of JASON rather than starting a new one. Here is an example to see how it works. First, we start JASON using an appid and load some data:
JASON.exe --appid MyJASON Proton.jdf
Then, we can send more data to this instance of JASON by reusing the same appid:
JASON.exe –appid MyJASON COSY.pdf gHSQC.jdf
The COSY and HSQC spectra will then be opened in the same JASON window as the proton spectrum. It is straight forward to imagine this being used at the end of an automated acquisition or similar. The instance of JASON can also be closed from the command line using the --quit
option.
All of the options described in this post can be combined to give you simple, yet powerful automation tools. Hopefully this brief introduction to the JASON command line demonstrates some of the possibilities of automation in JASON. Keep an eye out for future posts showing the automation features in JASON!
Download JASON today and give it a go!