An automated Comparable and Harmonized Analyses of Micro-Particles
Source:R/easyCHAMP.R
easyCHAMP.Rd
Evaluate *.csv files, produced by microparticle analysis software (like MicroplasticFinder, MicroparticleAI or siMPle). It will count occurences of of fibres, fragments, spheres and pixels, as well as size fractions (customisable) for each polymer. Each file (i.e., each measurement) is evaluated separately, as well as summarized for all files (i.e., one sample). For details, check out the package website.
Usage
easyCHAMP(
path,
polymers = c("PU", "EVAc", "PA", "PAN", "PBT", "PET", "PE", "PMMA", "PP", "POM", "PS",
"PVC", "PC", "ABS", "PPSU", "CA", "PEEK", "EVOH", "PSU", "SILICONE", "PLA",
"PLAPBAT"),
sizeclasses = c(10, 20, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500),
setDivFactor = FALSE,
dataReturn = FALSE,
eocsum = TRUE,
particleNumbers = FALSE,
formFillDefault = FALSE,
colourFillDefault = FALSE,
colourSep = FALSE,
labpreset = FALSE,
blankKey = "Blank",
noBlank = FALSE,
sep = ";",
dec = ",",
colPol = 6,
colL = 17,
colReqPol = 24,
ReqPolKey = "ja",
colShape = 25,
colCol = 26,
colLFib = 27,
colArea = 4,
colWidth = 18,
fibre = "Faser",
sphere = "Kugel",
fragment = "Fragment",
pixel = "Pixel",
test = FALSE,
startrow = "auto"
)
Arguments
- path
The path where the files can be found. All *.csv files in this folder will be evaluated. Also saves the resulting files in this directory.
- polymers
A vector containing the abbreviations of polymers to be considered. Default vector contains 22 polymers.
- sizeclasses
A vector containing desired sizeclasses to be evaluated. Default is c(10, 20, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500) The function starts at 0 and then uses the set steps. It always uses values up to the provided higher number but excluding the former number (e.g., for the default values, the function uses 0 to <= 10, >10 to <= 20, >20 to <= 50, ..., all >500).
- setDivFactor
If set to 'filterwise', the function will request division factors for each filter during the processing. If set to 'samplewise', the function will request division factors for each sample (all filters of one sample). Sometimes the filters have to be divided because there are too many particles for one measurement. Then only a part of the original sample is analysed, which has to be corrected during the blank correction. It further might be, that the blank has a different division factor than the sample, since it might be good to use the full blank particle numbers and/or if a filter breaks appart, the factor might change for a single sample. Therefore each sample (and blank) need its own factor. Defaults to FALSE.
- dataReturn
If set TRUE, a data frame will be returned containing the data of all measurement with the necessary information.
- eocsum
If TRUE (default) it adds a column sum at the end of each column of the summary panel.
- particleNumbers
set TRUE if you would like to get an extra file with just plastic and non-plastic particle numbers for each file loaded.
- formFillDefault
If desired you can provide a default form that will be filled in, if no form is provided (NA). Should be one of the values of the parameters 'fibre', 'sphere', 'fragment' or 'pixel' (see below).
- colourFillDefault
If desired you can provide a default colour that will be filled in, if no colour is provided in the data (NA). However, in this function colour has no further meansing.
- colourSep
whether to separate colours in the analysis or not. Only usable in easyCHAMP.particles()!
- labpreset
A preset for most of the parameters (except: path, polymers, dataReturn, eocsum). Can be requested by other labs, to be implemented, that they don't have to be set manually all the time.
- blankKey
The key word to distinguish blanks from other measurements/samples. It is case sensitive to prevent accidental matching. Defaults to "Blank".
- noBlank
Can be set TRUE if you don't have a blank at all and just want to summarize your data (defaults to FALSE).
- sep
Symbol in your csv files indicating new a column. Defaults to ';'.
- dec
Symbol in your csv files indicating decimal sign. Defaults to ','.
- colPol
Column number where the polymer type is stated. In the TOEKI lab this is column 6 (Class Name). The polymer names (or abbreviations) can be set manually in 'polymers' in case the default does not apply. Could also be provided as column name, but only in ASCII encoding (e.g., special character as . and ä = d).
- colL
Column number for the particle length. In the TOEKI lab this is column 17 (Length 5µ). Could also be provided as column name, but only in ASCII encoding (e.g., special character as . and ä = d).
- colReqPol
Column number for the particle check, whether the particle is a polymer or not. In the TOEKI lab this is column 24 (Plastik? or Plastik ja/nein). Could also be provided as column name, but only in ASCII encoding (e.g., special character as . and ä = d). If no curing took place, this parameter could be set to 'none' which will cause the function to simply use all particles in the file. Warning: this might cause further warnings or errors to occur, if a polymer is not an unknown substance (e.g., it is no polymer).
- ReqPolKey
key word or sentence of 'colReqPol' that indicates that it is a plastic particle. Default is 'ja'.
- colShape
Column number for the particle shape. In the TOEKI lab this is column 25 (Form). Could also be provided as column name, but only in ASCII encoding (e.g., special character as . and ä = d). Can also be set to 'none' if no column for shape exists in the files. This will cause the function to create one and set as 'fragment' as shape. However, this can be ignored afterwards.
- colCol
Column number for the particle color In the TOEKI lab this is column 26 (Farbe). Could also be provided as column name, but only in ASCII encoding (e.g., special character as . and ä = d).
- colLFib
Column number for the particle length in case of a fibre with corrected length (because of curvy shape) In the TOEKI lab this is column 27 (Länge). Could also be provided as column name, but only in ASCII encoding (e.g., special character as . and ä = d).
- colArea
Column number for the particle length in case of a fibre with corrected length (because of curvy shape) In the TOEKI lab this is column 4 (Area µm²). Could also be provided as column name, but only in ASCII encoding (e.g., special character as . and ä = d).
- colWidth
Column number for the particle length in case of a fibre with corrected length (because of curvy shape) In the TOEKI lab this is column 18 (Width µm). Could also be provided as column name, but only in ASCII encoding (e.g., special character as . and ä = d).
- fibre
How fibres are called in colShape (Form). In the TOEKI lab it is 'Faser'.
- sphere
How spheres are called in colShape (Form). In the TOEKI lab it is 'Kugel'.
- fragment
How fragments are called in colShape (Form). In the TOEKI lab it is 'Fragment'.
- pixel
How pixels are called in colShape (Form). In the TOEKI lab it is 'Pixel'.
- test
Can be set TRUE when the function should be run in testing mode.
- startrow
Number of rows that can be omitted from the *.csv files. Usually preprocessing software provides a bunch of meta data, that are not of interest here. Usually 40 rows can be skipped (more or less - 0 in case of siMPle). This is automated now. However, automation can be disabled if a value is defined (e.g., for troubleshooting).
Value
If dataReturn = TRUE, the function returns a list object including all processed data of each processing step and the summary values.
References
https://www.purency.ai/microplastics-finder, https://maki-science.github.io/easyCHAMP/index.html, https://simple-plastics.eu/
Examples
# For this example the path doesn't matter.
# If you want to analyse your own data, set test = FALSE (or simply delete this parameter).
mydata <- easyCHAMP(path="//HERE/COMES/YOUR/PATH/", dataReturn = TRUE, test = TRUE)
#> Done.
# Change evaluated size classes (evaluate <10, 10-100, 100-500 and >500 µm).
mydata <- easyCHAMP(path="//HERE/COMES/YOUR/PATH/",
sizeclasses = c(10,100,500), dataReturn = TRUE, test = TRUE)
#> Done.
# Include a division factor for the samples and blanks (in case filters have been divided).
# Only works in interactive Session.
mydata <- easyCHAMP(path="//HERE/COMES/YOUR/PATH/",
setDivFactor = "samplewise", dataReturn = TRUE, test = TRUE)
#> Done.
# Skip the summary row at bottom of each column in the sample summary.
mydata <- easyCHAMP(path="//HERE/COMES/YOUR/PATH/",
eocsum = FALSE, dataReturn = TRUE, test = TRUE)
#> Done.