Saturday, 9 November 2024

An R software for recalculations and plotting of mineral analyses (GCDkit.Mineral) has been unleashed!

In September issue of American Mineralogist appeared our paper describing GCDkit.Mineral, a freeware for recalculation, plotting, and statistical treatment of mineral data obtained by microbeam techniques, typically an electron microprobe (EPMA). Much of the following text comes from its abstract. 

The GCDkit.Mineral is fully platform-independent, and thus running on all the main operation systems (Windows/Mac/Linux). It shares much of its core with the standard GCDkit, including the same look and feel of its graphical user interface.  Hence the program imports compositional data in various commonly used file formats (Plain ASCII text (*data), CSV, MS Excel XLS(X), MS Access (MDB), or DBF files) or retrieves them from the clipboard. 

After loading, the dataset is split using the information given in the column 'Mineral'. The input EPMA data (in wt. %) are recalculated to atoms per formula unit (apfu) based on a required number of O equivalents, atoms, or charges, with or without FeII/FeIII estimation by various methods (Droop's method assuming a certain sum of cations in the entire formula or just a single crystallographic site, specific methods for amphiboles and pyroxenes). 

Analyses may then be recast to structural formulae, i.e., the atoms are distributed into appropriate sites. For minerals forming solid solutions, the molar percentages of end-members are computed, as can be some extra parameters. 

All the data may be treated statistically, either by built-in functions for descriptive and multivariate statistics (e.g., PCA and LDA) or using the wealth of tools provided by the wide R community.

Using the standard GCDkit philosophy, raw and recalculated mineral data may be plotted on binary and ternary plots, profiles, and boxplots. Most are defined as internal templates that provide a means to make later changes to the plot (zooming and scaling, adding comments or legend, identifying data points, altering the size or colour of the plotting symbols, etc.). The publication-ready graphics may be saved into several vector-(PostScript, PDF, and WMF) and bitmap-based (e.g., PNG, TIF, and JPG) formats, ready to be imported into a professional graphical, presentation, or desktop publishing software.

The graphical templates are used as a basis for classification. The general classification routine looks for the name of the polygon within the diagram (= graphical template), into which the analysis falls according to its x-y coordinates. The outcome may be either the name of a mineral or a link to another diagram in the case of more complex classification schemes. Following the rules of the International Mineralogical Association (IMA), in some cases, the classification is not done graphically but using prescribed algorithms. 

The GCDkit.Mineral is fully menu-driven and contains embedded default recalculation options for many common rock-forming minerals. More experienced users may easily tweak these parameters, as they are saved in a logically structured plain text file. Seasoned R programmers may invoke GCDkit.Mineral in command line mode, use batch scripts or Python-driven notebooks (e.g., of project Jupyter), or modify and develop new recalculations or plugins.

The current version, however, cannot deal with elements with multiple valencies (apart from FeII/FeIII) and separate H2O determinations are not taken into account. The choice of IMA classification schemes remains restricted (only Fsp, Amp, Cpx, Opx). Future version shall import trace-element determinations, obtained e.g. by LA-ICP-MS or ion probe, and will contain means for their interpretation (e.g. spiderplots).

Interested? You can download the current version from http://mineral.gcdkit.org.

Reference
Janoušek, V., Farrow, C. M., & Erban, V. GCDkit.Mineral – a customizable, platform-independent R-language environment for recalculation, plotting and classification of electron-probe micro-analyses of common rock-forming minerals. American Mineralogist 109 (9): 1598–1607.  https://doi.org/10.2138/am-2023-9032

No comments:

Post a Comment