MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / main_

Method main_

src/topp/FalseDiscoveryRate.cpp:120–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118 }
119
120 ExitCodes main_(int, const char**) override
121 {
122 //-------------------------------------------------------------
123 // parameter handling
124 //-------------------------------------------------------------
125
126 Param alg_param = getParam_().copy("algorithm:", true);
127 FalseDiscoveryRate fdr;
128
129 fdr.setParameters(alg_param);
130 writeDebug_("Parameters passed to FalseDiscoveryRate", alg_param, 3);
131
132 // input/output files
133 String in = getStringOption_("in");
134 String out = getStringOption_("out");
135 const double protein_fdr = getDoubleOption_("FDR:protein");
136 const double psm_fdr = getDoubleOption_("FDR:PSM");
137
138 //-------------------------------------------------------------
139 // loading input
140 //-------------------------------------------------------------
141
142 vector<PeptideIdentification> pep_ids;
143 vector<ProteinIdentification> prot_ids;
144
145 IdXMLFile().load(in, prot_ids, pep_ids);
146
147 Size n_prot_ids = prot_ids.size();
148 Size n_prot_hits = IDFilter::countHits(prot_ids);
149 Size n_pep_ids = pep_ids.size();
150 Size n_pep_hits = IDFilter::countHits(pep_ids);
151
152 bool filter_applied(false);
153
154 try
155 {
156 if (getStringOption_("protein") == "true")
157 {
158
159 for (auto& run : prot_ids)
160 {
161 if (!run.hasInferenceData() && !getFlag_("force"))
162 {
163 throw OpenMS::Exception::MissingInformation(
164 __FILE__,
165 __LINE__,
166 OPENMS_PRETTY_FUNCTION,
167 "It seems like protein inference was not yet performed."
168 " Calculating Protein FDR is probably not meaningful. To override,"
169 " use the force flag.");
170 }
171 else
172 {
173 fdr.applyBasic(run, true);
174 if (protein_fdr < 1)
175 {
176 OPENMS_LOG_INFO << "FDR control: Filtering proteins..." << endl;
177 IDFilter::filterHitsByScore(prot_ids, protein_fdr);

Callers

nothing calls this directly

Calls 12

countHitsFunction · 0.85
filterHitsByScoreFunction · 0.85
updateHitRanksFunction · 0.85
setParametersMethod · 0.80
hasInferenceDataMethod · 0.80
applyBasicMethod · 0.80
copyMethod · 0.45
loadMethod · 0.45
sizeMethod · 0.45
applyMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected