Exemplo n.º 1
0
 public PrecursorTextId(SignedMz precursorMz, IonMobilityFilter ionMobilityFilter, Target target, ChromExtractor extractor) : this()
 {
     PrecursorMz = precursorMz;
     IonMobility = ionMobilityFilter ?? IonMobilityFilter.EMPTY;
     Target      = target;
     Extractor   = extractor;
 }
Exemplo n.º 2
0
        private static string GetExtractorName(ChromExtractor extractor)
        {
            switch (extractor)
            {
            case ChromExtractor.base_peak:
                return("BasePeak");    // Not L10N

            case ChromExtractor.summed:
                return("Summed");    // Not L10N

            default:
                throw new InvalidDataException(Resources.ChromatogramExporter_GetExtractorName_Invalid_extractor_name_);
            }
        }
Exemplo n.º 3
0
 public ExtractedSpectrum(Target target,
                          Color peptideColor,
                          SignedMz precursorMz,
                          IonMobilityFilter ionMobility,
                          ChromExtractor chromExtractor,
                          int filterIndex,
                          SpectrumProductFilter[] productFilters,
                          float[] intensities,
                          float[] massErrors)
 {
     Target         = target;
     PeptideColor   = peptideColor;
     PrecursorMz    = precursorMz;
     IonMobility    = ionMobility;
     Extractor      = chromExtractor;
     FilterIndex    = filterIndex;
     ProductFilters = productFilters;
     Intensities    = intensities;
     MassErrors     = massErrors;
 }
Exemplo n.º 4
0
 public ExtractedSpectrum(string textId,
     Color peptideColor,
     double precursorMz,
     double ionMobilityValue,
     double ionMobilityExtractionWidth,
     ChromExtractor chromExtractor,
     int filterIndex,
     SpectrumProductFilter[] productFilters,
     float[] intensities,
     float[] massErrors)
 {
     TextId = textId;
     PeptideColor = peptideColor;
     PrecursorMz = precursorMz;
     IonMobilityValue = ionMobilityValue;
     IonMobilityExtractionWidth = ionMobilityExtractionWidth;
     Extractor = chromExtractor;
     FilterIndex = filterIndex;
     ProductFilters = productFilters;
     Intensities = intensities;
     MassErrors = massErrors;
 }
Exemplo n.º 5
0
 public ExtractedSpectrum(string textId,
                          Color peptideColor,
                          double precursorMz,
                          double ionMobilityValue,
                          double ionMobilityExtractionWidth,
                          ChromExtractor chromExtractor,
                          int filterIndex,
                          SpectrumProductFilter[] productFilters,
                          float[] intensities,
                          float[] massErrors)
 {
     TextId                     = textId;
     PeptideColor               = peptideColor;
     PrecursorMz                = precursorMz;
     IonMobilityValue           = ionMobilityValue;
     IonMobilityExtractionWidth = ionMobilityExtractionWidth;
     Extractor                  = chromExtractor;
     FilterIndex                = filterIndex;
     ProductFilters             = productFilters;
     Intensities                = intensities;
     MassErrors                 = massErrors;
 }
Exemplo n.º 6
0
 private static string GetExtractorName(ChromExtractor extractor)
 {
     switch (extractor)
     {
         case ChromExtractor.base_peak:
             return "BasePeak"; // Not L10N
         case ChromExtractor.summed:
             return "Summed"; // Not L10N
         default:
             throw new InvalidDataException(Resources.ChromatogramExporter_GetExtractorName_Invalid_extractor_name_);
     }
 }
Exemplo n.º 7
0
 public PrecursorTextId(SignedMz precursorMz, string textId, ChromExtractor extractor) : this()
 {
     PrecursorMz = precursorMz;
     TextId      = textId;
     Extractor   = extractor;
 }
Exemplo n.º 8
0
        private bool EnsureChromInfo(MeasuredResults results,
            ChromatogramSet chromatograms,
            TransitionGroupDocNode[] nodeGroups,
            IdentityPath[] groupPaths,
            ChromExtractor extractor,
            out bool changedGroups,
            out bool changedGroupIds)
        {
            if (UpdateGroups(nodeGroups, groupPaths, out changedGroups, out changedGroupIds) && _extractor == extractor)
                return true;

            _extractor = extractor;

            bool success = false;
            try
            {
                // Get chromatogram sets for all transition groups, recording unique
                // file paths in the process.
                var listArrayChromInfo = new List<ChromatogramGroupInfo[]>();
                var listFiles = new List<MsDataFileUri>();
                ChromatogramGroupInfo[] arrayAllIonsChromInfo;
                if (!results.TryLoadAllIonsChromatogram(chromatograms, extractor, true,
                                                        out arrayAllIonsChromInfo))
                {
                    return false;
                }
                else
                {
                    listArrayChromInfo.Add(arrayAllIonsChromInfo);
                    foreach (var chromInfo in arrayAllIonsChromInfo)
                    {
                        var filePath = chromInfo.FilePath;
                        if (!listFiles.Contains(filePath))
                            listFiles.Add(filePath);
                    }
                }

                _hasMergedChromInfo = false;
                _arrayChromInfo = new ChromatogramGroupInfo[listFiles.Count][];
                for (int i = 0; i < _arrayChromInfo.Length; i++)
                {
                    var arrayNew = new ChromatogramGroupInfo[listArrayChromInfo.Count];
                    for (int j = 0; j < arrayNew.Length; j++)
                    {
                        var arrayChromInfo = listArrayChromInfo[j];
                        if (arrayChromInfo == null)
                            continue;
                        foreach (var chromInfo in arrayChromInfo)
                        {
                            if (arrayNew[j] == null && Equals(listFiles[i], chromInfo.FilePath))
                                arrayNew[j] = chromInfo;
                        }
                    }
                    _arrayChromInfo[i] = arrayNew;
                }

                success = true;
            }
            finally
            {
                // Make sure the info array is set to null on failure.
                if (!success)
                    _arrayChromInfo = null;
            }

            return true;
        }
Exemplo n.º 9
0
        private void DisplayAllIonsSummary(IRegressionFunction timeRegressionFunction,
            TransitionDocNode nodeTranSelected,
            ChromatogramSet chromatograms,
            ChromExtractor extractor,
            ref double bestStartTime,
            ref double bestEndTime)
        {
            if (ChromGroupInfos.Length == 0)
            {
                return;
            }
            var chromGroupInfo = ChromGroupInfos[0];
            var info = chromGroupInfo.GetTransitionInfo(0, 0);
            var fileId = chromatograms.FindFile(chromGroupInfo);

            var nodeGroup = _nodeGroups != null ? _nodeGroups[0] : null;
            if (nodeGroup == null)
                nodeTranSelected = null;

            TransitionChromInfo tranPeakInfo = null;
            if (nodeGroup != null)
            {
                float maxPeakHeight = float.MinValue;
                foreach (TransitionDocNode nodeTran in nodeGroup.Children)
                {
                    // Keep track of which chromatogram owns the tallest member of
                    // the peak on the document tree.
                    var transitionChromInfo = GetTransitionChromInfo(nodeTran, _chromIndex, fileId, 0);
                    if (transitionChromInfo == null)
                        continue;

                    if (nodeTranSelected != null)
                    {
                        if (ReferenceEquals(nodeTran, nodeTranSelected))
                            tranPeakInfo = transitionChromInfo;
                    }
                    else if (transitionChromInfo.Height > maxPeakHeight)
                    {
                        maxPeakHeight = transitionChromInfo.Height;
                        tranPeakInfo = transitionChromInfo;
                    }

                    // Adjust best peak window used to zoom the graph to the best peak
                    AddBestPeakTimes(transitionChromInfo, ref bestStartTime, ref bestEndTime);
                }
            }

            // Apply active transform
            info.Transform(Transform);

            int numPeaks = info.NumPeaks;
            var annotationFlags = new bool[numPeaks];
            for (int i = 0; i < numPeaks; i++)
            {
                // Exclude any peaks between the boundaries of the chosen peak.
                annotationFlags[i] = !IntersectPeaks(info.GetPeak(i), tranPeakInfo);
            }
            var graphItem = new ChromGraphItem(nodeGroup,
                                               nodeTranSelected,
                                               info,
                                               tranPeakInfo,
                                               timeRegressionFunction,
                                               annotationFlags,
                                               null,
                                               0,
                                               true,
                                               true,
                                               0,
                                               COLORS_GROUPS[(int)extractor],
                                               FontSize,
                                               LineWidth);
            _graphHelper.AddChromatogram(new PaneKey(nodeGroup), graphItem);
        }
Exemplo n.º 10
0
 public PrecursorTextId(SignedMz precursorMz, Target target, ChromExtractor extractor) : this()
 {
     PrecursorMz = precursorMz;
     Target      = target;
     Extractor   = extractor;
 }