GCDkit.Mineral: A customizable, platform-independent R-language environment for recalculation, plotting, and classification of electron probe microanalyses of common rock-forming minerals
Abstract
GCDkit.Mineral is a platform-independent (Windows/Mac/Linux) freeware for recalculation, plotting, and statistical treatment of mineral data obtained by microbeam techniques, typically an electron microprobe. It is written in R, a language providing a feature-rich environment for statistics and data visualization.
This new program imports compositional data in various commonly used file formats or retrieves them from the clipboard. Routines are available for data management, i.e., grouping, searching, and generation of subsets, using regular expressions and Boolean logic. Raw compositional data (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. Analyses may then be recast to structural formulae, i.e., the atoms are distributed into appropriate crystallographic sites. For minerals forming solid solutions, the molar percentages of end-members are computed. All the data may be treated statistically, either by built-in functions for descriptive and multivariate statistics or using the wealth of tools provided by the wide R community.
Raw and recalculated mineral data may be plotted on assorted binary and ternary plots 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 color 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.
Importantly, 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 class mechanism in R provides an elegant solution to the computational problems presented by the differing requirements of each mineral group. By assigning each mineral species to a particular class, all algorithms may be implemented as mutually independent but mineral group-specific methods. The default recalculation options for each mineral class are stored externally in a small and simple text file.
The program is designed to cater to three potential user groups. For users with no familiarity with R, the program 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 users 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 lucid, open, and modular design thus makes GCDkit.Mineral a versatile workbench for everyday use, as well as a promising platform for community-driven development. The GCDkit family of R tools, including GCDkit. Mineral, is distributed through the WWW. The current version may be downloaded from http://mineral.gcdkit.org.
Acknowledgments and funding
This study was funded by the GA ČR (Czech Science Foundation) project 2234175S. We are indebted to the Journal reviewers Lindsey E. Hunt and Michael Jercinovic for their helpful and encouraging reviews, as well as associate editor Callum Hetherington for professional editorial work. Furthermore we thank many colleagues that contributed to the recalculation database and tested the software functionality over the years, especially S. Vrána (deceased), E. Žáčková, L. De Hoÿm de Marien, and P Gadas (Czech Geological Survey, Prague/Brno), L. Tajčmanová (Heidelberg University), R. Čopjaková (Masaryk University, Brno), A. Renno (Helmholtz-Zentrum Dresden-Rossendorf), C. Bertoldi (ex-University of Salzburg), and J. Haloda (Oxford Instruments, High Wycombe, U.K.).
References cited
Anderson, J.L., Barth, A.P., Wooden, J.L., and Mazdab, F. (2008) Thermometers and thermobarometers in granitic systems. In K.D. Putirka and F.J. Tepley III, Eds., Minerals, Inclusions and Volcanic Processes, Reviews in Mineralogy and Geochemistry, 69, 121–142, https://doi.Org/10.2138/rmg.2008.69.4.Search in Google Scholar
Arai, H. (2010) A function for the R programming language to recast garnet analyses into end-members: Revision and porting of Muhling and Griffin’s method. Computers & Geosciences, 36, 406–409, https://doi.Org/10.1016/j.cageo.2009.05.007.Search in Google Scholar
Bernhardt, H.J. (2010) MINCALC-V5, a non EXCEL based computer program for general electron-microprobe mineral analyses data processing. Acta Mineralogy and Petrology Abstract Series, 6, 869.Search in Google Scholar
Bonin, B., Janoušek, V., and Moyen, J.F. (2020) Chemical variation, modal composition and classification of granitoids. In V. Janoušek, B. Bonin, W.J. Collins, F. Farina, and P. Bowden, Eds., Post-Archean Granitic Rocks: Contrasting Petrogenetic Processes and Tectonic Environments, 9–51. Geological Society of London Special Publications 491, https://doi.Org/10.1144/SP491-2019-138..Search in Google Scholar
Brandelik, A. (2009) CALCMIN—an EXCELTM Visual Basic application for calculating mineral structural formulae from electron microprobe analyses. Computers & Geosciences, 35, 1540–1551, https://doi.Org/10.1016/j.cageo.2008.09.011.Search in Google Scholar
Chambers, J.M. (1998) Programming with Data: A Guide to the S Language, 484 p. Springer.Search in Google Scholar
Dachs, E. (1998) PET: Petrological Elementary Tools for Mathematica. Computers & Geosciences, 24, 219–235, https://doi.Org/10.1016/S0098-3004(97)00141-6.Search in Google Scholar
Dachs, E. (2004) PET: Petrological Elementary Tools for Mathematica®: An update. Computers & Geosciences, 30, 173–182, https://doi.Org/10.1016/j.cageo.2003.09.007.Search in Google Scholar
De Angelis, S.M.H. and Neill, O.K. (2012) MINERAL: A program for the propagation of analytical uncertainty through mineral formula recalculations. Computers & Geosciences, 48, 134–142, https://doi.Org/10.1016/j.cageo.2012.05.023.Search in Google Scholar
De la Roche, H., Leterrier, J., Grandclaude, P., and Marchal, M. (1980) A classification of volcanic and plutonic rocks using R1R2-diagram and major element analyses—Its relationships with current nomenclature. Chemical Geology, 29, 183–210, https://doi.Org/10.1016/0009-2541(80)90020-0.Search in Google Scholar
Debon, F. and Le Fort, P. (1988) A cationic classification of common plutonic rocks and their magmatic associations: Principles, method, applications. Bulletin de Minéralogie (Paris), 111, 493–510, https://doi.Org/10.3406/bulmi.1988.8096.Search in Google Scholar
Deer, W.A., Howie, R.A., and Zussman, J. (2013) An Introduction to the Rock-Forming Minerals, 3rd ed. Mineralogical Society.Search in Google Scholar
Droop, G.T.R. (1987) A general equation for estimating Fe3+ concentrations in ferromagnesian silicates and oxides from microprobe analyses, using stoichiometric criteria. Mineralogical Magazine, 51, 431–435, https://doi.Org/10.1180/minmag.1987.051.361.10.Search in Google Scholar
Esawi, E.K. (2004) AMPH-CLASS: An Excel spreadsheet for the classification and nomenclature of amphiboles based on the 1997 recommendations of the International Mineralogical Association. Computers & Geosciences, 30, 753–760, https://doi.Org/10.1016/j.cageo.2004.05.007.Search in Google Scholar
Grew, E.S., Locock, A.J., Mills, S.J., Galuskina, I.O., Galuskin, E.V., and Halenius, U. (2013) Nomenclature of the garnet supergroup. American Mineralogist, 98, 785–811, https://doi.Org/10.2138/am.2013.4201.Search in Google Scholar
Grunsky, E.C. (2002) R: A data analysis and statistical programming environment—an emerging tool for the geosciences. Computers & Geosciences, 28, 1219–1222, https://doi.Org/10.1016/S0098-3004(02)00034-1.Search in Google Scholar
Holland, T.J.B. and Powell, R. (1998) An internally consistent thermodynamic data set for phases of petrological interest. Journal of Metamorphic Geology, 16, 309–343, https://doi.Org/10.1111/j.1525-1314.1998.00140.x.Search in Google Scholar
Hornik, K. (2021) R FAQ (Online). Available: https://CRAN.R-project.org/doc/FAQ/R-FAQ.html (accessed February 10, 2023).Search in Google Scholar
International Mineralogical Association. (2020) IMA Reports (03/01/2020 revision) (Online). Available: http://www.minsocam.org/MSA/IMA (accessed February 10, 2023). Mineralogical Society of America.Search in Google Scholar
Janoušek, V. and Moyen, J.F. (2014) Mass balance modelling of magmatic processes in GCDkit. In S. Kumar and R.N. Singh, Eds., Modelling of Magmatic and Allied Processes, p. 225–238. Society of Earth Scientists Series 83, Springer, https://doi.Org/10.1007/978-3-319-06471-0_11.Search in Google Scholar
Janoušek, V., Erban, V., and Farrow, C.M. (2006a) Using the R language for graphical presentation and interpretation of compositional data in mineralogy: Introducing the package GCDkit-Mineral. useR! 2006 Book of Abstracts, p. 84. Austrian Association for Statistical Computing (AASC) and Wirtschaftsuniversität Wien.Search in Google Scholar
Janoušek, V., Farrow, C.M., and Erban, V. (2006b) Interpretation of whole-rock geochemical data in igneous geochemistry: Introducing Geochemical Data Toolkit (GCDkit). Journal of Petrology, 47, 1255–1259, https://doi.Org/10.1093/petrology/egl013.Search in Google Scholar
Janoušek, V., Moyen, J.F., Martin, H., Erban, V., and Farrow, C. (2016) Geochemical Modelling of Igneous Processes—Principles and Recipes in R Language. Bringing the Power of R to a Geochemical Community, 346 p. Springer.Search in Google Scholar
Kretz, R. (1983) Symbols for rock-forming minerals. American Mineralogist, 68, 277–279.Search in Google Scholar
Lanari, P., Vidal, O., De Andrade, V., Dubacq, B., Lewin, E., Grosch, E.G., and Schwartz, S. (2014) XMapTools: A MATLAB©-based program for electron microprobe X-ray image processing and geothermobarometry. Computers & Geosciences, 62, 227–240, https://doi.Org/10.1016Zj.cageo.2013.08.010.Search in Google Scholar
Lanari, P., Vho, A., Bovay, T., Airaghi, L., and Centrella, S. (2019) Quantitative compositional mapping of mineral phases by electron probe micro-analyser. In S. Ferrero, P. Lanari, P. Goncalves, and E.G. Grosch, Eds., Metamorphic Geology: Microscale to Mountain Belts, 39–63. Geological Society of London Special Publications 478, https://doi.Org/10.1144/SP478.4.Search in Google Scholar
Lecoutre, E. (2003) The R2HTML package. R News, 3, 33–36.Search in Google Scholar
Locock, A.J. (2008) An Excel spreadsheet to recast analyses of garnet into end-member components, and a synopsis of the crystal chemistry of natural silicate garnets. Computers & Geosciences, 34, 1769–1780, https://doi.Org/10.1016/j.cageo.2007.12.013.Search in Google Scholar
Locock, A.J. (2014) An Excel spreadsheet to classify chemical analyses of amphiboles following the IMA 2012 recommendations. Computers & Geosciences, 62, 1–11, https://doi.Org/10.1016/j.cageo.2013.09.011.Search in Google Scholar
Mader, D. and Schenk, B. (2017) Using Free/Libre and Open Source software in the geological sciences. Mitteilungen der Österreichischen Geologischen Gesellschaft, 110, 142–161, https://doi.Org/10.17738/ajes.2017.0010.Search in Google Scholar
Putirka, K.D. (2008) Thermometers and barometers for volcanic systems. In K.D. Putirka and F.J. Tepley III, Eds., Minerals, Inclusions and Volcanic Processes, Reviews in Mineralogy and Geochemistry, 69, 61–120, https://doi.org/10.1515/9781501508486-004.Search in Google Scholar
Putirka, K.D. (2018) Geothermometry and geobarometry. In W.M. White, Ed., Encyclopedia of Geochemistry. Encyclopedia of Earth Sciences Series, 597–614, Springer, https://doi.Org/10.1007/978-3-319-39193-9_322-1.Search in Google Scholar
R Core Team. (2021) R: A Language and Environment for Statistical Computing (Online). Available: http://www.r-project.org (accessed February 10, 2023). R Foundation.Search in Google Scholar
Reimann, C., Filzmoser, P., Garrett, R., and Dutter, R. (2008) Statistical Data Analysis Explained: Applied Environmental Statistics with R, 362 p. Wiley.Search in Google Scholar
Richard, L.R. (1995) MinPet: Mineralogical and Petrological Data Processing System, Version 2.02. MinPet Geological Software.Search in Google Scholar
Ridolfi, F., Zanetti, A., Renzulli, A., Perugini, D., Holtz, F., and Oberti, R. (2018) AMFORM, a new mass-based model for the calculation of the unit formula of amphiboles from electron microprobe analyses. American Mineralogist, 103, 1112–1125, https://doi.Org/10.2138/am-2018-6385.Search in Google Scholar
Ripley, B. (2021) ODBC Connectivity. Manual to the RODBC package (Online). Available: https://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf (accessed on March 30, 2023).Search in Google Scholar
Shen, H. (2014) Interactive notebooks: Sharing the code. Nature, 515, 151–152, https://doi.Org/10.1038/515151a.Search in Google Scholar
Spear, F.S. (1994) Metamorphic Phase Equilibria and Pressure–Temperature–Time Paths, 799 p. Mineralogical Society of America.Search in Google Scholar
Sturm, R. (2002) PX-NOM—An interactive spreadsheet program for the computation of pyroxene analyses derived from the electron microprobe. Computers & Geosciences, 28, 473–483, https://doi.Org/10.1016/S0098-3004(01)00083-8.Search in Google Scholar
Tindle, A.G. and Webb, P.C. (1994) PROBE-AMPH—A spreadsheet program to classify microprobe-derived amphibole analyses. Computers & Geosciences, 20, 1201–1228, https://doi.Org/10.1016/0098-3004(94)90071-X.Search in Google Scholar
Walters, J.B. (2022) MinPlot: A mineral formula recalculation and plotting program for electron probe microanalysis. Mineralogia, 53, 51–66, https://doi.Org/10.2478/mipo-2022-0005.Search in Google Scholar
Warr, L.N. (2021) IMA–CNMNC approved mineral symbols. Mineralogical Magazine, 85, 291–320, https://doi.Org/10.1180/mgm.2021.43.Search in Google Scholar
Whitney, D.L. and Evans, B.W. (2010) Abbreviations for names of rock-forming minerals. American Mineralogist, 95, 185–187, https://doi.Org/10.2138/am.2010.3371.Search in Google Scholar
Yavuz, F. (2001) PYROX: A computer program for the IMA pyroxene classification and calculation scheme. Computers & Geosciences, 27, 97–107, https://doi.Org/10.1016/S0098-3004(00)00059-5.Search in Google Scholar
Yavuz, F. (2003a) Evaluating micas in petrologic and metallogenic aspect: I—Definitions and structure of the computer program MICA+. Computers & Geosciences, 29, 1203–1213, https://doi.Org/10.1016/S0098-3004(03)00142-0.Search in Google Scholar
Yavuz, F. (2003b) Evaluating micas in petrologic and metallogenic aspect: Part II—Applications using the computer program Mica+. Computers & Geosciences, 29, 1215–1228, https://doi.Org/10.1016/S0098-3004(03)00143-2.Search in Google Scholar
Yavuz, F. (2007) WinAmphcal: A Windows program for the IMA-04 amphibole classification. Geochemistry, Geophysics, Geosystems, 8, 2006GC001391, https://doi.Org/10.1029/2006GC001391.Search in Google Scholar
Yavuz, F. (2013) WinPyrox: A Windows program for pyroxene calculation classification and thermobarometry. American Mineralogist, 98, 1338–1359, https://doi.Org/10.2138/am.2013.4292.Search in Google Scholar
Yavuz, F. and Döner, Z. (2017) WinAmptb: A Windows program for calcic amphibole thermobarometry. Periodico di Mineralogia, 86, 135–167, https://doi.Org/10.2451/2017PM710.Search in Google Scholar
Yavuz, F. and Yavuz, E.V. (2022) A Windows program for feldspar group thermometers and hygrometers. Periodico di Mineralogia, 91, 63–84, https://doi.Org/10.13133/2239-1002/17666.Search in Google Scholar
Yavuz, F. and Yavuz, V. (2023) WinSpingc, a Windows program for spinel super-group minerals. Journal of Geosciences, 68, 95–110, https://doi.Org/10.3190/jgeosci.369.Search in Google Scholar
Yavuz, F. and Yildirim, D.K. (2018a) A Windows program for calculation and classification of epidote-supergroup minerals. Periodico di Mineralogia, 87, 269–285, https://doi.Org/10.2451/2018PM808.Search in Google Scholar
Yavuz, F. and Yildirim, D.K. (2018b) A Windows program for pyroxene–liquid thermobarometry. Periodico di Mineralogia, 87, 149–172, https://doi.Org/10.2451/2018PM787.Search in Google Scholar
Yavuz, F. and Yildirim, D.K. (2020) WinGrt, a Windows program for garnet supergroup minerals. Journal of Geosciences, 65, 71–95, https://doi.Org/10.3190/jgeosci.303.Search in Google Scholar
Yavuz, F., Yavuz, V., and Sasmaz, A. (2006) WinClastour—a Visual Basic program for tourmaline formula calculation and classification. Computers & Geosciences, 32, 1156–1168, https://doi.Org/10.1016/j.cageo.2005.10.021.Search in Google Scholar
Yavuz, F., Karakaya, N., Yildirim, D.K., Karakaya, M.Ç., and Kumral, M. (2014) A Windows program for calculation and classification of tourmaline-supergroup (IMA-2011). Computers & Geosciences, 63, 70–87, https://doi.Org/10.1016/j.cageo.2013.10.012.Search in Google Scholar
Yavuz, F., Kumral, M., Karakaya, N., Karakaya, M., and Yildirim, D.K. (2015) A Windows program for chlorite calculation and classification. Computers & Geosciences, 81, 101–113, https://doi.Org/10.1016/j.cageo.2015.04.011.Search in Google Scholar
© 2024 by Mineralogical Society of America
Articles in the same Issue
- Germanium distribution in Mississippi Valley-Type systems from sulfide deposition to oxidative weathering: A perspective from Fule Pb-Zn(-Ge) deposit, South China
- Characterization and potential toxicity of asbestiform erionite from Gawler Downs, New Zealand
- First widespread occurrence of rare phosphate chladniite in a meteorite, winonaite Graves Nunataks (GRA) 12510: Implications for phosphide–phosphate redox buffered genesis in meteorites
- K isotopic fractionation in K-feldspar: Effects of mineral chemistry
- Jarosite formation in Permian-Triassic strata at Xiakou (South China): Implications for jarosite precipitation from H2S upwelling on Mars
- The effect of A-site cations on charge-carrier mobility in Fe-rich amphiboles
- Calorimetry and structural analysis of uranyl sulfates with rare topologies
- Biological control of ultra-skeleton mineralization in coral
- Systematic study of high field strength elements during liquid immiscibility between carbonatitic melt and silicate melt
- Clustering and interfacial segregation of radiogenic Pb in a mineral host-inclusion system: Tracing two-stage Pb and trace element mobility in monazite inclusions in rutile
- First application of scintillator-based photon-counting computed tomography to rock samples: Preliminary results and prospects
- GCDkit.Mineral: A customizable, platform-independent R-language environment for recalculation, plotting, and classification of electron probe microanalyses of common rock-forming minerals
- Apatite as an archive of pegmatite-forming processes: An example from the Berry-Havey pegmatite (Maine, U.S.A.)
- Re-examination of vesbine in vanadate-rich sublimate-related associations of Vesuvius (Italy): Mineralogical features and origin
- Temperature and compositional dependences of H2O solubility in majorite
- Raman spectroscopy of the ilmenite–geikielite solid solution
Articles in the same Issue
- Germanium distribution in Mississippi Valley-Type systems from sulfide deposition to oxidative weathering: A perspective from Fule Pb-Zn(-Ge) deposit, South China
- Characterization and potential toxicity of asbestiform erionite from Gawler Downs, New Zealand
- First widespread occurrence of rare phosphate chladniite in a meteorite, winonaite Graves Nunataks (GRA) 12510: Implications for phosphide–phosphate redox buffered genesis in meteorites
- K isotopic fractionation in K-feldspar: Effects of mineral chemistry
- Jarosite formation in Permian-Triassic strata at Xiakou (South China): Implications for jarosite precipitation from H2S upwelling on Mars
- The effect of A-site cations on charge-carrier mobility in Fe-rich amphiboles
- Calorimetry and structural analysis of uranyl sulfates with rare topologies
- Biological control of ultra-skeleton mineralization in coral
- Systematic study of high field strength elements during liquid immiscibility between carbonatitic melt and silicate melt
- Clustering and interfacial segregation of radiogenic Pb in a mineral host-inclusion system: Tracing two-stage Pb and trace element mobility in monazite inclusions in rutile
- First application of scintillator-based photon-counting computed tomography to rock samples: Preliminary results and prospects
- GCDkit.Mineral: A customizable, platform-independent R-language environment for recalculation, plotting, and classification of electron probe microanalyses of common rock-forming minerals
- Apatite as an archive of pegmatite-forming processes: An example from the Berry-Havey pegmatite (Maine, U.S.A.)
- Re-examination of vesbine in vanadate-rich sublimate-related associations of Vesuvius (Italy): Mineralogical features and origin
- Temperature and compositional dependences of H2O solubility in majorite
- Raman spectroscopy of the ilmenite–geikielite solid solution