| 166 | } |
| 167 | |
| 168 | ExperimentalDesign ExperimentalDesign::fromFeatureMap(const FeatureMap &fm) |
| 169 | { |
| 170 | ExperimentalDesign experimental_design; |
| 171 | // path of the original MS run (mzML / raw file) |
| 172 | StringList ms_paths; |
| 173 | fm.getPrimaryMSRunPath(ms_paths); |
| 174 | |
| 175 | if (ms_paths.size() != 1) |
| 176 | { |
| 177 | throw Exception::MissingInformation( |
| 178 | __FILE__, |
| 179 | __LINE__, |
| 180 | OPENMS_PRETTY_FUNCTION, |
| 181 | "FeatureMap annotated with " + String(ms_paths.size()) + " MS files. Must be exactly one."); |
| 182 | } |
| 183 | |
| 184 | // Feature map is simple. One file, one fraction, one sample, one fraction_group |
| 185 | ExperimentalDesign::MSFileSectionEntry r; |
| 186 | r.path = ms_paths[0]; |
| 187 | r.fraction = 1; |
| 188 | r.sample = 0; |
| 189 | r.sample_name = "0"; |
| 190 | r.fraction_group = 1; |
| 191 | r.label = 1; |
| 192 | |
| 193 | ExperimentalDesign::MSFileSection rows(1, r); |
| 194 | |
| 195 | ExperimentalDesign::SampleSection s; |
| 196 | s.addSample(r.sample_name); |
| 197 | |
| 198 | experimental_design.setMSFileSection(rows); |
| 199 | experimental_design.setSampleSection(s); |
| 200 | |
| 201 | OPENMS_LOG_INFO << "Experimental design (FeatureMap derived):\n" |
| 202 | << " files: " << experimental_design.getNumberOfMSFiles() |
| 203 | << " fractions: " << experimental_design.getNumberOfFractions() |
| 204 | << " labels: " << experimental_design.getNumberOfLabels() |
| 205 | << " samples: " << experimental_design.getNumberOfSamples() << "\n" |
| 206 | << endl; |
| 207 | return experimental_design; |
| 208 | } |
| 209 | |
| 210 | ExperimentalDesign ExperimentalDesign::fromIdentifications(const vector <ProteinIdentification> &proteins) |
| 211 | { |
nothing calls this directly
no test coverage detected