This function loads a specified data file containing metabolomics measurements, identifies internal standards based on a naming convention, and generates plots for the distribution of internal standards across samples. It also saves the internal standard information in an Excel file.
plot_met_data_summary(
file_path,
output_xlsx = "internal_standards.xlsx",
is_plots_dir = "is_plots",
blank_pattern = "Blank|Control|Neg",
pooled_pattern = "Pooled QC|Pooled|Pool|PQ",
nist_pattern = "NIST Plasma|NIST|nist",
other_special_pattern = "Special Case|Extra Sample|Other QC"
)Saves internal standard plots and an Excel file with the identified internal standards.
The path to the metabolomics measurement data file (e.g., "area_TM.txt").
The path where the Excel file with internal standards will be saved (default is "internal_standards.xlsx").
Directory where plots for each internal standard will be saved (default is "is_plots").
Pattern for identifying blank samples in `Sample ID` column (default is "Blank|BLANK|blank|Control|Negative Control|Neg Control|BLK|Blk").
Pattern for identifying pooled QC samples in `Sample ID` column (default is "Pooled QC|Pooled_QC|Pooled|POOL|Pool|pool|QC Mix|Mix QC|Pool QC|PQ|PQC").
Pattern for identifying NIST QC samples in `Sample ID` column (default is "NIST Plasma|NIST_Plasma|NIST-QC|Reference Plasma|Plasma Ref|NIST_QC|NIST QC|NIST|nist").
Pattern for identifying other special cases in `Sample ID` column (default is "Special Case|Extra Sample|NonStandard QC|Other QC").
Yaoxiang Li