MetFragConfig.CompToxCSV: Create MetFrag Config Files with LocalCSV and Scoring Terms...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/MetFragConfigR.R

Description

This is a CompTox XLS or CSV specific wrapper function for MetFragConfig.

Usage

1
2
MetFragConfig.CompToxCSV(mass, adduct_type, results_filename, peaklist_path, base_dir,
CompToxLocalCSVterms, ...)

Arguments

mass

The mass with which to search the candidate database (DB). Use neutralPrecursorMass and adduct_type to set whether this is monoisotopic mass or an adduct species. Defaults to adduct_type.

adduct_type

The adduct species used to define mass (if neutralPrecursorMass=FALSE) and fragmentation settings in the config file, entered as either PrecursorIonType (text) or PrecursorIonmode (a number). The available options are given in the system file MetFragAdductTypes.csv in the extdata folder. Recommended default values (if ion state is unclear) are [M+H]+ (1) for positive and [M-H]- (-1) for negative mode.

results_filename

Enter a base filename for naming the results files - do not include file endings

peaklist_path

Enter the full path and file name to the peak list for this config file

base_dir

Enter the directory name to set up the subfolders for MetFrag batch results. If the folders don't exist, subfolders config, log and results are created; the output of this function is saved in config.

CompToxLocalCSVterms

The output of CompToxXLStoLocalCSVterms, CompToxCSVtoLocalCSVterms or CompToxFullCSVtoLocalCSVterms, used to set DB, localDB_path, UDS_Category and UDS_Weights in MetFragConfig

Details

Remaining parameters are described in MetFragConfig

Value

Returns a MetFrag config file name

Author(s)

Emma Schymanski <emma.schymanski@uni.lu> in partnership with Christoph Ruttkies (MetFragCL), Antony J. Williams and team (CompTox Dashboard)

See Also

MetFragConfig, runMetFrag, CompToxXLStoLocalCSVterms, CompToxCSVtoLocalCSVterms, CompToxFullCSVtoLocalCSVterms

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Example from DOI: 10.1021/acs.est.7b01908
# Note that this scores automatically with all metadata fields in the example file, which
# is not necessarily ideal as not all predicted values are relevant for ranking the best candidate.
CompToxXLS <- system.file("extdata","CompToxBatchSearch_MetFrag_MSready_C10H14N2.xls",package="ReSOLUTION")
LocalCSVterms <- CompToxXLStoLocalCSVterms(CompToxXLS)
peaklist <- system.file("extdata","EQ300804_Nicotine_peaks.txt",package="ReSOLUTION")
test_dir <- "C:/DATA/Workflow/MetFrag22/metfrag_test_results"
config_file <- MetFragConfig.CompToxCSV(163.1230, "[M+H]+","Nicotine_PrecMass_MpHp_XLS",peaklist, test_dir, LocalCSVterms)
metfrag_dir <- "C:/DATA/Workflow/MetFrag22/"
MetFragCL_name <- "MetFrag2.4.4-msready-CL.jar"
runMetFrag(config_file, metfrag_dir, MetFragCL_name)

# Example of Simazine
# Note that this uses a CSV file with fewer scoring terms that are more relevant for candidate selection.
CompToxFullCSV_test <- system.file("extdata","dsstox_MS_Ready_MetFragTestCSV5.csv",package="ReSOLUTION")
LocalCSVterms <- CompToxFullCSVtoLocalCSVterms(CompToxFullCSV_test)
peaklist <- system.file("extdata","EA026206_Simazine_peaks.txt",package="ReSOLUTION")
rt_file_path <- system.file("extdata","Eawag_rt_inchi.csv",package="ReSOLUTION")
test_dir <- "C:/DATA/Workflow/MetFrag22/metfrag_test_results"
MBrecord <- system.file("extdata","EA026206_Simazine.txt",package="ReSOLUTION")
MBinfo <- getMBRecordInfo.MetFragConfig(MBrecord,peaklist, writePeaklist=FALSE)
IsPosMode <- grepl(MBinfo$ion_mode,"POSITIVE")
adduct_type <- MBinfo$prec_type
config_file <- MetFragConfig.CompToxCSV(mass=MBinfo$exact_mass,adduct_type = adduct_type,
results_filename = paste0("Simazine", "_byExactMass_5ppm"),peaklist_path = MBinfo$peaklist,neutralPrecursorMass=TRUE,
base_dir = test_dir, CompToxLocalCSVterms = LocalCSVterms, IsPosMode = IsPosMode,rt_file_path = rt_file_path,
rt_exp = MBinfo$ret_time,filter_by_InChIKey = FALSE)

metfrag_dir <- "C:/DATA/Workflow/MetFrag22/"
MetFragCL_name <- "MetFrag2.4.4-msready-CL.jar"
runMetFrag(config_file, metfrag_dir, MetFragCL_name)


# Example of diclofenac
peaklist <- system.file("extdata","EA020161_Diclofenac_peaks.txt",package="ReSOLUTION")
MBrecord <- system.file("extdata","EA020161_Diclofenac.txt",package="ReSOLUTION")
MBinfo <- getMBRecordInfo.MetFragConfig(MBrecord,peaklist, writePeaklist=FALSE)
IsPosMode <- grepl(MBinfo$ion_mode,"POSITIVE")
adduct_type <- MBinfo$prec_type
config_file <- MetFragConfig.CompToxCSV(mass=MBinfo$prec_mass,adduct_type = adduct_type,
results_filename = paste0("Diclofenac", "_byPrecMass_5ppm"),peaklist_path = MBinfo$peaklist,neutralPrecursorMass=FALSE,
base_dir = test_dir, CompToxLocalCSVterms = LocalCSVterms, IsPosMode = IsPosMode,rt_file_path = rt_file_path,
rt_exp = MBinfo$ret_time,filter_by_InChIKey = FALSE)

metfrag_dir <- "C:/DATA/Workflow/MetFrag22/"
MetFragCL_name <- "MetFrag2.4.4-msready-CL.jar"
runMetFrag(config_file, metfrag_dir, MetFragCL_name)

schymane/ReSOLUTION documentation built on May 22, 2021, 3:41 a.m.