1D and 2D NMR spectra of coffee from 27 countries

715 green coffee samples were gathered by Almacafé S.A. (Bogotá, Colombia) between 2012 and 2014 from 27 different countries and analyzed at the Nuclear Magnetic Resonance (NMR) laboratory at Universidad del Valle (Cali, Colombia). Over 1000 methanolic coffee extracts were prepared and a total of 4563 spectra were acquired in a fully automatic manner using a 400 MHz NMR spectrometer (Bruker Biospin, Germany). The dataset spans the variance that could be expected for an industrial application of origin monitoring, including samples from different harvest time, collected over several years and processed by at least two distinct operators. The resulting 1D and 2D spectra can be used to develop and evaluate feature extraction methods, multivariate algorithms and automation monitoring techniques, as a dataset for teaching, or as a reference for new studies on similar samples and approach.


Context
In 2005, the Colombian Coffee Federation (FNC, in Spanish) applied for a Protected Geographical Indication (PGI) as an additional move in the branding strategy initiated decades ago with the registration of well-known brands like "Juan Valdez" and "100% Colombian coffee". The PGI was granted in 2007 and the strategy was met with success as the popularity of Colombian coffees has grown globally. While most coffee were sold as blends, the monitoring of the origin of beans was not a concern. However, during the last two decades, there has been a growing interest for specialty coffees with businesses converting the origin into a major sales argument; thus, creating a need for screening methods to allow for origins of coffee beans to be traced.
In 2010, The Logistic & Quality Control Office of FNC, Almacafé S.A., started screening for analytical platforms for that purpose. At that time, Near InfraRed Spectroscopy (NIRS) was the best known approach, followed by conventional hyphenated techniques, such as Gas or liquid Chromatography coupled to Mass Spectrometry (GC-MS or HPLC-MS) and by Isotope Ratio Mass Spectrometry (IRMS) (See Table 1 in [1]). Little was known about NMR. Two studies reported promising results, one by Consonni et al. [2] using 1 H-NMR and another by Wei [3] and coworkers using 13 C-NMR, but with small data sets (40 and 60, respectively).
For the following years, Almacafé gathered 715 samples from 27 countries (312), and from most areas producing coffee in Colombia (403) as best represented in Figure 1. At the same time, our laboratory tested and evaluated different protocols for sample preparation and data acquisition. The aim of this collaboration was to evaluate Nuclear Magnetic Resonance (NMR) as Draft manuscript prepared by the author. an analytical platform for large scale monitoring of coffee samples' origin and the major outcomes can be found here. [4]. Later, other techniques were benchmarked in an attempt to find cheaper alternatives to NMR that would produce comparable results, with mIR-ATR (mid-InfraRed Attenuated Total Reflectance spectroscopy) being showing promising, with the ability to be portable in the near future. [1,5] During the acquisition of most of the data, low-field NMR was deemed suitable for a long term study; however; it is a promising technique [6] that should be considered for future research.

The dataset
The dataset presented here was acquired between 2012 and 2014 at the NMR laboratory of the Universidad del Valle (Cali, Colombia). The samples were collected from 27 countries, different species and varieties (See Figure 1, Table 1 and Table 2) by Almacafé S.A (Bogotá, Colombia), during the same period. The total dataset consists of 4563 original folders (with Bruker 1 original hierarchy), two files (tsv format) with descriptions of samples and spectra, and two datasets (tsv format) of 48 and 90 spectra as examples.
Several batches of samples were prepared to answer different research questions with different experimental conditions (See Table 3). Within a batch, all the samples were prepared and the spectra recorded following the same protocol. Four types of NMR experiments were performed as described in Section Data acquisition and shown in Table 4. Since the parameter set enforces all other experimental parameters, if suffices to ensure that spectra are compared of same parameter set. 2 The resulting spectra for each samples, including replicates, were stored in a folder (See Figure 2 and below).

Folder names and structure
The folder names abide by the convention: i. a 6-characters code, 2 capital letters followed by 4 digits that represents the unique identification of each sample. The samples received (715) were named as ACXXXX for Almacafé, while the samples prepared in Cali (mixtures as described in Section Adulteration) were named as UVXXXX after Universidad del Valle.
ii. a section that contains different information on the sample depending on the batch.
iii. a 7-digits unique identifier that was used by our LIMS [7] (Laboratory Information Management System) to distinguish the several spectra belonging to the same extract, either different types of experiments or repetitions. iv. a 10-character key that was used to import data into the database.
The four sections are separated by "_". The second section may contain more than one field, also separated by "_". In order to unequivocally identify the data only the first and the penultimate sections are relevant.
Bruker files are read by several packages [8,9,10] and software. Reading and displaying processed Bruker spectra is readily achieved by reading 2 files. The typical folder structure is shown in Figure 2.
Each folder contains a sub-folder for each different experiment performed 3 . Each sub-folder contains files and one folder. acqus contains information about the experimental conditions for acquisition and fid (or ser for 2D) contains the actual Free Induction Decay (FID), i.e., the raw data. The data after processing, Fourier transform, 1 Bruker Biospin is a major manufacturer of NMR spectrometers 2 The abbreviation meoh in filenames always refers to coffee samples extracted in methanol.
3 By Bruker convention, these folder and sub-folders are referred to as "expname" and "expno" phase-correction and baseline correction, are stored in the pdata/1/ sub-folder.

Extracting spectra
Five parameters in file pdata/1/procs/ are needed to read the processed spectrum stored in file pdata/1/1r for 1D data (pdata/1/2rr for 2D) and display it. Figure 3 shows two typical spectra, from Arabica coffee in black and Robusta coffee in green.
i. BYTORDP: endianness, 0 for little and 1 for big ii. FTSIZE: the length of the data buffer   The x axis in ppm ranges between OFFSET and OFFSET -SW p /SF with increments of (SW p /SF)/(FTSIZE -1).
In addition, useful information about the NMR experimental conditions can be extracted from the acqus file contained in each folder.
• ##$EXP= <X> is the name of the parameter set that ICON NMR, the Bruker Automation Software, called (See Table 4).
• ##$PULPROG= <X> contains the name of the pulse sequence that was applied to record the spectra (See Table 4).
• ##$RG= X describes the value of the receiver gain.
• ##$SOLVENT= <X> is the name solvent parameter set used to lock the frequency and thus gives information about the solvent used for extraction.

Samples description file (metadata)
The file curatedCodes.tsv contains all the available information (715 rows and 53 columns) about the samples that were received from Almacafé. Only the comments column has been removed to meet privacy concerns. The most important fields, country, department, city, species, variety and dateReception were homogenised and curated, the others were left with original values.  . Two typical spectra of Arabica (black) and Robusta (green) coffee extracts in non-deuterated methanol. Signals assigned to Kahweol can be used for discrimination. In addition, caffeine content is expected to be higher in Robusta species, as observed in the insert.

Test dataset
Small datasets, colombiaOthers48.tsv and robustaArabica89.tsv, are provided as examples or to quickly evaluate the usefulness of the data. The first 3 columns contains the path, the ID and the group. The remaining columns contain the spectra trimmed from 0.01 to 10 ppm and after removal of the methanol region between 3.15 and 3.6 ppm. The column headers are the ppm values.

Methods
Several protocols and data analysis pipelines were evaluated and several research questions were raised as our curiosity was piqued by preliminary results. Some of them were explored as reflected by the inhomogeneous granularity of the metadata (curatedCodes.tsv) and the large number of reported batches (See Table 3).

Sample recollection
Coffee samples (Coffea arabica, NCBI:txid13443 and Coffea canephora var. Robusta, NCBI:txid308126) were recollected by the Laboratory for Quality Control at Almacafé according to availability. This laboratory is in charge of monitoring the quality of the coffee beans during all the processes that take place prior to exportation. As sole contractor of the FNC, Almacafé must monitor all the coffee harvested and exported by the FNC and therefore has access to coffee samples from all regions of Colombia. Furthermore, as major producer and worldwide exporter, the FNC and Almacafé have access to international partners and it was thus able to gather samples from other producing countries.

Sample preparation for NMR
Obtaining the fastest, most robust, and cheapest protocol to prepare the samples was challenging. This included performing solidliquid extraction at ambient temperature (to avoid controlling an additional parameter) and in non-deuterated solvent (to lower the cost per experiment). Best results were obtained using centrifugation to remove solid particles [4] after extraction. Filtration, considered initially, was discarded due to poor reproducibility (See Table 3, Reproducibility-*).
Different solvents were compared for extraction, water, chloroform and methanol. Namely best information (number of signals) was obtained from methanol extracts, and thus methanol was chosen as sole solvent for the rest of the project. However, chloroform produced interesting spectra, extracting apolar compounds, such as fatty acids, that were later found important for origin determination.
Both green and roasted beans were considered. Ideally, green coffee samples (Table 3: Origin_meoh_green) would have been preferred, since it avoids the process of roasting. However, this latter process was already well implemented and extensively used by Almacafé, while the grinding of green beans required ball grinders not widely available at the time. This obstacle could have been overcome, but green coffee extracts were showing rapid oxidation while waiting for acquisition. And more importantly, samples to be analyzed from the market will most likely already be roasted. Therefore, the samples were roasted according to the standard procedure applied for cupping and ground to a very fine powder (Table 3: Origin_meoh_Roasted).
In addition to regular solution-state 1 H-NMR were evaluated, other techniques, such as Solid-state MAS (Magic Angle Spinning), HR-MAS (High-Resolution Magic Angle Spinning). The latter two techniques present the advantage that no solid-liquid extraction is needed, reducing contamination, saving time and money. Since these spectra were recorded on different machines kindly made available by Bruker Biospin, which are not listed here.

Data acquisition
NMR allows us to observe nuclear spins, in particular those of protons. Therefore chemists are used to dissolve the substance of interest in deuterated solvents, i.e., solvents where all protons have been replaced by deuterons that are invisible to NMR. The result is that only the molecules of interest will contribute to the signal and thus to the spectra. Since the solvent is always much more concentrated than the substrate, its signal will obfuscate the signal of interest, in the same way as the sun makes stars invisible during the day. Deuterated solvents are much more expensive and thus less suitable for large scale screening, in particular in developing economies. Therefore, the extracts were prepared using regular methanol (chromatographic grade), while the spectra were acquired using a solvent signal suppression scheme [13,14,15]. To achieve a robust and completely automatic (without human supervision) suppression of the solvent signal, a row of 3 experiments was performed for each sample, (COFFEE_meoh_pilot1) to estimate the resonance frequency of the solvent, (COFFEE_meoh_pilot2) to determine this frequency with more accuracy by applying a light suppression and (COFFEE_meoh_noesyp64.lims) to acquire the spectra by suppressing the solvent at that frequency [12]. For some samples, an additional 2D experiment was performed COFFEE_meoh_jres4.lims 4 . J-Resolved experiments provide a wealth of information about scalar couplings constants [11] and have been less exploited due to their size and because peak-picking and peak-fitting are more complex to perform in 2D.
An important technical note: during the data acquisition, the spectrometer experienced a technical issue that modified the carrier frequency for the subsequent experiments. As such, the data was re-acquired for some of the samples for the sake of publication, and it also provided a unique opportunity to assess how carrier frequency can effect the field stability of the final models. The information about the carrier frequency can be found for each individual spectra, in its parameter file acqus under the name SFO1. Before the incident the frequency was of 400.13188235 MHz, and it stabilized to 400.02188249412 MHz, after the ice was removed and the pressure in the Dewar returned to normal. For simplicity, this information has been included in the file curatedExtractedNames.tsv in the column baseFrequency.
Complete details about the sample preparation and data acquisition can be found elsewhere [4] and within the original files, in particular in the acqus files available for each experiment.

Origin determination
The determination of coffee origin is the major focus of Almacafé and, represents the core of this study, thus; the largest share of the data, with more than 2000 acquired spectra (Table 3: Origin_meoh_green, Origin_meoh_Roasted and ORIGIN_MeOH). A large effort was dedicated to covering a vast geographical area. Special care was taken to include samples from neighboring areas that are expected to share most similarities. When available, information about the post-harvest processing, such as washing and drying was recorded, as it is expected to strongly affect the final product. In addition, the numerous samples available from Colombia allows one to look into origin by department or by region with similar agro-climatological characteristics. For a quick look into this batch, a test dataset colombiaOthers48.tsv was prepared by randomly picking 24 samples from Colombia and 24 from alternate countries.

Adulteration
A second interest of the Laboratory for Quality Control of Almacafé is the possible adulteration of Colombian coffee with lower quality Robusta (Coffea canephora var. Robusta) beans imported to Colombia for internal consumption. Even before origin, the coffee species have been extensively used for marketing. A large body of literature has been dedicated to detect such kind of adulteration [16] and it was deemed to be a natural starting point for comparison with our results. Therefore, 252 samples (Table  3: Mix_arabica_meoh_Roasted, Mix_meoh_Roasted, Quantification-roasted-MeOH and Quantification-roasted-MeOH-2) were prepared by adulterating Arabica coffee with concentrations of Robusta ranging from 5% to 90%. Colombia only produces coffee Arabica. Since the species is expected to have a larger effect size than the origin, a first classification may be performed to exclude all non-Arabica samples (including adulterated ones) prior to modeling the origin [4]. Cafestol is a biomarker for discriminating Robusta

Funding
This research was funded by Almacafé S.A., Bogotá, Colombia.