private static bool DisplayTypeMatches(LibraryChromGroup.ChromData chromData, DisplayTypeChrom displayType) { switch (displayType) { case DisplayTypeChrom.products: return(chromData.IonType != IonType.precursor); case DisplayTypeChrom.precursors: return(chromData.IonType == IonType.precursor); default: return(true); } }
private static bool IonMatches(Transition transition, LibraryChromGroup.ChromData chromData) { if (transition.IonType.Equals(chromData.IonType) && transition.Charge == chromData.Charge) { if (transition.IsPrecursor()) { return(transition.MassIndex == chromData.MassIndex); } else { return(transition.Ordinal == chromData.Ordinal); } } return(false); }
public static void MakeChromatogramInfo(SignedMz precursorMz, LibraryChromGroup chromGroup, LibraryChromGroup.ChromData chromData, out ChromatogramInfo chromatogramInfo, out TransitionChromInfo transitionChromInfo) { var timeIntensities = new TimeIntensities(chromGroup.Times, chromData.Intensities, null, null); var crawPeakFinder = Crawdads.NewCrawdadPeakFinder(); crawPeakFinder.SetChromatogram(chromGroup.Times, chromData.Intensities); var crawdadPeak = crawPeakFinder.GetPeak( FindNearestIndex(chromGroup.Times, (float)chromGroup.StartTime), FindNearestIndex(chromGroup.Times, (float)chromGroup.EndTime)); var chromPeak = new ChromPeak(crawPeakFinder, crawdadPeak, 0, timeIntensities, null); transitionChromInfo = new TransitionChromInfo(null, 0, chromPeak, IonMobilityFilter.EMPTY, // CONSIDER(bspratt) IMS in chromatogram libraries? new float?[0], Annotations.EMPTY, UserSet.FALSE); var peaks = new[] { chromPeak }; var header = new ChromGroupHeaderInfo(precursorMz, 0, // file index 1, // numTransitions 0, // startTransitionIndex peaks.Length, // numPeaks 0, // startPeakIndex 0, // startscoreindex 0, // maxPeakIndex chromGroup.Times.Length, // numPoints 0, // compressedSize 0, // uncompressedsize 0, //location 0, -1, -1, null, null, null, eIonMobilityUnits.none); // CONSIDER(bspratt) IMS in chromatogram libraries? var driftTimeFilter = IonMobilityFilter.EMPTY; // CONSIDER(bspratt) IMS in chromatogram libraries? var groupInfo = new ChromatogramGroupInfo(header, new Dictionary <Type, int>(), new ChromCachedFile[0], new[] { new ChromTransition(chromData.Mz, 0, (float)(driftTimeFilter.IonMobility.Mobility ?? 0), (float)(driftTimeFilter.IonMobilityExtractionWindowWidth ?? 0), ChromSource.unknown), }, peaks, null) { TimeIntensitiesGroup = TimeIntensitiesGroup.Singleton(timeIntensities) }; chromatogramInfo = new ChromatogramInfo(groupInfo, 0); }
public static void MakeChromatogramInfo(SignedMz precursorMz, LibraryChromGroup chromGroup, LibraryChromGroup.ChromData chromData, out ChromatogramInfo chromatogramInfo, out TransitionChromInfo transitionChromInfo) { var crawPeakFinder = Crawdads.NewCrawdadPeakFinder(); crawPeakFinder.SetChromatogram(chromGroup.Times, chromData.Intensities); var crawdadPeak = crawPeakFinder.GetPeak( FindNearestIndex(chromGroup.Times, (float)chromGroup.StartTime), FindNearestIndex(chromGroup.Times, (float)chromGroup.EndTime)); var chromPeak = new ChromPeak(crawPeakFinder, crawdadPeak, 0, chromGroup.Times, chromData.Intensities, null); transitionChromInfo = new TransitionChromInfo(null, 0, chromPeak, new float?[0], Annotations.EMPTY, UserSet.FALSE); var peaks = new[] { chromPeak }; var header = new ChromGroupHeaderInfo(precursorMz, 0, // file index 1, // numTransitions 0, // startTransitionIndex peaks.Length, // numPeaks 0, // startPeakIndex 0, // startscoreindex 0, // maxPeakIndex chromGroup.Times.Length, // numPoints 0, // compressedSize 0, // uncompressedsize 0, //location 0, -1, -1, null, null); chromatogramInfo = new ChromatogramInfo(header, new Dictionary <Type, int>(), 0, new ChromCachedFile[0], new[] { new ChromTransition(chromData.Mz, 0, 0, 0, ChromSource.unknown), }, peaks, null, chromGroup.Times, new[] { chromData.Intensities }, null, null); }
public static void MakeChromatogramInfo(double precursorMz, LibraryChromGroup chromGroup, LibraryChromGroup.ChromData chromData, out ChromatogramInfo chromatogramInfo, out TransitionChromInfo transitionChromInfo) { var crawPeakFinder = new CrawdadPeakFinder(); crawPeakFinder.SetChromatogram(chromGroup.Times, chromData.Intensities); var crawdadPeak = crawPeakFinder.GetPeak( FindNearestIndex(chromGroup.Times, (float)chromGroup.StartTime), FindNearestIndex(chromGroup.Times, (float)chromGroup.EndTime)); var chromPeak = new ChromPeak(crawPeakFinder, crawdadPeak, 0, chromGroup.Times, chromData.Intensities, null); transitionChromInfo = new TransitionChromInfo(null, 0, chromPeak, new float?[0], Annotations.EMPTY, UserSet.FALSE); var peaks = new[] { chromPeak }; var header = new ChromGroupHeaderInfo5(new ChromGroupHeaderInfo( (float)precursorMz, 0, 1, 0, peaks.Length, 0, 0, chromGroup.Times.Length, 0, 0)); chromatogramInfo = new ChromatogramInfo(header, new Dictionary <Type, int>(), 0, new ChromCachedFile[0], new[] { new ChromTransition(chromData.Mz, 0, 0, 0, ChromSource.unknown), }, peaks, null, chromGroup.Times, new[] { chromData.Intensities }, null, null); }