Пример #1
0
        public static SrmDocument ApplyPeak(SrmDocument doc, PeptideTreeNode nodePepTree, TransitionGroupDocNode nodeTranGroup,
            int resultsIndex, int? resultsFile, bool subsequent, ILongWaitBroker longWaitBroker)
        {
            nodeTranGroup = nodeTranGroup ?? PickTransitionGroup(doc, nodePepTree, resultsIndex);

            PeakMatchData referenceTarget;
            PeakMatchData[] referenceMatchData;
            DateTime? runTime;
            GetReferenceData(doc, nodePepTree.DocNode, nodeTranGroup, resultsIndex, resultsFile, out referenceTarget, out referenceMatchData, out runTime);

            var chromatograms = doc.Settings.MeasuredResults.Chromatograms;
            for (int i = 0; i < chromatograms.Count; i++)
            {
                var chromSet = chromatograms[i];
                for (int j = 0; j < chromSet.MSDataFileInfos.Count; j++)
                {
                    var fileInfo = chromSet.MSDataFileInfos[j];
                    if ((i == resultsIndex && (!resultsFile.HasValue || resultsFile.Value == j)) ||
                        (subsequent && runTime != null && fileInfo.RunStartTime < runTime))
                    {
                        continue;
                    }

                    var bestMatch = GetPeakMatch(doc, chromSet, fileInfo, nodeTranGroup, referenceTarget, referenceMatchData);
                    if (bestMatch != null)
                        doc = bestMatch.ChangePeak(doc, nodePepTree, nodeTranGroup, chromSet.Name, fileInfo.FilePath);
                }
                longWaitBroker.SetProgressCheckCancel(i + 1, chromatograms.Count);
            }
            return doc;
        }
Пример #2
0
        public static SrmDocument ApplyPeak(SrmDocument doc, PeptideTreeNode nodePepTree, ref TransitionGroupDocNode nodeTranGroup,
                                            int resultsIndex, ChromFileInfoId resultsFile, bool subsequent, ReplicateValue groupBy, object groupByValue, ILongWaitBroker longWaitBroker)
        {
            nodeTranGroup = nodeTranGroup ?? PickTransitionGroup(doc, nodePepTree, resultsIndex);
            GetReferenceData(doc, nodePepTree.DocNode, nodeTranGroup, resultsIndex, resultsFile, out var referenceTarget, out var referenceMatchData, out var runTime);

            var annotationCalculator = new AnnotationCalculator(doc);
            var chromatograms        = doc.Settings.MeasuredResults.Chromatograms;

            for (var i = 0; i < chromatograms.Count; i++)
            {
                var chromSet = chromatograms[i];

                if (groupBy != null)
                {
                    if (!Equals(groupByValue, groupBy.GetValue(annotationCalculator, chromSet)))
                    {
                        continue;
                    }
                }

                for (var j = 0; j < chromSet.MSDataFileInfos.Count; j++)
                {
                    var fileInfo = chromSet.MSDataFileInfos[j];
                    if ((i == resultsIndex && (resultsFile == null || ReferenceEquals(resultsFile, fileInfo.FileId))) ||
                        (subsequent && runTime != null && fileInfo.RunStartTime < runTime))
                    {
                        continue;
                    }

                    var bestMatch = GetPeakMatch(doc, chromSet, fileInfo, nodeTranGroup, referenceTarget, referenceMatchData);
                    if (bestMatch != null)
                    {
                        doc = bestMatch.ChangePeak(doc, nodePepTree, nodeTranGroup, chromSet.Name, fileInfo.FilePath);
                    }
                }
                longWaitBroker.SetProgressCheckCancel(i + 1, chromatograms.Count);
            }
            return(doc);
        }
Пример #3
0
        public static SrmDocument ApplyPeak(SrmDocument doc, PeptideTreeNode nodePepTree, ref TransitionGroupDocNode nodeTranGroup,
                                            int resultsIndex, int?resultsFile, bool subsequent, ILongWaitBroker longWaitBroker)
        {
            nodeTranGroup = nodeTranGroup ?? PickTransitionGroup(doc, nodePepTree, resultsIndex);

            PeakMatchData referenceTarget;

            PeakMatchData[] referenceMatchData;
            DateTime?       runTime;

            GetReferenceData(doc, nodePepTree.DocNode, nodeTranGroup, resultsIndex, resultsFile, out referenceTarget, out referenceMatchData, out runTime);

            var chromatograms = doc.Settings.MeasuredResults.Chromatograms;

            for (int i = 0; i < chromatograms.Count; i++)
            {
                var chromSet = chromatograms[i];
                for (int j = 0; j < chromSet.MSDataFileInfos.Count; j++)
                {
                    var fileInfo = chromSet.MSDataFileInfos[j];
                    if ((i == resultsIndex && (!resultsFile.HasValue || resultsFile.Value == j)) ||
                        (subsequent && runTime != null && fileInfo.RunStartTime < runTime))
                    {
                        continue;
                    }

                    var bestMatch = GetPeakMatch(doc, chromSet, fileInfo, nodeTranGroup, referenceTarget, referenceMatchData);
                    if (bestMatch != null)
                    {
                        doc = bestMatch.ChangePeak(doc, nodePepTree, nodeTranGroup, chromSet.Name, fileInfo.FilePath);
                    }
                }
                longWaitBroker.SetProgressCheckCancel(i + 1, chromatograms.Count);
            }
            return(doc);
        }