| 90 | } |
| 91 | |
| 92 | ExitCodes main_(int, const char **) override |
| 93 | { |
| 94 | String in = getStringOption_("in"); |
| 95 | String out = getStringOption_("out"); |
| 96 | String algo_type = getStringOption_("algorithm_type"); |
| 97 | String acc_filter = getStringOption_("accession_filter"); |
| 98 | String desc_filter = getStringOption_("description_filter"); |
| 99 | double ratio_threshold = getDoubleOption_("ratio_threshold"); |
| 100 | |
| 101 | ConsensusXMLFile infile; |
| 102 | infile.setLogType(log_type_); |
| 103 | ConsensusMap map; |
| 104 | infile.load(in, map); |
| 105 | |
| 106 | //map normalization |
| 107 | if (algo_type == "robust_regression") |
| 108 | { |
| 109 | map.sortBySize(); |
| 110 | vector<double> results = ConsensusMapNormalizerAlgorithmThreshold::computeCorrelation(map, ratio_threshold, acc_filter, desc_filter); |
| 111 | ConsensusMapNormalizerAlgorithmThreshold::normalizeMaps(map, results); |
| 112 | } |
| 113 | else if (algo_type == "median") |
| 114 | { |
| 115 | ConsensusMapNormalizerAlgorithmMedian::normalizeMaps(map, ConsensusMapNormalizerAlgorithmMedian::NM_SCALE, acc_filter, desc_filter); |
| 116 | } |
| 117 | else if (algo_type == "median_shift") |
| 118 | { |
| 119 | ConsensusMapNormalizerAlgorithmMedian::normalizeMaps(map, ConsensusMapNormalizerAlgorithmMedian::NM_SHIFT, acc_filter, desc_filter); |
| 120 | } |
| 121 | else if (algo_type == "quantile") |
| 122 | { |
| 123 | if (!acc_filter.empty() || !desc_filter.empty()) |
| 124 | { |
| 125 | OPENMS_LOG_WARN << endl << "NOTE: Accession / description filtering is not supported in quantile normalization mode. Ignoring filters." << endl << endl; |
| 126 | } |
| 127 | ConsensusMapNormalizerAlgorithmQuantile::normalizeMaps(map); |
| 128 | } |
| 129 | else |
| 130 | { |
| 131 | cerr << "Unknown algorithm type '" << algo_type.c_str() << "'." << endl; |
| 132 | return ILLEGAL_PARAMETERS; |
| 133 | } |
| 134 | |
| 135 | //annotate output with data processing info and save output file |
| 136 | addDataProcessing_(map, getProcessingInfo_(DataProcessing::NORMALIZATION)); |
| 137 | infile.store(out, map); |
| 138 | |
| 139 | return EXECUTION_OK; |
| 140 | } |
| 141 | }; |
| 142 | |
| 143 |
nothing calls this directly
no test coverage detected