SpectraSorter: Ocean Insight spectrometer software application for high-throughput full-spectrum UV–VIS analysis and triggered sorting

“We present SpectraSorter, a C#-based software application for high-speed Ocean Insight spectrometers with an intuitive GUI. It performs rapid full-spectrum UV–VIS detection followed by real-time data processing, customizable visualization, precise triggering on any spectral features, and external communication via an Arduino microcontroller all in approximately one millisecond. We designed it for high-throughput analytical chemistry applications that require real-time analysis of optical spectra to inform subsequent sample sorting. Hence its name, the “SpectraSorter.” The software was used for the label-free enzymatic screening of bacterial microcolonies contained in microfluidic droplets, but is broadly applicable to other spectrometer screening applications.”

2. Target application: High-throughput UV–VIS activated droplet sorting

Our target use-case was the high-throughput screening of enzymatic activity in sub-nanoliter water-in-oil droplets in a microfluidic device. The vast majority of droplet sorters used today are fluorescence-activated and incorporate a label/biosensor into the droplet for screening readouts [9]. Recent work on absorbance-activated droplet sorters for the directed evolution of enzymes has underscored the potential for label-free screening [10]. To measure absorbance on-chip, two optical fibers are directly inserted into a microfluidic device to measure discrete droplets as the serially pass an optical detection region between these two fibers. These absorbance-based platforms relied on a single-wavelength LED light-source connected to the first fiber, a photomultiplier tube (PMT) light-sensor connected to the second fiber, and a relatively simple microcontroller & Arduino software to trigger droplet sorting when the desired signal was met. While powerful, this previous approach was only applicable to screening when only a single-wavelength measurement was required. To address this limitation, we recently developed a platform for full-spectrum UV–VIS Activated Droplet Sorting (UVADS) [11]. Our approach incorporated a broadband UV–VIS light-source, an Ocean Insight FX Streamer high-speed spectrometer, and, critically, we developed the open-source SpectraSorter software application detailed here.

SpectraSorter is a user-friendly software application that performs real-time spectra acquisition, data processing, visualization, triggering on any spectral features, and sends external communication via an Arduino microcontroller all in approximately one millisecond. It operates using a generic Ocean Insight driver, OmniDriver, and is compatible with Ocean Insight spectrometers. SpectraSorter is, to our knowledge, the first software application to enable on-demand sorting from using full-spectrum spectroscopy data with a commercially available spectrometer. In our previously published work [11], SpectraSorter was used for the label-free enzymatic screening of bacterial microcolonies contained in microfluidic droplets.

Beyond the demonstrated high-throughput enzymatic screening, we believe the SpectraSorter software application could be applied to many other high-throughput full-spectrum optical applications. Potential applications include single-cell UV–Vis [12] and Raman [13][14][15] measurements, particle synthesis [16], and many more.

  1. Download : Download high-res image (619KB)
  2. Download : Download full-size image

Fig. 1The SpectraSorter application window consists of five major modules: a device connection interface, acquisition buttons, a data plotting window, tabbed windows to control most settings, and statistics on spectra acquisition and saving. Menu entries and shortcuts at the bottom of the window enable easy access to key parameters. The data plotting window can be customized to display spectral or temporal data for the wavelengths defined in the Wavelength Hub. In the time-series image shown above, droplets containing food-coloring dye are temporally plotted as they pass the detector for the selected wavelengths 280 nm, 350 nm, 400 nm, and 600 nm (solid lines). Dotted lines indicate the user-defined threshold values for their corresponding wavelength (color-matched), over which a trigger event is actuated. The – & -axis can be modified during acquisitions to zoom in or out on features of interest.

3. Software framework

In this article we provide a summary of the software structure and major functions, but for a complete overview please consult the SpectraSorter user manual. The platform is available under the Apache 2.0 license on GitHub. An explanatory schematic of the hardware architecture is shown Fig. 2A, it demonstrates how the OceanFX spectrophotometer and Arduino Mega 2560 microcontroller interface with the operating computer running the SpectraSorter software application.

3.1. Software architecture & setup

The software solution consists of two main components. First, the SpectraSorter GUI interface to control all user operations (written in C#). It is available as both a stand-alone executable (a standard Windows installer will also install the required .NET 4.8 framework if it is not present) and as a source that can be directly built in Visual Studio. All functions excluding external triggering can performed with this module alone installed.

Second, the Arduino program “SpectraSorter_Trigger.ino”, is used for sending external triggers via a microcontroller. This Arduino program must be loaded onto an Arduino microcontroller using an Arduino IDE [17]. In our tests we used an Arduino Mega 2560 microcontroller, but other Arduino microcontrollers should be compatible. The microcontroller communicates with the SpectraSorter software to send external triggers when desired spectral events are observed.

During a standard run, SpectraSorter runs four parallel queues in four separate threads. The acquisition queue collects spectra from the Spectrometer up to the highest rate supported by the Spectrometer (4500 spectra per second for the Ocean FX). The plotting queue receives and plots the last spectrum at a very low rate (10 Hz), because GUI refreshes are very computationally expensive. The compute queue performs all operations requested on the raw spectrum needed to decide whether an event should trigger the Arduino microcontroller. In brief, the raw spectrum may be filtered, dark- and reference-corrected, transformed (for absorbance or transmission acquisitions) and then tested against all user-defined thresholds. The save queue writes to file the processed wavelengths (either a selection, a range, or the full spectrum) and a label that indicates whether the selected trigger wavelengths satisfied the triggering conditions. If this is the case, the program running on the Arduino board receives a TRIGGER command (from the compute queue), and will apply a voltage to the configured digital pin after a user-defined delay. Pin id, trigger delay and trigger duration can all be set in the Arduino parameters dialog, and are sent to the controller.

3.2. SpectraSorter GUI layout orientation

The SpectraSorter GUI, shown in Fig. 1., consists of a device connection interface, acquisition buttons, data plotting window, tabbed windows to control most settings, and statistics on spectra acquisition and saving. Drop down menus at the top and shortcuts at the bottom of the window enable easy access to key parameters. The “Wavelength Hub”, used to specify settings around individual wavelengths, is a popup accessed with the “” (lambda) menu or with the keyboard shortcut control + H.

3.3. Empirical characterization of performance

The empirical computational assessments throughout the publication were performed on a Windows 10 PC with an Intel Xeon W-2145 CPU (3.7 GHz, 8 Cores) and 64 GB of RAM. The system is fully compatible with lower-end computers, but its performance may be reduced.

The most influential acquisition parameters in the spectrometer performance are investigated in Fig. 2B and 2C. Integration time dictates how long the sensors collect light for each recorded spectra, this parameter must be optimized for every optical setup and sample. The number of spectra per seconds is simply measured on the host PC by counting the number of spectra received every seconds. Modern PCs running on the Windows operating system have a (high-resolution) clock accuracy of around 100 ns.

As expected, when the integration time is increased from 10 μs to 5000 μs, the acquisition speed reduces from 2130.3 ± 3.5 to 237.4 ± 0.1 spectra per second, respectively (Fig. 2B). The communication and processing time per spectra (i.e., excluding the integration time) is 0.469 ms for the 10 μs integration time but between 0.229 ms and 0.212 ms for longer integration times (all > 250 μs). The non-linear relationship between integration time and spectra per second is due to varying rate-limiting effect. At high integration times (>500 μs on our machine), the maximum rate of acquired spectra is limited by the integration time itself, whereas at low integration times the spectrophotometer communication and data processing times limit the acquisition speed

To achieve even faster acquisitions at small integration times, spectra can be requested in batches from the spectrometer by setting the “number of spectra per request” and “back-to-back per trigger” greater than 1. This is shown in Fig. 2C for spectra requests ranging from 1 to 15. Communication and processing times for a 10 μs integration reduces from 0.469 ms to 0.248 ms, and acquisition speeds increase from 2130.3 ± 3.5 to 4037 ± 2.88 spectra per second, respectively. While batch requests speed up acquisition, it also adds a variable delay between when spectra are processed by SpectraSorter depending on where that spectrum is located in the batch. This delay could theoretically present challenges when performing sample sorting at very high speed.

  1. Download : Download high-res image (319KB)
  2. Download : Download full-size image

Fig. 2Empirical assessment of acquisition parameters. (A) A schematic highlighting the relationship between the sorting device, the OceanFX spectrophotometer, the operating computer, and the Arduino microcontroller. The acquired spectra per second and the communication & processing times are plotted versus (B) the spectra requested per communication and (C) the spectrometer integration time. Instrument settings for both subplots unless specified: 10 μs integration time, 100 wavelengths saved, 1 spectrum per request, and absorbance output with static reference.

3.4. Highlighted software functions

SpectraSorter has too many features to describe in full, we highlight five major functions below. The rest are described in the user manual.

Absorbance Data Acquisition for High-Throughput Screening

SpectraSorter operates initially in raw spectrum mode, in which intensity values for the full spectrum are recorded, as shown in Fig. 3A when a broadband combined deuterium and halogen light source is used (DH-2000-BAL, Ocean Insight). To perform an absorbance optical density measurement, the reference signal needs to be established. While this is a simple task in low throughput measurements, identifying the reference signal can be quite challenging when samples are passing the detection region rapidly. To address this, we introduced the “Accumulated” and “Dynamic” reference spectrum acquisition functions. In the “Accumulated” mode shown in Fig. 3B, spectra can be accumulated for a given period of time (e.g., for 2 s), then the individual spectra from this period can be viewed and the desired reference spectrum can be manually selected using the SpectraSorter GUI. During the course of a long reference run the reference spectrum may change over time, it may thus be of interest to perform dynamic referencing. This feature calculates a reference spectrum as the median spectrum over a defined number of spectra and over a certain interval. Since the reference spectrum is calculated as the temporal median of the last user-defined number of spectra, this feature will only be of use if the desired reference spectrum is present in front of the sensor over 50% of the time. Note that this operation is performed by the compute queue, and may reduce performance if the interval is very short or the reference is calculated over a very large number of spectra. Fig. 3C demonstrates that the measured reference generation time from 0.082 ms for a 10 spectra dynamic reference, to 55.6 ms for a 1000 spectra dynamic reference. The use of both “Accumulated” and “Dynamic” referencing functions make the acquisition high-throughput sample absorbance data relatively straightforward using SpectraSorter.

Spectral Data Filtering of White Noise

  1. Download : Download high-res image (347KB)
  2. Download : Download full-size image

Fig. 3Reference generation GUI and considerations. (A) An example raw UV–VIS spectrum from 200 to 800 nm for HFE 7500 fluorinated oil (orange) and a droplet containing 100 μM bovine serum albumin, with a 2000 μs integration time. (B) The “Accumulated” reference spectrum acquisition enables the user to record spectra over a period of time, review it, and then manually select desired spectra for the reference. This is an important feature in highly dynamic measurement environments. (C) In dynamic referencing mode the median spectra are used as a reference from over a user defined “Number of spectra” occurring at a user-defined frequency, “Spectra between re-generation” (see inset image). The reference generation time was measured over different spectra ranges and is plotted in a loglog plot. Standard deviation error bars are displayed (n=3). The instrument settings used were 10 μs integration time, 100 wavelengths saved, 1 spectrum per request, and absorbance output with static reference.

High-speed acquisitions require the use of short sensor integration times and naturally result in significant white noise for optical sensors. To minimize stochastic noise data filtering is commonly used. In previous PMT-based optical system, data filtering is often performed temporally. Temporal filtering is not an ideal solution during high-throughput analysis, as a filter will dampen the temporal changes of each sample as they serially pass through the detection window. In the case of the full-spectrum UV–VIS detection, spectral data filtering can be used instead of temporal to minimize white noise. SpectraSorter has this feature fully integrated and can be accessed in the “Processing” tab. Users can choose an average filter or a Gaussian filter and set the filters desired size, and toggle the filter on/off mid-acquisition.

Wavelength Management

To give users the complete freedom of viewing, saving, and sorting at any wavelength across the full spectrum, we established a “Wavelength Hub”, shown in Fig. 4A. The Wavelength Hub is accessed under from the “” menu and in the “Processing” tab. Here, any number of specific wavelengths can be defined with a series of settings. These include the wavelengths inclusion in “Time series” plotting, to “Save” if individual wavelengths instead of full-spectrum are being saved, to “Trigger” an external signal if the “Threshold” is met, whether triggering occurs “Above threshold” or below the set threshold, and the color at which it will be plotted in the data window during time-series plotting. The best practice is to prepare the Wavelength Hub prior to an acquisition, but the threshold and triggering settings can be modified during acquisitions to precisely trigger samples of interest.

Saving is a significant computational burden and can dramatically slow acquisition speeds. This was empirically characterized in Fig. 4B. When saving 100 or less wavelengths per spectra, acquisitions could be performed at over 4000 spectra per second. When saving more than 100 wavelengths, acquisition speeds drop off dramatically, down to 316 ± 17.5 spectra per second for the full spectrum (2135 wavelengths). Saved file size was found to be 5.8 bytes per spectra per saved wavelength, as shown in Fig. 4C. To operate at full speed while saving, we recommend saving 100 wavelengths or less.

External Triggering via an Arduino Microcontroller

  1. Download : Download high-res image (528KB)
  2. Download : Download full-size image

Fig. 4Wavelength and Saving Management. (A) The “Wavelength Hub” allows the user to select which wavelengths should be plotted, saved, and used for triggering external communication. (B) The spectra per second and time per spectra is plotted versus the number of wavelengths saved. From 0 to 100 wavelengths no performance loss is observed, but a significant drop-off is observed when saving >100 wavelengths. (C) File size as a function of saved spectra and number of wavelengths was assessed. Empirically, 5.8 bytes is used per spectra per saved wavelength. Instrument settings: 10 μs integration time, 15 spectra per request, and absorbance output with static reference.

Triggering refers to sending an external 5V trigger via the Arduino microcontroller. In our use-case, this 5V trigger is sent to a function generator to initiate droplet sorting. Setting the trigger wavelengths, thresholds, and whether thresholds act as an AND operator (when “All thresholds must be satisfied to trigger” is checked) or an OR operator (unchecked), is all controlled in the Wavelength Hub (Fig. 4A). The characteristics of the external trigger signal are set in the “Arduino” tab. In its “Parameters” subtab, the user can define the Arduino’s digital pin that will send the 5 V trigger, the desired trigger delay, and the duration of the trigger. In the “Performance” subtab, users can benchmark the communication speed between SpectraSorter and the microcontroller. This will depend on your particular computer and may vary from (100 μs to 700 μs).

Configuration File Management System

There are a large number of unique software settings and wavelength customizations required for each particular measurement in SpectraSorter. To ensure the precise system settings are not lost after optimization, a configuration file storing all settings is generated alongside every acquisition and can also be exported to a saved configuration file at will. Configuration files can be directly loaded into SpectraSorter using the “File” menu or saved as the default setting next time SpectraSorter is opened.

4. Illustrative example

The supplemental illustrative video highlights how to use the major functions of the SpectraSorter software package. In this example, uniform droplets containing food coloring are injected in a microfluidic device and detected with an Ocean FX spectrometer. The key time points are described below.

0:00 Download the latest version of SpectraSorter from GitHub.

0:18 Connect to the Spectrophotometer and Arduino devices.

0:27 Acquire a raw spectrum acquisition (keyboard shortcut control + r to start, control + x to abort).

0:33 Auto-scale the plot -axis of the plot window (control + y).

0:53 Acquire a dark spectrum. To do this, manually turn off your light source prior to acquiring.

1:10 Acquire a reference blank spectrum using the “Accumulated” reference feature.

1:50 Setup your Wavelength Hub (open it with control + h).

2:33 Plot a live time series of select wavelengths (toggle to this with control + 2).

2:49 Change the number of time points plotted when viewing a time-series plot.

3:04 Set triggering thresholds for specific wavelengths.

3:40 Toggle triggering mode between all thresholds met and any threshold met to initiate triggering.

4:03 Toggle above/below threshold triggering for a specific wavelength.

5. Conclusions

SpectraSorter is a powerful new software application for Ocean Insight spectrometers. It combines high-speed spectra acquisition, real-time data processing, customizable data visualization, the precise control of external triggering using any multi-spectral feature, configuration management, and more, all in an installable user-friendly application (for Windows). To date, it has been used for high-throughput UV–VIS activated droplet sorting for label-free enzymatic screening applications [11]. We are confident that the SpectraSorter’s flexible settings, its compatibility with Ocean Insight spectrometer portfolio, and its ease of use for both nonprogrammers and programmers-alike, will lead to its broad adoption and facilitate a number of new spectrometer applications.

Leave a Comment