-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSubstanceClassClassifier_run.R
148 lines (127 loc) · 5.18 KB
/
SubstanceClassClassifier_run.R
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
##############################################################################
## general parameters
## cache
reParseMsp <- FALSE
reProcessAnno <- FALSE
reProcessFragmentMatrix <- FALSE
reProcessLibrary <- FALSE
## I/O
resultFolderForClassifiers <- "/home/htreutle/Data/SubstanceClasses/Classifier_ROC_Analysis"
resultFolderForMetfamilyProjects <- "/home/htreutle/Data/SubstanceClasses/MetFamily_class_projects"
progress <- FALSE
outDetail <- FALSE
maximumNumberOfScores <- 10000
removeRareFragments <- FALSE
builtClassifiers <- TRUE
writeMetFamilyProjects <- TRUE
calculateRMDstatistics <- FALSE
computeFragmentFisherTest <- FALSE
writeClassifiers <- TRUE
writeResults <- TRUE
outSuffix <- ""
## replicates
mergeDuplicatedSpectra <- TRUE
takeSpectraWithMaximumNumberOfPeaks <- FALSE
## classes
classOfClass <- c(
"ChemOnt|MainClass", # 1
"ChemOnt|AllClasses", # 2
"ChemOnt|Substituent", # 3
"ChEBI|Identified", # 4
"ChEBI|Predicted", # 5
"Scaffold" # 6
)[[2]]
#thisClass <- "Organic compounds; Lipids and lipid-like molecules; Prenol lipids; Terpene lactones; Sesquiterpene lactones"
thisClass <- NULL
## repeated random subsampling validation
minimumNumberOfPosSpectraPerClass <- 10
minimumNumberOfNegSpectraPerClass <- 10
numberOfDataSetDecompositions <- 10
proportionTraining <- 0.7
#fragmentColumnSelectionMethod <- "AbsoluteProportion"
#fragmentColumnSelectionMethod <- "ProportionOfSumOfFragmentPresence"
fragmentColumnSelectionMethod <- "ProportionOfHighestFragmentPresence"
minimumProportionOfPositiveFragments <- 0.05
## postprocessing
unitResolution <- FALSE
#######################################################################
## constraints
## library one
#thisLibrary <- NULL
thisLibrary <- "180912_MoNA-export-LC-MS-MS_Negative_Mode_processed.msp"
annoFile <- "/home/htreutle/Downloads/MetSWATH/MONA/190523_MSMS_HR_someScaffolds_completed.tsv"
splitClasses <- FALSE
splitClassesParameterSet <- list(
minimumNumberOfChildren = 5,
maximumNumberOfPrecursors = 1000,
distanceMeasure = "Jaccard (intensity-weighted)",
#distanceMeasure = "Jaccard",
clusterMethod = "ward.D"
)
thisMethod <- "method=ColSumsPos; smoothIntensities=FALSE"
#thisMethod <- "method=caret; smoothIntensities=FALSE, modelName=binda"
thisParameterSet <- list(
## parse msp
minimumIntensityOfMaximalMS2peak = 000,
minimumProportionOfMS2peaks = 0.05,
neutralLossesPrecursorToFragments = TRUE,
neutralLossesFragmentsToFragments = FALSE,
## built fragment matrix
mzDeviationAbsolute_grouping = 0.01,
mzDeviationInPPM_grouping = 10,
#doMs2PeakGroupDeisotoping = TRUE,
doMs2PeakGroupDeisotoping = FALSE,
mzDeviationAbsolute_ms2PeakGroupDeisotoping = 0.01,
mzDeviationInPPM_ms2PeakGroupDeisotoping = 10,
proportionOfMatchingPeaks_ms2PeakGroupDeisotoping = 0.9
)
##############################################################################
## box parameters
parameterSetAll <- list(
##############################################################################
## general parameters
## I/O
progress = progress,
outDetail = outDetail,
resultFolderForClassifiers = resultFolderForClassifiers,
resultFolderForMetfamilyProjects = resultFolderForMetfamilyProjects,
writeClassifiers = writeClassifiers,
writeResults = writeResults,
outSuffix = outSuffix,
maximumNumberOfScores = maximumNumberOfScores,
removeRareFragments = removeRareFragments,
builtClassifiers = builtClassifiers,
writeMetFamilyProjects = writeMetFamilyProjects,
calculateRMDstatistics = calculateRMDstatistics,
## classes
mergeDuplicatedSpectra = mergeDuplicatedSpectra,
takeSpectraWithMaximumNumberOfPeaks = takeSpectraWithMaximumNumberOfPeaks,
classOfClass = classOfClass,
thisClass = thisClass,
splitClasses = splitClasses,
splitClassesParameterSet = splitClassesParameterSet,
computeFragmentFisherTest = computeFragmentFisherTest,
## repeated random subsampling validation
minimumNumberOfPosSpectraPerClass = minimumNumberOfPosSpectraPerClass,
minimumNumberOfNegSpectraPerClass = minimumNumberOfNegSpectraPerClass,
numberOfDataSetDecompositions = numberOfDataSetDecompositions,
proportionTraining = proportionTraining,
fragmentColumnSelectionMethod = fragmentColumnSelectionMethod,
minimumProportionOfPositiveFragments = minimumProportionOfPositiveFragments,
## postprocessing
unitResolution = unitResolution,
#######################################################################
## cache
reParseMsp = reParseMsp,
reProcessAnno = reProcessAnno,
reProcessLibrary = reProcessLibrary,
reProcessFragmentMatrix = reProcessFragmentMatrix,
#######################################################################
## constraints
## library one
annoFile = annoFile,
thisLibrary = thisLibrary,
thisParameterSet = thisParameterSet,
thisMethod = thisMethod
)
runTest(parameterSetAll = parameterSetAll)