Esempio n. 1
0
 private bool Equals(GroupComparisonDef other)
 {
     return(base.Equals(other) &&
            string.Equals(ControlAnnotation, other.ControlAnnotation) &&
            string.Equals(ControlValue, other.ControlValue) &&
            string.Equals(CaseValue, other.CaseValue) &&
            string.Equals(IdentityAnnotation, other.IdentityAnnotation) &&
            AverageTechnicalReplicates.Equals(other.AverageTechnicalReplicates) &&
            SumTransitions.Equals(other.SumTransitions) &&
            Equals(NormalizationMethod, other.NormalizationMethod) &&
            IncludeInteractionTransitions.Equals(other.IncludeInteractionTransitions) &&
            Equals(SummarizationMethod, other.SummarizationMethod) &&
            Equals(ConfidenceLevel, other.ConfidenceLevel) &&
            Equals(PerProtein, other.PerProtein));
 }
Esempio n. 2
0
        public GroupComparer(GroupComparisonDef comparisonDef, SrmDocument document, QrFactorizationCache qrFactorizationCache)
        {
            SrmDocument   = document;
            ComparisonDef = comparisonDef;
            var annotationCalculator = new AnnotationCalculator(document);

            _qrFactorizationCache = qrFactorizationCache;
            List <KeyValuePair <int, ReplicateDetails> > replicateIndexes = new List <KeyValuePair <int, ReplicateDetails> >();
            var controlGroupIdentifier = ComparisonDef.GetControlGroupIdentifier(SrmDocument.Settings);

            if (SrmDocument.Settings.HasResults)
            {
                var chromatograms = SrmDocument.Settings.MeasuredResults.Chromatograms;
                for (int i = 0; i < chromatograms.Count; i++)
                {
                    var chromatogramSet = chromatograms[i];
                    ReplicateDetails replicateDetails = new ReplicateDetails()
                    {
                        GroupIdentifier = comparisonDef.GetGroupIdentifier(annotationCalculator, chromatogramSet)
                    };
                    if (Equals(controlGroupIdentifier, replicateDetails.GroupIdentifier))
                    {
                        replicateDetails.IsControl = true;
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(ComparisonDef.CaseValue))
                        {
                            var annotationValue = chromatogramSet.Annotations.GetAnnotation(ComparisonDef.ControlAnnotation);
                            if (!Equals(annotationValue, ComparisonDef.CaseValue))
                            {
                                continue;
                            }
                        }
                    }
                    if (null != ComparisonDef.IdentityAnnotation)
                    {
                        replicateDetails.BioReplicate =
                            chromatogramSet.Annotations.GetAnnotation(ComparisonDef.IdentityAnnotation);
                    }
                    replicateIndexes.Add(new KeyValuePair <int, ReplicateDetails>(i, replicateDetails));
                }
            }
            _replicateIndexes = ImmutableList.ValueOf(replicateIndexes);
            IsValid           = _replicateIndexes.Any(keyValuePair => keyValuePair.Value.IsControl) &&
                                _replicateIndexes.Any(keyValuePair => !keyValuePair.Value.IsControl);
        }
Esempio n. 3
0
 private bool Equals(GroupComparisonDef other)
 {
     return(base.Equals(other) &&
            string.Equals(ControlAnnotation, other.ControlAnnotation) &&
            string.Equals(ControlValue, other.ControlValue) &&
            string.Equals(CaseValue, other.CaseValue) &&
            string.Equals(IdentityAnnotation, other.IdentityAnnotation) &&
            AverageTechnicalReplicates == other.AverageTechnicalReplicates &&
            Equals(NormalizationMethod, other.NormalizationMethod) &&
            IncludeInteractionTransitions == other.IncludeInteractionTransitions &&
            Equals(SummarizationMethod, other.SummarizationMethod) &&
            ConfidenceLevelTimes100.Equals(other.ConfidenceLevelTimes100) &&
            PerProtein == other.PerProtein &&
            UseZeroForMissingPeaks == other.UseZeroForMissingPeaks &&
            QValueCutoff.Equals(other.QValueCutoff) &&
            ColorRows.SequenceEqual(other.ColorRows));
 }
Esempio n. 4
0
        public SrmDocument ApplyChangesToDocument(SrmDocument doc, GroupComparisonDef groupDef)
        {
            var groupComparisons = doc.Settings.DataSettings.GroupComparisonDefs.ToList();
            int index            = groupComparisons.FindIndex(def => def.Name == GroupComparisonName);

            if (index < 0 || Equals(groupDef, groupComparisons[index]))
            {
                return(doc);
            }

            groupComparisons[index] = groupDef;
            doc =
                doc.ChangeSettings(
                    doc.Settings.ChangeDataSettings(
                        doc.Settings.DataSettings.ChangeGroupComparisonDefs(groupComparisons)));
            return(doc);
        }
 public EditGroupComparisonDlg(IDocumentContainer documentContainer,
     GroupComparisonDef groupComparisonDef, IEnumerable<GroupComparisonDef> existingGroupComparisons)
     : base(new GroupComparisonModel(documentContainer, null) { GroupComparisonDef = groupComparisonDef})
 {
     InitializeComponent();
     Icon = Resources.Skyline;
     _originalGroupComparisonDef = groupComparisonDef;
     _existingGroupComparisons = existingGroupComparisons;
     if (documentContainer == null)
     {
         btnPreview.Visible = false;
     }
     tbxName.Text = groupComparisonDef.Name ?? string.Empty;
     tbxConfidenceLevel.TextChanged += tbxConfidenceLevel_TextChanged;
     comboControlAnnotation.SelectedIndexChanged += comboControlAnnotation_SelectedIndexChanged;
     comboCaseValue.SelectedIndexChanged += comboCaseValue_SelectedIndexChanged;
     comboControlValue.SelectedIndexChanged += comboControlValue_SelectedIndexChanged;
     comboIdentityAnnotation.SelectedIndexChanged += comboIdentityAnnotation_SelectedIndexChanged;
     comboNormalizationMethod.SelectedIndexChanged += comboNormalizationMethod_SelectedIndexChanged;
     radioScopeProtein.CheckedChanged += radioScope_CheckedChanged;
     radioScopePeptide.CheckedChanged += radioScope_CheckedChanged;
 }
Esempio n. 6
0
 private bool Equals(GroupComparisonDef other)
 {
     return base.Equals(other) &&
            string.Equals(ControlAnnotation, other.ControlAnnotation) &&
            string.Equals(ControlValue, other.ControlValue) &&
            string.Equals(CaseValue, other.CaseValue) &&
            string.Equals(IdentityAnnotation, other.IdentityAnnotation) &&
            AverageTechnicalReplicates.Equals(other.AverageTechnicalReplicates) &&
            SumTransitions.Equals(other.SumTransitions) &&
            Equals(NormalizationMethod, other.NormalizationMethod) &&
            IncludeInteractionTransitions.Equals(other.IncludeInteractionTransitions) &&
            Equals(SummarizationMethod, other.SummarizationMethod) &&
            Equals(ConfidenceLevel, other.ConfidenceLevel) &&
            Equals(PerProtein, other.PerProtein);
 }
Esempio n. 7
0
 public DataSettings AddGroupComparisonDef(GroupComparisonDef groupComparisonDef)
 {
     var groupComparisonDefs = GroupComparisonDefs.ToList();
     int index = GroupComparisonDefs.IndexOf(def => def.Name == groupComparisonDef.Name);
     if (index < 0)
     {
         groupComparisonDefs.Add(groupComparisonDef);
     }
     else
     {
         groupComparisonDefs[index] = groupComparisonDef;
     }
     return ChangeGroupComparisonDefs(groupComparisonDefs);
 }