| 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); |
nothing calls this directly
no test coverage detected