public static List <CV> trans(CVParamList paramList) { List <CV> cvList = new List <CV>(); foreach (var cvParam in paramList) { cvList.Add(new CV(cvParam)); } return(cvList); }
public static List <CV> trans(Spectrum spectrum) { List <CV> cvList = new List <CV>(); CVParamList cvParamList = spectrum.cvParams; foreach (var cvParam in cvParamList) { cvList.Add(new CV(cvParam)); } return(cvList); }
public void populateFromMSData(MSData msInfo) { hasDetails = true; spectra = msInfo.run.spectrumList == null ? 0 : msInfo.run.spectrumList.size(); ionSource = analyzer = detector = ""; foreach (InstrumentConfiguration ic in msInfo.instrumentConfigurationList) { SortedDictionary <int, string> ionSources = new SortedDictionary <int, string>(); SortedDictionary <int, string> analyzers = new SortedDictionary <int, string>(); SortedDictionary <int, string> detectors = new SortedDictionary <int, string>(); foreach (pwiz.CLI.msdata.Component c in ic.componentList) { CVParam term; switch (c.type) { case ComponentType.ComponentType_Source: term = c.cvParamChild(CVID.MS_ionization_type); if (!term.empty()) { ionSources.Add(c.order, term.name); } break; case ComponentType.ComponentType_Analyzer: term = c.cvParamChild(CVID.MS_mass_analyzer_type); if (!term.empty()) { analyzers.Add(c.order, term.name); } break; case ComponentType.ComponentType_Detector: term = c.cvParamChild(CVID.MS_detector_type); if (!term.empty()) { detectors.Add(c.order, term.name); } break; } } if (ionSource.Length > 0) { ionSource += ", "; } ionSource += String.Join("/", new List <string>(ionSources.Values).ToArray()); if (analyzer.Length > 0) { analyzer += ", "; } analyzer += String.Join("/", new List <string>(analyzers.Values).ToArray()); if (detector.Length > 0) { detector += ", "; } detector += String.Join("/", new List <string>(detectors.Values).ToArray()); } System.Collections.Generic.Set <string> contentTypes = new System.Collections.Generic.Set <string>(); CVParamList cvParams = msInfo.fileDescription.fileContent.cvParams; if (cvParams.Count > 0) { foreach (CVParam term in msInfo.fileDescription.fileContent.cvParams) { contentTypes.Add(term.name); } contentType = String.Join(", ", new List <string>(contentTypes.Keys).ToArray()); } }