Detect Pharmaceutical Quality Deviations with MS, Raman and Statistics
Fusion of Mass Spectrometry and Raman Spectroscopy
Data
Ricardo Cunha
cunha@iuta.de29 November, 2024
Source:vignettes/articles/demo_paracetamol_fusion.Rmd
demo_paracetamol_fusion.Rmd
This article demonstrates how StreamFind, using mass spectrometry (MS) combined with Raman spectroscopy data, can be used to assess quality variation in the pharmaceutical Fizamol, which contains paracetamol as the active ingredient (API). Each product sample was measured by both MS and Raman spectroscopy. The data are pre-processed and fused to be used in unsupervised and supervised statistical analysis for quality assessment.
Pre-processing
Data is pre-processed using StreamFind’s built-in data-specific engines for MS and Raman data. Pre-processing workflows for each data type are performed prior to data fusion to improve statistical analysis.
MS
analysis | replicate | blank | description |
---|---|---|---|
01_20240415_Paracetamol_4152024_Paracetamol-Coffein-Aspirin_Blank_100 | blank_01 | blank_01 | Reference background 1 |
01_20240415_Paracetamol_4152024_Paracetamol-Coffein-Aspirin_Blank_101 | blank_01 | blank_01 | Reference background 1 |
01_20240415_Paracetamol_4152024_Paracetamol-Coffein-Aspirin_Blank_111 | blank_01 | blank_01 | Reference background 1 |
01_20240415_Paracetamol_4152024_Paracetamol-Coffein-Aspirin_Blank_112 | blank_01 | blank_01 | Reference background 1 |
02_20240415-33-1_025 | fiz_01 | blank_01 | Paracetamol product |
02_20240415-33-1_026 | fiz_01 | blank_01 | Paracetamol product |
02_20240415-33-1_027 | fiz_01 | blank_01 | Paracetamol product |
02_20240415-33-2_028 | fiz_02 | blank_01 | Paracetamol product |
02_20240415-33-2_029 | fiz_02 | blank_01 | Paracetamol product |
02_20240415-33-2_030 | fiz_02 | blank_01 | Paracetamol product |
02_20240415-33-3_031 | fiz_03 | blank_01 | Paracetamol product |
02_20240415-33-3_032 | fiz_03 | blank_01 | Paracetamol product |
02_20240415-33-3_033 | fiz_03 | blank_01 | Paracetamol product |
03_20240415-36-1_058 | fiz_04 | blank_01 | Paracetamol product |
03_20240415-36-1_059 | fiz_04 | blank_01 | Paracetamol product |
03_20240415-36-1_060 | fiz_04 | blank_01 | Paracetamol product |
03_20240415-36-2_061 | fiz_05 | blank_01 | Paracetamol product |
03_20240415-36-2_062 | fiz_05 | blank_01 | Paracetamol product |
03_20240415-36-2_063 | fiz_05 | blank_01 | Paracetamol product |
03_20240415-36-3_064 | fiz_06 | blank_01 | Paracetamol product |
03_20240415-36-3_065 | fiz_06 | blank_01 | Paracetamol product |
03_20240415-36-3_066 | fiz_06 | blank_01 | Paracetamol product |
04_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_Blank_009 | blank_02 | blank_02 | Reference background 2 |
04_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_Blank_010 | blank_02 | blank_02 | Reference background 2 |
04_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_Blank_020 | blank_02 | blank_02 | Reference background 2 |
04_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_Blank_021 | blank_02 | blank_02 | Reference background 2 |
04_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_Blank_031 | blank_02 | blank_02 | Reference background 2 |
04_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_Blank_032 | blank_02 | blank_02 | Reference background 2 |
04_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_Blank_042 | blank_02 | blank_02 | Reference background 2 |
04_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_Blank_043 | blank_02 | blank_02 | Reference background 2 |
05_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-2-1-1_022 | fiz_07 | blank_02 | Paracetamol product |
05_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-2-1-2_023 | fiz_07 | blank_02 | Paracetamol product |
05_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-2-1-3_024 | fiz_07 | blank_02 | Paracetamol product |
05_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-2-2-1_025 | fiz_08 | blank_02 | Paracetamol product |
05_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-2-2-2_026 | fiz_08 | blank_02 | Paracetamol product |
05_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-2-2-3_027 | fiz_08 | blank_02 | Paracetamol product |
05_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-2-3-1_028 | fiz_09 | blank_02 | Paracetamol product |
05_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-2-3-2_029 | fiz_09 | blank_02 | Paracetamol product |
05_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-2-3-3_030 | fiz_09 | blank_02 | Paracetamol product |
06_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-3-1-1_033 | fiz_10 | blank_02 | Paracetamol product |
06_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-3-1-2_034 | fiz_10 | blank_02 | Paracetamol product |
06_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-3-1-3_035 | fiz_10 | blank_02 | Paracetamol product |
06_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-3-2-1_036 | fiz_11 | blank_02 | Paracetamol product |
06_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-3-2-2_037 | fiz_11 | blank_02 | Paracetamol product |
06_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-3-2-3_038 | fiz_11 | blank_02 | Paracetamol product |
06_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-3-3-1_039 | fiz_12 | blank_02 | Paracetamol product |
06_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-3-3-2_040 | fiz_12 | blank_02 | Paracetamol product |
06_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-3-3-3_041 | fiz_12 | blank_02 | Paracetamol product |
07_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-4-1-1_044 | fiz_13 | blank_02 | Paracetamol product |
07_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-4-1-2_045 | fiz_13 | blank_02 | Paracetamol product |
07_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-4-1-3_046 | fiz_13 | blank_02 | Paracetamol product |
07_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-4-2-1_047 | fiz_14 | blank_02 | Paracetamol product |
07_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-4-2-2_048 | fiz_14 | blank_02 | Paracetamol product |
07_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-4-2-3_049 | fiz_14 | blank_02 | Paracetamol product |
07_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-4-3-1_050 | fiz_15 | blank_02 | Paracetamol product |
07_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-4-3-2_051 | fiz_15 | blank_02 | Paracetamol product |
07_20240516_Paracetamol_5162024_Paracetamol-Coffein-Aspirin_12-4-3-3_052 | fiz_15 | blank_02 | Paracetamol product |
08_acid_20240415-37-1_069 | fiz_acid_1 | blank_01 | Paracetamol with acetic acid |
08_acid_20240415-37-1_070 | fiz_acid_1 | blank_01 | Paracetamol with acetic acid |
08_acid_20240415-37-1_071 | fiz_acid_1 | blank_01 | Paracetamol with acetic acid |
08_acid_20240415-37-2_072 | fiz_acid_2 | blank_01 | Paracetamol with acetic acid |
08_acid_20240415-37-2_073 | fiz_acid_2 | blank_01 | Paracetamol with acetic acid |
08_acid_20240415-37-2_074 | fiz_acid_2 | blank_01 | Paracetamol with acetic acid |
08_acid_20240415-37-3_075 | fiz_acid_3 | blank_01 | Paracetamol with acetic acid |
08_acid_20240415-37-3_076 | fiz_acid_3 | blank_01 | Paracetamol with acetic acid |
08_acid_20240415-37-3_077 | fiz_acid_3 | blank_01 | Paracetamol with acetic acid |
09_ass_20240415-35-1_047 | fiz_ass_1 | blank_01 | Paracetamol with aspirin |
09_ass_20240415-35-1_048 | fiz_ass_1 | blank_01 | Paracetamol with aspirin |
09_ass_20240415-35-1_049 | fiz_ass_1 | blank_01 | Paracetamol with aspirin |
09_ass_20240415-35-2_050 | fiz_ass_2 | blank_01 | Paracetamol with aspirin |
09_ass_20240415-35-2_051 | fiz_ass_2 | blank_01 | Paracetamol with aspirin |
09_ass_20240415-35-2_052 | fiz_ass_2 | blank_01 | Paracetamol with aspirin |
09_ass_20240415-35-3_053 | fiz_ass_3 | blank_01 | Paracetamol with aspirin |
09_ass_20240415-35-3_054 | fiz_ass_3 | blank_01 | Paracetamol with aspirin |
09_ass_20240415-35-3_055 | fiz_ass_3 | blank_01 | Paracetamol with aspirin |
10_caff_20240415-34-1_036 | fiz_caff_1 | blank_01 | Paracetamol with caffeine |
10_caff_20240415-34-1_037 | fiz_caff_1 | blank_01 | Paracetamol with caffeine |
10_caff_20240415-34-1_038 | fiz_caff_1 | blank_01 | Paracetamol with caffeine |
10_caff_20240415-34-2_039 | fiz_caff_2 | blank_01 | Paracetamol with caffeine |
10_caff_20240415-34-2_040 | fiz_caff_2 | blank_01 | Paracetamol with caffeine |
10_caff_20240415-34-2_041 | fiz_caff_2 | blank_01 | Paracetamol with caffeine |
10_caff_20240415-34-3_042 | fiz_caff_3 | blank_01 | Paracetamol with caffeine |
10_caff_20240415-34-3_043 | fiz_caff_3 | blank_01 | Paracetamol with caffeine |
10_caff_20240415-34-3_044 | fiz_caff_3 | blank_01 | Paracetamol with caffeine |
11_old_20240415-31-1_003 | fiz_old_1 | blank_01 | Paracetamol stored |
11_old_20240415-31-1_004 | fiz_old_1 | blank_01 | Paracetamol stored |
11_old_20240415-31-1_005 | fiz_old_1 | blank_01 | Paracetamol stored |
11_old_20240415-31-2_006 | fiz_old_2 | blank_01 | Paracetamol stored |
11_old_20240415-31-2_007 | fiz_old_2 | blank_01 | Paracetamol stored |
11_old_20240415-31-2_008 | fiz_old_2 | blank_01 | Paracetamol stored |
11_old_20240415-31-3_009 | fiz_old_3 | blank_01 | Paracetamol stored |
11_old_20240415-31-3_010 | fiz_old_3 | blank_01 | Paracetamol stored |
11_old_20240415-31-3_011 | fiz_old_3 | blank_01 | Paracetamol stored |
ms_workflow <- list(
MassSpecSettings_LoadSpectra_StreamFind(levels = 1, mzmax = 300, rtmax = 120),
MassSpecSettings_BinSpectra_StreamFind(binNames = c("rt", "mz"), binValues = c(5, 2), refBinAnalysis = 1),
MassSpecSettings_NormalizeSpectra_minmax(),
MassSpecSettings_AverageSpectra_StreamFind(),
MassSpecSettings_SubtractBlankSpectra_StreamFind(negativeToZero = TRUE),
MassSpecSettings_NormalizeSpectra_blockweight()
)
ms$workflow <- ms_workflow
ms$print_workflow()
1: LoadSpectra (StreamFind)
2: BinSpectra (StreamFind)
3: NormalizeSpectra (minmax)
4: AverageSpectra (StreamFind)
5: SubtractBlankSpectra (StreamFind)
6: NormalizeSpectra (blockweight)
ms$run_workflow()
ms$plot_spectra()
Raman
analysis | replicate | blank | description |
---|---|---|---|
01_240411_blank_200mW_OD3_2s_36n_pos1_r1 | blank_01 | blank_01 | Reference background 1 |
01_240411_blank_200mW_OD3_2s_36n_pos1_r2 | blank_01 | blank_01 | Reference background 1 |
01_240411_blank_200mW_OD3_2s_36n_pos1_r3 | blank_01 | blank_01 | Reference background 1 |
01_240411_blank_200mW_OD3_2s_36n_pos2_r1 | blank_01 | blank_01 | Reference background 1 |
01_240411_blank_200mW_OD3_2s_36n_pos2_r2 | blank_01 | blank_01 | Reference background 1 |
01_240411_blank_200mW_OD3_2s_36n_pos2_r3 | blank_01 | blank_01 | Reference background 1 |
01_240411_blank_200mW_OD3_2s_36n_pos3_r1 | blank_01 | blank_01 | Reference background 1 |
01_240411_blank_200mW_OD3_2s_36n_pos3_r2 | blank_01 | blank_01 | Reference background 1 |
01_240411_blank_200mW_OD3_2s_36n_pos3_r3 | blank_01 | blank_01 | Reference background 1 |
02_240411_Fizamol-11_200mW_OD3_2s_36n_pos1_r1 | fiz_01 | blank_01 | Paracetamol product |
02_240411_Fizamol-11_200mW_OD3_2s_36n_pos1_r2 | fiz_01 | blank_01 | Paracetamol product |
02_240411_Fizamol-11_200mW_OD3_2s_36n_pos1_r3 | fiz_01 | blank_01 | Paracetamol product |
02_240411_Fizamol-11_200mW_OD3_2s_36n_pos2_r1 | fiz_02 | blank_01 | Paracetamol product |
02_240411_Fizamol-11_200mW_OD3_2s_36n_pos2_r2 | fiz_02 | blank_01 | Paracetamol product |
02_240411_Fizamol-11_200mW_OD3_2s_36n_pos2_r3 | fiz_02 | blank_01 | Paracetamol product |
02_240411_Fizamol-11_200mW_OD3_2s_36n_pos3_r1 | fiz_03 | blank_01 | Paracetamol product |
02_240411_Fizamol-11_200mW_OD3_2s_36n_pos3_r2 | fiz_03 | blank_01 | Paracetamol product |
02_240411_Fizamol-11_200mW_OD3_2s_36n_pos3_r3 | fiz_03 | blank_01 | Paracetamol product |
03_240411_Fizamol-12_200mW_OD3_2s_36n_pos1_r1 | fiz_04 | blank_01 | Paracetamol product |
03_240411_Fizamol-12_200mW_OD3_2s_36n_pos1_r2 | fiz_04 | blank_01 | Paracetamol product |
03_240411_Fizamol-12_200mW_OD3_2s_36n_pos1_r3 | fiz_04 | blank_01 | Paracetamol product |
03_240411_Fizamol-12_200mW_OD3_2s_36n_pos2_r1 | fiz_05 | blank_01 | Paracetamol product |
03_240411_Fizamol-12_200mW_OD3_2s_36n_pos2_r2 | fiz_05 | blank_01 | Paracetamol product |
03_240411_Fizamol-12_200mW_OD3_2s_36n_pos2_r3 | fiz_05 | blank_01 | Paracetamol product |
03_240411_Fizamol-12_200mW_OD3_2s_36n_pos3_r1 | fiz_06 | blank_01 | Paracetamol product |
03_240411_Fizamol-12_200mW_OD3_2s_36n_pos3_r2 | fiz_06 | blank_01 | Paracetamol product |
03_240411_Fizamol-12_200mW_OD3_2s_36n_pos3_r3 | fiz_06 | blank_01 | Paracetamol product |
04_240412_BlankH2O_200mW_OD3_2s_36n_pos1_r1 | blank_02 | blank_02 | Reference background 2 |
04_240412_BlankH2O_200mW_OD3_2s_36n_pos1_r2 | blank_02 | blank_02 | Reference background 2 |
04_240412_BlankH2O_200mW_OD3_2s_36n_pos1_r3 | blank_02 | blank_02 | Reference background 2 |
04_240412_BlankH2O_200mW_OD3_2s_36n_pos2_r1 | blank_02 | blank_02 | Reference background 2 |
04_240412_BlankH2O_200mW_OD3_2s_36n_pos2_r2 | blank_02 | blank_02 | Reference background 2 |
04_240412_BlankH2O_200mW_OD3_2s_36n_pos2_r3 | blank_02 | blank_02 | Reference background 2 |
04_240412_BlankH2O_200mW_OD3_2s_36n_pos3_r1 | blank_02 | blank_02 | Reference background 2 |
04_240412_BlankH2O_200mW_OD3_2s_36n_pos3_r2 | blank_02 | blank_02 | Reference background 2 |
04_240412_BlankH2O_200mW_OD3_2s_36n_pos3_r3 | blank_02 | blank_02 | Reference background 2 |
05_240412_Fizamol12-2_200mW_OD3_2s_36n_pos1_r1 | fiz_07 | blank_02 | Paracetamol product |
05_240412_Fizamol12-2_200mW_OD3_2s_36n_pos1_r2 | fiz_07 | blank_02 | Paracetamol product |
05_240412_Fizamol12-2_200mW_OD3_2s_36n_pos1_r3 | fiz_07 | blank_02 | Paracetamol product |
05_240412_Fizamol12-2_200mW_OD3_2s_36n_pos2_r1 | fiz_08 | blank_02 | Paracetamol product |
05_240412_Fizamol12-2_200mW_OD3_2s_36n_pos2_r2 | fiz_08 | blank_02 | Paracetamol product |
05_240412_Fizamol12-2_200mW_OD3_2s_36n_pos2_r3 | fiz_08 | blank_02 | Paracetamol product |
05_240412_Fizamol12-2_200mW_OD3_2s_36n_pos3_r1 | fiz_09 | blank_02 | Paracetamol product |
05_240412_Fizamol12-2_200mW_OD3_2s_36n_pos3_r2 | fiz_09 | blank_02 | Paracetamol product |
05_240412_Fizamol12-2_200mW_OD3_2s_36n_pos3_r3 | fiz_09 | blank_02 | Paracetamol product |
06_240412_Fizamol12-3_200mW_OD3_2s_36n_pos1_r1 | fiz_10 | blank_02 | Paracetamol product |
06_240412_Fizamol12-3_200mW_OD3_2s_36n_pos1_r2 | fiz_10 | blank_02 | Paracetamol product |
06_240412_Fizamol12-3_200mW_OD3_2s_36n_pos1_r3 | fiz_10 | blank_02 | Paracetamol product |
06_240412_Fizamol12-3_200mW_OD3_2s_36n_pos2_r1 | fiz_11 | blank_02 | Paracetamol product |
06_240412_Fizamol12-3_200mW_OD3_2s_36n_pos2_r2 | fiz_11 | blank_02 | Paracetamol product |
06_240412_Fizamol12-3_200mW_OD3_2s_36n_pos2_r3 | fiz_11 | blank_02 | Paracetamol product |
06_240412_Fizamol12-3_200mW_OD3_2s_36n_pos3_r1 | fiz_12 | blank_02 | Paracetamol product |
06_240412_Fizamol12-3_200mW_OD3_2s_36n_pos3_r2 | fiz_12 | blank_02 | Paracetamol product |
06_240412_Fizamol12-3_200mW_OD3_2s_36n_pos3_r3 | fiz_12 | blank_02 | Paracetamol product |
07_240412_Fizamol12-4_200mW_OD3_2s_36n_pos1_r1 | fiz_13 | blank_02 | Paracetamol product |
07_240412_Fizamol12-4_200mW_OD3_2s_36n_pos1_r2 | fiz_13 | blank_02 | Paracetamol product |
07_240412_Fizamol12-4_200mW_OD3_2s_36n_pos1_r3 | fiz_13 | blank_02 | Paracetamol product |
07_240412_Fizamol12-4_200mW_OD3_2s_36n_pos2_r1 | fiz_14 | blank_02 | Paracetamol product |
07_240412_Fizamol12-4_200mW_OD3_2s_36n_pos2_r2 | fiz_14 | blank_02 | Paracetamol product |
07_240412_Fizamol12-4_200mW_OD3_2s_36n_pos2_r3 | fiz_14 | blank_02 | Paracetamol product |
07_240412_Fizamol12-4_200mW_OD3_2s_36n_pos3_r1 | fiz_15 | blank_02 | Paracetamol product |
07_240412_Fizamol12-4_200mW_OD3_2s_36n_pos3_r2 | fiz_15 | blank_02 | Paracetamol product |
07_240412_Fizamol12-4_200mW_OD3_2s_36n_pos3_r3 | fiz_15 | blank_02 | Paracetamol product |
08_240412_Fizamol-11+2prozentEssig_200mW_OD3_2s_36n_pos1_r1 | fiz_acid_1 | blank_01 | Paracetamol with acetic acid |
08_240412_Fizamol-11+2prozentEssig_200mW_OD3_2s_36n_pos1_r2 | fiz_acid_1 | blank_01 | Paracetamol with acetic acid |
08_240412_Fizamol-11+2prozentEssig_200mW_OD3_2s_36n_pos1_r3 | fiz_acid_1 | blank_01 | Paracetamol with acetic acid |
08_240412_Fizamol-11+2prozentEssig_200mW_OD3_2s_36n_pos2_r1 | fiz_acid_2 | blank_01 | Paracetamol with acetic acid |
08_240412_Fizamol-11+2prozentEssig_200mW_OD3_2s_36n_pos2_r2 | fiz_acid_2 | blank_01 | Paracetamol with acetic acid |
08_240412_Fizamol-11+2prozentEssig_200mW_OD3_2s_36n_pos2_r3 | fiz_acid_2 | blank_01 | Paracetamol with acetic acid |
08_240412_Fizamol-11+2prozentEssig_200mW_OD3_2s_36n_pos3_r1 | fiz_acid_3 | blank_01 | Paracetamol with acetic acid |
08_240412_Fizamol-11+2prozentEssig_200mW_OD3_2s_36n_pos3_r2 | fiz_acid_3 | blank_01 | Paracetamol with acetic acid |
08_240412_Fizamol-11+2prozentEssig_200mW_OD3_2s_36n_pos3_r3 | fiz_acid_3 | blank_01 | Paracetamol with acetic acid |
09_240411_Fizamol-11+1mgmLASS2_200mW_OD3_2s_36n_pos1_r1 | fiz_ass_1 | blank_01 | Paracetamol with aspirin |
09_240411_Fizamol-11+1mgmLASS2_200mW_OD3_2s_36n_pos1_r2 | fiz_ass_1 | blank_01 | Paracetamol with aspirin |
09_240411_Fizamol-11+1mgmLASS2_200mW_OD3_2s_36n_pos1_r3 | fiz_ass_1 | blank_01 | Paracetamol with aspirin |
09_240411_Fizamol-11+1mgmLASS2_200mW_OD3_2s_36n_pos2_r1 | fiz_ass_2 | blank_01 | Paracetamol with aspirin |
09_240411_Fizamol-11+1mgmLASS2_200mW_OD3_2s_36n_pos2_r2 | fiz_ass_2 | blank_01 | Paracetamol with aspirin |
09_240411_Fizamol-11+1mgmLASS2_200mW_OD3_2s_36n_pos2_r3 | fiz_ass_2 | blank_01 | Paracetamol with aspirin |
09_240411_Fizamol-11+1mgmLASS2_200mW_OD3_2s_36n_pos3_r1 | fiz_ass_3 | blank_01 | Paracetamol with aspirin |
09_240411_Fizamol-11+1mgmLASS2_200mW_OD3_2s_36n_pos3_r2 | fiz_ass_3 | blank_01 | Paracetamol with aspirin |
09_240411_Fizamol-11+1mgmLASS2_200mW_OD3_2s_36n_pos3_r3 | fiz_ass_3 | blank_01 | Paracetamol with aspirin |
10_240411_Fizamol-11+1mgmLcoffein_200mW_OD3_2s_36n_pos1_r1 | fiz_caff_1 | blank_01 | Paracetamol with caffeine |
10_240411_Fizamol-11+1mgmLcoffein_200mW_OD3_2s_36n_pos1_r2 | fiz_caff_1 | blank_01 | Paracetamol with caffeine |
10_240411_Fizamol-11+1mgmLcoffein_200mW_OD3_2s_36n_pos1_r3 | fiz_caff_1 | blank_01 | Paracetamol with caffeine |
10_240411_Fizamol-11+1mgmLcoffein_200mW_OD3_2s_36n_pos2_r1 | fiz_caff_2 | blank_01 | Paracetamol with caffeine |
10_240411_Fizamol-11+1mgmLcoffein_200mW_OD3_2s_36n_pos2_r2 | fiz_caff_2 | blank_01 | Paracetamol with caffeine |
10_240411_Fizamol-11+1mgmLcoffein_200mW_OD3_2s_36n_pos2_r3 | fiz_caff_2 | blank_01 | Paracetamol with caffeine |
10_240411_Fizamol-11+1mgmLcoffein_200mW_OD3_2s_36n_pos3_r1 | fiz_caff_3 | blank_01 | Paracetamol with caffeine |
10_240411_Fizamol-11+1mgmLcoffein_200mW_OD3_2s_36n_pos3_r2 | fiz_caff_3 | blank_01 | Paracetamol with caffeine |
10_240411_Fizamol-11+1mgmLcoffein_200mW_OD3_2s_36n_pos3_r3 | fiz_caff_3 | blank_01 | Paracetamol with caffeine |
11_240411_Fizamol-11gealtert_200mW_OD3_2s_36n_pos1_r1 | fiz_old_1 | blank_01 | Paracetamol stored |
11_240411_Fizamol-11gealtert_200mW_OD3_2s_36n_pos1_r2 | fiz_old_1 | blank_01 | Paracetamol stored |
11_240411_Fizamol-11gealtert_200mW_OD3_2s_36n_pos1_r3 | fiz_old_1 | blank_01 | Paracetamol stored |
11_240411_Fizamol-11gealtert_200mW_OD3_2s_36n_pos2_r1 | fiz_old_2 | blank_01 | Paracetamol stored |
11_240411_Fizamol-11gealtert_200mW_OD3_2s_36n_pos2_r2 | fiz_old_2 | blank_01 | Paracetamol stored |
11_240411_Fizamol-11gealtert_200mW_OD3_2s_36n_pos2_r3 | fiz_old_2 | blank_01 | Paracetamol stored |
11_240411_Fizamol-11gealtert_200mW_OD3_2s_36n_pos3_r1 | fiz_old_3 | blank_01 | Paracetamol stored |
11_240411_Fizamol-11gealtert_200mW_OD3_2s_36n_pos3_r2 | fiz_old_3 | blank_01 | Paracetamol stored |
11_240411_Fizamol-11gealtert_200mW_OD3_2s_36n_pos3_r3 | fiz_old_3 | blank_01 | Paracetamol stored |
raman_workflow <- list(
RamanSettings_AverageSpectra_StreamFind(),
RamanSettings_SubtractBlankSpectra_StreamFind(),
RamanSettings_SmoothSpectra_savgol(fl = 21, forder = 4, dorder = 0),
RamanSettings_DeleteSpectraSection_StreamFind(shiftmin = -100, shiftmax = 350),
RamanSettings_DeleteSpectraSection_StreamFind(shiftmin = 1800, shiftmax = 2500),
RamanSettings_CorrectSpectraBaseline_airpls(lambda = 45, differences = 1, itermax = 30),
RamanSettings_NormalizeSpectra_minmax(),
RamanSettings_NormalizeSpectra_blockweight()
)
raman$workflow <- raman_workflow
raman$print_workflow()
1: AverageSpectra (StreamFind)
2: SubtractBlankSpectra (StreamFind)
3: SmoothSpectra (savgol)
4: DeleteSpectraSection (StreamFind)
5: DeleteSpectraSection (StreamFind)
6: CorrectSpectraBaseline (airpls)
7: NormalizeSpectra (minmax)
8: NormalizeSpectra (blockweight)
raman$run_workflow()
raman$plot_spectra()
Fusion
Statistical analysis is performed on the merged data for combination of orthogonal information in MS and Raman data.
ms_spec_mat <- ms$get_spectra_matrix()
raman_spec_mat <- raman$get_spectra_matrix()
fused_mat <- cbind(ms_spec_mat, raman_spec_mat)
# The fused matrix is mean centered using the mdatools R package
fused_mat <- mdatools::prep.autoscale(fused_mat, center = TRUE, scale = FALSE)
str(fused_mat)
num [1:27, 1:3599] 9.07e-04 6.18e-04 9.10e-05 9.96e-05 -6.17e-04 ...
- attr(*, "dimnames")=List of 2
..$ : chr [1:27] "fiz_01" "fiz_02" "fiz_03" "fiz_04" ...
..$ : chr [1:3599] "0-101" "0-103" "0-105" "0-107" ...
- attr(*, "prep:center")= Named num [1:3599] 0.000617 0.000175 0.00112 0 0.00044 ...
..- attr(*, "names")= chr [1:3599] "0-101" "0-103" "0-105" "0-107" ...
- attr(*, "prep:scale")= logi FALSE
Statistic analysis
Unsupervised
Principle Components Analysis (PCA) can be used for unsupervised evaluation, that is, we assume that the main (or training) set of analyses is of good quality and we test new analyses to evaluate their closeness to the main set. You could say it is a supervised approach, but in the sense that we assume the quality of the main set. However, we do not classify the possible deviation of the new analyses, which would be a clearly supervised approach, as we show in the next subchapter.
[1] "fiz_01" "fiz_02" "fiz_03" "fiz_04" "fiz_05" "fiz_06" "fiz_07" "fiz_08"
[9] "fiz_09" "fiz_10"
test_set <- fused_mat[-main_set_idx, ]
rownames(test_set)
[1] "fiz_11" "fiz_12" "fiz_13" "fiz_14" "fiz_15"
[6] "fiz_acid_1" "fiz_acid_2" "fiz_acid_3" "fiz_ass_1" "fiz_ass_2"
[11] "fiz_ass_3" "fiz_caff_1" "fiz_caff_2" "fiz_caff_3" "fiz_old_1"
[16] "fiz_old_2" "fiz_old_3"
stat <- StatisticEngine$new(analyses = main_set)
# The alpha and gamma parameters are used to evaluate the model limits
stat$run(StatisticSettings_MakeModel_pca_mdatools(ncomp = 3, alpha = 0.01, gamma = 0.001))
plot(stat$model, showText = TRUE)
stat$predict(test_set)
plot(stat$model, showText = TRUE)
Supervised (classification)
K-Nearest Neighbors (KNN) can be used to classify analyses based on pre-classified training analyses.
train_idx <- unique(c(grep("1", rownames(fused_mat)), grep("2", rownames(fused_mat))))
train_set <- fused_mat[train_idx, ]
train_set <- train_set[order(rownames(train_set)), ]
rownames(train_set)
[1] "fiz_01" "fiz_02" "fiz_10" "fiz_11" "fiz_12"
[6] "fiz_13" "fiz_14" "fiz_15" "fiz_acid_1" "fiz_acid_2"
[11] "fiz_ass_1" "fiz_ass_2" "fiz_caff_1" "fiz_caff_2" "fiz_old_1"
[16] "fiz_old_2"
test_set <- fused_mat[-train_idx, ]
rownames(test_set)
[1] "fiz_03" "fiz_04" "fiz_05" "fiz_06" "fiz_07"
[6] "fiz_08" "fiz_09" "fiz_acid_3" "fiz_ass_3" "fiz_caff_3"
[11] "fiz_old_3"
labels <- c(
rep("fiz", 8),
rep("fiz_acid", 2),
rep("fiz_ass", 2),
rep("fiz_caff", 2),
rep("fiz_old", 2)
)
stat2 <- StatisticEngine$new(analyses = train_set)
stat2$add_classes(labels)
stat2$run(StatisticSettings_MakeModel_knn(k = 3))
stat2$predict(test_set)
stat2$model$prediction$results
result analysis class probability
<char> <char> <fctr> <num>
1: prediction fiz_03 fiz 0.7
2: prediction fiz_04 fiz_ass 0.7
3: prediction fiz_05 fiz_ass 0.7
4: prediction fiz_06 fiz_ass 0.7
5: prediction fiz_07 fiz 1.0
6: prediction fiz_08 fiz 1.0
7: prediction fiz_09 fiz 1.0
8: prediction fiz_acid_3 fiz_acid 0.7
9: prediction fiz_ass_3 fiz_ass 0.7
10: prediction fiz_caff_3 fiz_caff 0.7
11: prediction fiz_old_3 fiz_old 0.7