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

Method fromFeatureMap

src/openms/source/METADATA/ExperimentalDesign.cpp:168–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 10

addSampleMethod · 0.80
setMSFileSectionMethod · 0.80
setSampleSectionMethod · 0.80
getNumberOfMSFilesMethod · 0.80
getNumberOfFractionsMethod · 0.80
getNumberOfLabelsMethod · 0.80
getNumberOfSamplesMethod · 0.80
StringClass · 0.50
getPrimaryMSRunPathMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected