Exemple #1
0
        public IEnumerable <SkylineDocumentProto.Types.TransitionPeak> GetTransitionPeakProtos(MeasuredResults measuredResults)
        {
            if (Results == null)
            {
                yield break;
            }
            for (int replicateIndex = 0; replicateIndex < Results.Count; replicateIndex++)
            {
                var replicateResults = Results[replicateIndex];
                if (replicateResults.IsEmpty)
                {
                    continue;
                }
                foreach (var transitionChromInfo in replicateResults)
                {
                    if (transitionChromInfo == null)
                    {
                        continue;
                    }
                    var transitionPeak = new SkylineDocumentProto.Types.TransitionPeak();
                    transitionPeak.OptimizationStep = transitionChromInfo.OptimizationStep;
                    if (null != transitionChromInfo.Annotations)
                    {
                        transitionPeak.Annotations = transitionChromInfo.Annotations.ToProtoAnnotations();
                    }
                    transitionPeak.ReplicateIndex       = replicateIndex;
                    transitionPeak.FileIndexInReplicate = measuredResults.Chromatograms[replicateIndex].IndexOfId(transitionChromInfo.FileId);
                    transitionPeak.MassError            = DataValues.ToOptional(transitionChromInfo.MassError);
                    transitionPeak.RetentionTime        = transitionChromInfo.RetentionTime;
                    transitionPeak.StartRetentionTime   = transitionChromInfo.StartRetentionTime;
                    transitionPeak.EndRetentionTime     = transitionChromInfo.EndRetentionTime;
                    transitionPeak.IonMobility          = DataValues.ToOptional(transitionChromInfo.IonMobility.IonMobility.Mobility);
                    transitionPeak.IonMobilityWindow    = DataValues.ToOptional(transitionChromInfo.IonMobility.IonMobilityExtractionWindowWidth);
                    transitionPeak.Area              = transitionChromInfo.Area;
                    transitionPeak.BackgroundArea    = transitionChromInfo.BackgroundArea;
                    transitionPeak.Height            = transitionChromInfo.Height;
                    transitionPeak.Fwhm              = transitionChromInfo.Fwhm;
                    transitionPeak.IsFwhmDegenerate  = transitionChromInfo.IsFwhmDegenerate;
                    transitionPeak.Truncated         = DataValues.ToOptional(transitionChromInfo.IsTruncated);
                    transitionPeak.UserSet           = DataValues.ToUserSet(transitionChromInfo.UserSet);
                    transitionPeak.ForcedIntegration = transitionChromInfo.IsForcedIntegration;
                    switch (transitionChromInfo.Identified)
                    {
                    case PeakIdentification.ALIGNED:
                        transitionPeak.Identified = SkylineDocumentProto.Types.PeakIdentification.Aligned;
                        break;

                    case PeakIdentification.FALSE:
                        transitionPeak.Identified = SkylineDocumentProto.Types.PeakIdentification.False;
                        break;

                    case PeakIdentification.TRUE:
                        transitionPeak.Identified = SkylineDocumentProto.Types.PeakIdentification.True;
                        break;
                    }
                    transitionPeak.Rank             = transitionChromInfo.Rank;
                    transitionPeak.RankByLevel      = transitionChromInfo.RankByLevel;
                    transitionPeak.PointsAcrossPeak = DataValues.ToOptional(transitionChromInfo.PointsAcrossPeak);
                    yield return(transitionPeak);
                }
            }
        }