LaserTRAM-DB : A Time Resolved Analysis Module for the complete reduction of Laser Ablation Inductively Coupled Plasma Mass Spectrometry data

LaserTRAM-DB is a dashboard for the complete processing pipeline of Laser Ablation Inductively Coupled Plasma Mass Spectrometry (LA-ICP-MS) data in complex materials such as geologic samples. As LA-ICP- MS data in geologic samples frequently have multiple phases, inclusions, and other compositional complexities within them that do not represent the material of interest, user interaction is required to filter unwanted signals out of the overall ablation signal. LaserTRAM-DB allows the user to filter which portion of the ablation peak is utilized in calculating concentrations, subsequently allowing for more accurate data to be obtained. Furthermore, it allows for the processing of both individual spot analysis data and a line of spots gathered in rapid succession, reducing the time required for data reduction while preserving spatial definition and still ensuring data quality.


Summary
LaserTRAM-DB is a dashboard for the complete processing pipeline of Laser Ablation Inductively Coupled Plasma Mass Spectrometry (LA-ICP-MS) data in complex materials such as geologic samples.As LA-ICP-MS data in geologic samples frequently have multiple phases, inclusions, and other compositional complexities within them that do not represent the material of interest, user interaction is required to filter unwanted signals out of the overall ablation signal.LaserTRAM-DB allows the user to filter which portion of the ablation peak is utilized in calculating concentrations, subsequently allowing for more accurate data to be obtained.Furthermore, it allows for the processing of both individual spot analysis data and a line of spots gathered in rapid succession, reducing the time required for data reduction while preserving spatial definition and still ensuring data quality.

Background
With a wide array of applications in the natural sciences (e.g., Fritz-Endres and Fehrenbacher, 2021;Caricchi et al., 2020;Loewen and Kent, 2012;Lukács et al., 2021), laser ablation inductively coupled plasma mass spectrometry (LA-ICP-MS) is a now a commonplace tool for the gathering of in situ trace element (i.e., < 0.1 wt%) data from solid materials.The last two decades have seen significant advances in both instrument capabilities and operating software, allowing users to generate large volumes of in situ geochemical data in comparatively little time to previous methodologies (i.e., micro-drilling) while still maintaining high degrees of accuracy and precision.
Raw data output from LA-ICP-MS, however, is in the form of counts per second (cps) for the selected analyte isotopes, not elemental concentrations (e.g. Figure 1).In order to be converted into accurate concentrations, a modest amount of user input and interpretation is required and should not be automated.Currently, there are several proprietary and open-source softwares for LA-ICP-MS data reduction to accomplish this task: SILLS - Guillong et al. (2008); Iolite - Paton et al. (2011); LAtools - Branson et al. (2019); Termite - Mischel et al. (2017); GLITTER -Macquarie University GEMOC; and countless other "in house" spreadsheet-based tools.All have their strengths and weaknesses, however, there is yet to be a powerful, web-hosted Graphical User Interface (GUI).Built primarily using Plotly-Dash [Plotly Technologies Inc.], numpy (Harris et al., 2020), andpandas (McKinney et al., 2010), we present a completely open-source dashboard: Laser Time Resolved Analysis Module Dashboard (LaserTRAM-DB) that allows the user to calculate concentrations from raw LA-ICP-MS data with the flexibility of a GUI interface while maintaining the performance of the numerical python ecosystem.Furthermore, by simultaneously displaying both raw data cps and internal standard normalized cps, it allows for rapid decision making about data quality to be determined.Below we outline the theory, workflow, and structure, behind LaserTRAM-DB in an effort to maximize its effectiveness in the petrology and volcanology communities.

Governing Equations
We calculate the concentration of analyte (i) in an unknown material (u) using the following relationship from Longerich et al. (1996): Where C i u and R i u are the concentration of analyte and count rate of analyte (i) in the unknown material, respectively, and S is the normalized sensitivity.When using naturally occuring internal standards, S can be defined as: R i std and C i std are the count rate and and concentration of analyte (i) in the calibration standard, R n u and R n std are the mean count rates of the internal standard in the unknown material and calibration standard, C n u and C n std are the concentrations of the internal standard in the unknown material and calibration standard.Kent and Ungerer (2006) re-arrange this relationship such that the count rate expressions always contain unknown analytes in the numerator: Data are output from a quadrupole mass spectrometer as counts per second (cps).Elevated values in the center refer to the signal pertaining to the ablated material (e.g., volcanic glass, mineral inclusion, etc.) while lower values on either side refer to background levels of each isotope within the mass spectrometer.Each plot in the panel displays a range of noise where some degree of control over the ablation signal is required for calculating concentrations ranging from significant (A,B) to minimal (C,D).The cause of the noise in A is likely due to different ablation rates in pumice (e.g., the ablation area encountering vesicles) and the noise in B is largely due to the ablation of a mineral inclusion (in this case apatite) part way through the analysis, Normalizing to an internal standard The purpose of LaserTRAM-DB is to give the user complete control over which portion of the analytical spectra gets used in calculating concentrations (e.g., filtering out portions of the signal not reflective of the material under investigation).In complex natural materials, selection of this interval and an overall judgement about data quality require an operator to make a decision.This software is optimized to allow that decision to be made as efficient as possible.
When a given interval from the analytical spectra has been chosen, every analyte is normalized to a chosen internal standard.LaserTRAM-DB allows for any analyte in the experiment to be used as the internal standard (see caveats on this in the walkthrough below).Prior to normalization to an internal standard, raw data first has the background analyte levels subtracted from it.Background is determined by taking the median counts per second value for each analyte over the user specified background range.Once data have been background subtracted, each normalized ratio is calculated the following way: Where cps i is the background subtracted counts per second data for analyte (i), and cps is is the background subtracted counts per second data for the internal standard.Since counts per second is analogous to count rate above in Equation 3, we can simplify the above relationship to now reflect our N i values: Here, N i std and N i u are the normalized counts per second value of analyte i in the calibration standard and unknown, respectively.The uncertainty for any given normalized ratio is expressed as: σ N is the standard deviation of a given analyte's normalized ratio for the interval and n is the number of time steps in the interval (i.e., cycles through the mass range).The relative standard error is then:

Detection Limits
Detection limits for each analyte are determined to Longerich et al. (1996): where σ b and n b are the standard deviation and total number of observations in the chosen background range, respectively.This is standard practice in LA-ICP-MS data reduction.To reflect this in data output, measurements that are below detection limit will have values that say "b.d.l." rather than concentrations.

Drift Correction
To check for drift in calibration standard normalized ratios over time, a linear regression is applied to the calibration standard for each analyte, where the dependent variable is the count rate normalized to the internal standard and the independent variable is the timestamp associated with each analysis (Figure 2): We determine the significance of each regression by evaluating following null hypothesis: there is no relationship between a given analyte's internal standard normalized ratio and time.We reject this if both the following conditions are true: The p-value for the coefficient (i.e., slope) is significant; The F-statisic comparing the regression and observed data is greater than the critical F value.By default, we set the threshold for p-value significance at .01 (i.e., we have 99% confidence that we can reject the null hypothesis) in an effort to mitigate drift correcting all but the most linear of changes in normalized count rates, but this may be changed by the user.If the null hypothesis for a given analyte is rejected, the analyte is linearly corrected for drift and the regression parameters (e.g., slope and intercept) are used to calculate a normalized count rate for the calibration standard at the point in time where an unknown was analyzed: Where m is the regression slope, x is the analysis time, and b is the intercept for analyte i.

Uncertainties
Calculating concentrations of a given analyte in an unknown material can be considered a series of nested quotients and products.Therefore, we quantify the overall uncertainty of a given analyte as Taylor (1997): Where RSE i std is defined as: σ i and µ i are the standard deviation and mean of all of the calibration standard normalized ratios respectively and n i is the total number of calibration standard analyses for analyte (i).
For analytes where drift correction has been applied, RSE i std is replaced with: Where RM SE i is the Root Mean Squared Error as specified in the Drift Correction section.

Concentrations of internal standard in unknown
To calculate concentrations of a given analyte list in an unknown sample, the concentration of the internal standard must be known.LaserCalc takes these concentrations in the form of wt% oxide and utilizes user interaction to input concentrations of the internal standard and its relative uncertainty.A default value of 1% is used for this, but may be updated by the user.When the program is running, copy and paste the provided link provided in the terminal window into the browser window and the app will run.From now on any time you wish to use the program, simply re-activate the virtual environment and run the script like above.

Installation and Use
Alternatively, LaserTRAM-DB has been packaged as a .exefile and may be run by downloading and unpacking the zip file found here.Once unpacked, find the lasertram deploy.exefile and run it.A terminal window will pop up and the application will automatically deploy to your default web browser.The .exe file must remain in the lasertram deploy folder but you may create a shortcut to it and place that anywhere on your computer (e.g., your Desktop).

Walkthrough
Here we will walk through each step of the data processing pipeline in LaserTRAM-DB.In brief, it is comprised of 2 parts: 1. Normalizing data to an internal standard • LaserTRAM: Choosing an interval of interest from raw cps data in individual spot analyses and normalizing it to an internal standard.
• LaserTRAM profiler: Functionally the same as LaserTRAM, however has tools that allow for the rapid inspection of a line of spot analyses gathered in quick succession.
2. Calculating concentrations from data that has been normalized to an internal standard • LaserCalc: Takes the output from either LaserTRAM or LaserTRAM profiler and converts the normalized data into concentrations using the equations outlined above.

LaserTRAM: New Project Tab
LaserTRAM is comprised of two tabs: 1. New Project tab (Figure 3).This is the default window upon running the software, however none of the figures or tables will be populated yet.
To begin a new project, simply click on the "Upload Data" button in the upper left portion of the window.A File Explorer/Finder window will prompt the user to choose their file that has been formatted for LaserTRAM (e.g., Table 1).Once the data are loaded in, options will appear in the "Int.Std." dropdown menu.Any analyte in the experiment may be chosen as the internal standard, however in order to calculate concentrations in LaserCalc later only analytes that create the following oxides may be chosen: SiO 2 (e.g., 29 Si), CaO (e.g., 43 Ca), TiO 2 (e.g., 47 Ti), Al 2 O 3 , Cr 2 O 3 , MnO, FeO, K 2 O, Na 2 O, NiO.To maximize data quality, it is recommended that the internal standard is an analyte that is already well quantified in the unknown (i.e., in silicate minerals 29 Si and 43 Ca are good options as SiO 2 and CaO are commonly measured accurately via EPMA and are at concentrations in most geologic materials ideal for measurement by LA-ICP-MS).While it is easy to explore many different internal standards and their effect on data quality, only one should be used for recorded intervals that will be used in calculating concentrations later.1: Example of input data format for LaserTRAM-DB.Shown is an example row in an input spreadsheet with its units listed above.In this instance, each row represents one cycle through the mass range for a ICP-MS.
To populate the graphs and begin processing data, choose a spot from the "Spot" dropdown menu.The first time this is done it may take a few seconds, as the entire project is being loaded in, however it will be relatively instantaneous from there on out.The layout from upper left to lower right: • Raw data graph: This is the raw signal for each spot being processed.It contains regions indicating the time interval designated for background (red) and signal to be used for concentrations (green).
• Normalized data graph: This graph shows the green region in the raw data graph normalized to the chosen internal standard.
• Analyte uncertainties graph: Bar chart showing the relative standard error (i.e., Equation 10).Values on the top of each bar indicate the median normalized ratio using SI prefixes.If the relative standard error is < 5% the bar will be green, otherwise it will be yellow.
• Saved spot data table: Recorded data for each spot will populate here.Each time the "Record" button is pressed, a new row will be generated.More on this in a bit.
To choose intervals for background and ablation signal, simply drag the handles on the slider bar where it says "Chose background and interval of interest with the sliders".The left two handles are for background and the right two are for ablation signal of interest.All the graphs are linked to the slider, meaning that when the sliders move they will all update in real time to reflect the decisions made by the user.When the sliders are in the desired spot, the "Record" button will save the requisite data to the "Saved Spot Data" table in the lower right.Each row contains the following: • Timestamp: This is a unique time identifier for each spot that is inherited from the raw data.This will be propagated throughout the pipeline to help keep track of sample and monitor for drift in the primary standard over time (i.e.Equation 9).
• Spot: This is the name given to each spot in the raw data (i.e., the "SampleLabel" column in Table 1).
• Interval data: These are columns that contain the time information in each analysis for the start and end of both the background and interval of interest.They are bkgd start, bkgd stop, int start, int stop.
• Internal standard analyte: The analyte chosen as the internal standard.The "norm cps" column contains the median counts per second value of the internal standard over the interval of interest.
• Normalized data: Columns for each analyte's internal standard normalized value.Their header is simply the analyte name.Values that are -9999 denote analytes below detection limit for that spot as dictated by Equation 8.
• Uncertainty data: Columns to the right of the normalized data with the suffix " se" contain the relative standard error for each analyte in percent (i.e., Equation 7).
Progressing through all spots in the experiment can be accomplished two ways: 1. Using the spot dropdown and picking the spot you wish to process (not recommended).
2. Using the "Previous" and "Next" buttons (recommended).These will navigate between adjacent spots to efficiently progress through the spot list.When finished, the "Export" button associated with the "Saved Spot Data" table will export the table exactly how it is shown in the browser.It is recommended that in your browser you adjust the file download settings such that they ask for a save location prior to download.This will allow you more control over where the LaserTRAM completed data is stored.

LaserTRAM: Re-processing Tab
This tab takes the input and output from the "New Project" tab and re-normalizes the experiment to a newly chosen internal standard.Similar to above, use the upload data in the "New Project" tab to upload raw experiment data.This is the only step that is done in that tab, so now navigate to the "Re-processing" tab.Use the "Upload old LT file" button in the upper left to upload the output for the same experiment you wish to re-normalize.It does not matter if all of the spots in the experiment were processed, LaserTRAM will only re-normalize spots that have been previously processed.At this point, the "Old normalized Ratios" table on the left will populate with the previously normalized data, as well as a list of potential analytes in the dropdown above to choose for re-normalizing.After the desired analyte is chosen, hit "Re-process!".This will take the interval columns from the old data and use them as bounds for the re-normalization.This should be relatively instantaneous and leave you with something that looks like Figure 4. Similar to the "New Project" tab and everywhere else in LaserTRAM-DB, the table with re-normalized data can be exported using the button attached to the table.It will have the same exact output as the "New Project" tab.If you wish to re-normalize to a few different internal standards, this is easily accomplished by choosing a new analyte in the dropdown menu and hitting "Re-process!".

LaserTRAM profiler
LaserTRAM profiler is functionally the same as the "New Project" tab in LaserTRAM.It takes in raw data through upload button, has a dropdown for the internal standard, a button for recording the data for a given spot, and all of the quadrants have the same display.The major differences are as follows (Figure 5): • The addition for a "step size" numeric input box.
• Rather than "Next" and "Previous" buttons to move between spot analyses, we have "Forwards" and "Backwards" buttons.These will step the green interval of interest by the value in the "step size" input box.This can be used in conjunction with the range sliders directly below the buttons to efficiently jump from one peak to the next in the line of spots.
• Unlike the individual spot reduction, the "Saved Spot Data" table in LaserTRAM profiler will have rows that pertain to each spot in the line of spots.They will be named accordingly following the naming scheme: "transectname spotnumber".
It is recommended that after each line of spots is processed it is exported and saved as its own spreadsheet.They can then be later combined in order for LaserCalc.

LaserCalc: Concentrations Tab
This tab takes the output of either the spot or profile versions of LaserTRAM and a spreadsheet of published concentrations for standard reference materials that can be found here under the file laicpms stds tidy.xlsx.
Begin by uploading the output from LaserTRAM using the "Upload Data" button.This will populate the "Internal Std.Concentrations" table with a column for the spot name, concentration for the internal standard in wt% oxide, and a column for the relative uncertainty for the internal standard concentration.This concentration is analogous to C n u in Equation 3. By default it is 10 wt% regardless of the internal standard chosen, however it can be updated later to reflect more accurate concentrations.
LaserCalc will also search the spot names and determine potential calibration standards based on spot name.In order for this to work spot names in your experiment for standard reference materials must match those found within the laicpms stds tidy spreadsheet at least somewhere in the spot name (e.g., BHVO-2G 1, BCR-2G 23, ATHO-G replicate).There may be extra characters but at a minimum they must contain the proper standard name.Based on the results of this search, the "Calibration Standard" dropdown will populate with options for potential calibrations standards.Data pertaining to these analyses correspond to the N std i term in Equation 5. Once a calibration standard is chosen, hit "Calculate!".LaserCalc will apply Equation 5or Equation 8 to the data on an analyte by analyte basis based on whether or not it needs to be drift corrected.This is relatively quick and upon completion the "Calculated Concentrations" tab will populate with calculated concentrations for all spots in the experiment (Figure 6).These, by default will be incorrect for all unknown analyses as they are using the default concentration for the internal standard.You may now adjust the values in the "Internal Std.Concentrations" table to reflect the actual concentration and uncertainty of the calibration standard for each spot.While doing this, you will notice that the "Calculated Concentrations" table will update in real time to reflect the choice made.You may also change the value for the calibration standard dropdown menu at this time and the concentrations will adjust to reflect that decision.This makes it relatively easy to calculate concentrations using a variety of calibration standards if they exist in enough abundance within your experiment.When complete, export the "Calculated Concentrations" table to the desired directory.It is recommended the calibration standard is somewhere in the file name so as to help keep track of decisions made in the data processing pipeline.

LaserCalc: Primary Standard Tab
This tab is solely devoted to inspecting data pertaining to the chosen calibration standard throughout the course of the experiment as calibration standard data quality greatly influences the calculated concentrations quality.It is designed to help one maximize the quality in their data by having insight into the temporal evolution of the normalized values of each analyte.Both the graph and the table will populate after data are uploaded and a calibration standard is chosen from the dropdown menu in the LaserCalc "Concentrations" tab.It is comprised of two parts (Figure 7): a graph showing the normalized ratio for a given analyte over time on the top and a table with information pertaining to each calibration standard analysis on the bottom.To view different analytes in the graph, use the dropdown at the very top of the screen.
Annotated on the graph are the relative standard error of the mean for a given analyte (i.e., Equation 10), the relative RMSE of the regression for that analyte over time, other descriptive statistics used in checking for drift (i.e., the p-value for the slope of the regression, the F-statistic, and crtitical F-value), and whether or not it has been drift corrected.If a given analyte has been drift corrected, the linear relationship describing the drift correction will be displayed on the chart.Lines for the regression and mean of the values are also displayed.Remember, drift correction only happens when both the p-value and F statistic are significant.To adjust the significance threshold of the p-value you may adjust the value in the input area of the "Concentrations" tab that says "Drift significance threshold".If this change in value changes whether or not an analyte is drift corrected, the "Calculated Concentrations" table will update in real time to reflect those changes.For example, if the p-value for a certain analyte is at 0.03, by default it will not be drift corrected by the software as the default threshold is 0.01.Based on the data in the "Primary Standard" tab, you may wish to force this drift correction to happen based on outlier measurements.Adjusting the threshold value to 0.04 will accomplish this.We advise adjusting this value with caution and keeping track of this decision along with the other metadata in the data reduction pipeline (e.g., internal standard, calibration standard, etc.).
The table below the graph essentially extracts the information from the input into the "Concentrations" tab for all the chosen calibration standards.It then also adds on a bottom row that shows the mean values for all analytes.Similar to all tables, this can also be exported and saved as an Excel spreadsheet to help keep track of decisions made in the data processing pipeline.The data in this table will allow you re-create the observed regression and its various statistics should you desire to do so (i.e., making publication quality figures).

Figure 1 :
Figure1: Example of a typical LA-ICP-MS spot analyses from tephra data in which many isotopes are analyzed at once.Data are output from a quadrupole mass spectrometer as counts per second (cps).Elevated values in the center refer to the signal pertaining to the ablated material (e.g., volcanic glass, mineral inclusion, etc.) while lower values on either side refer to background levels of each isotope within the mass spectrometer.Each plot in the panel displays a range of noise where some degree of control over the ablation signal is required for calculating concentrations ranging from significant (A,B) to minimal (C,D).The cause of the noise in A is likely due to different ablation rates in pumice (e.g., the ablation area encountering vesicles) and the noise in B is largely due to the ablation of a mineral inclusion (in this case apatite) part way through the analysis,

Figure 2 :
Figure2: Drift correction test from LaserCalc for a given experiment in which standard reference material BCR-2G was used as the primary standard.We can see here that one experiment may contain analytes that are both drift corrected and not drift corrected.

Figure 3 :
Figure 3: Example of the LaserTRAM New Project tab after data has been loaded in.

Figure 4 :
Figure 4: Example of the LaserTRAM reprocessing tab after data has been loaded in.

Figure 5 :
Figure 5: Example of the LaserTRAM profiler illustrating how the software can easily normalize a line of spots gathered in rapid succession to one another.

Figure 6 :
Figure 6: Example of the LaserCalc Concentrations tab where concentrations can be calculated using the output from LaserTRAM and published values for standard reference materials.

Figure 7 :
Figure 7: Example of the LaserCalc Primary Standard tab that shows data for the chosen calibration standard both graphically and in a table.