public void CompareAveragingWithMSstats()
        {
            var srmDocument       = LoadRatPlasmaDocument();
            var documentContainer = new MemoryDocumentContainer();

            documentContainer.SetDocument(documentContainer.Document, srmDocument);
            GroupComparisonModel model = new GroupComparisonModel(documentContainer, null);

            model.GroupComparisonDef = GroupComparisonDef.EMPTY.ChangeControlAnnotation("Condition")
                                       .ChangeControlValue("Healthy")
                                       .ChangeIdentityAnnotation("BioReplicate")
                                       .ChangeSummarizationMethod(SummarizationMethod.AVERAGING)
                                       .ChangePerProtein(false);
            var expectedValues = MsStatsTestUtil.ReadExpectedResults(typeof(MSstatsAveragingTest),
                                                                     "RatPlasmaTestingResult.csv");
            var groupComparer = new GroupComparer(model.GroupComparisonDef, srmDocument, new QrFactorizationCache());

            foreach (var protein in srmDocument.PeptideGroups)
            {
                foreach (var peptide in protein.Peptides)
                {
                    var result         = groupComparer.CalculateFoldChange(new GroupComparisonSelector(protein, peptide, IsotopeLabelType.light, null, new GroupIdentifier("Diseased")), null);
                    var expectedResult = expectedValues[peptide.Peptide.Sequence];
                    Assert.AreEqual(expectedResult.EstimatedValue, result.LinearFitResult.EstimatedValue,
                                    (expectedResult.StandardError + result.LinearFitResult.StandardError) * 2, peptide.Peptide.Sequence);
                }
            }
        }
예제 #2
0
        public void TestFoldChangeWithNoNormalization()
        {
            SrmDocument testDocument    = OpenTestDocument();
            var         expectedResults = MsStatsTestUtil.ReadExpectedResults(typeof(MsStatsNormalizationTest),
                                                                              "BrudererSubsetNoNormalization_TestingResult.csv");
            GroupComparisonDef groupComparisonDef = new GroupComparisonDef("test")
                                                    .ChangeControlValue("S2")
                                                    .ChangeCaseValue("S1")
                                                    .ChangeControlAnnotation("Condition")
                                                    .ChangeIdentityAnnotation("BioReplicate")
                                                    .ChangePerProtein(true)
                                                    .ChangeNormalizationMethod(NormalizationMethod.NONE);

            VerifyFoldChanges(testDocument, groupComparisonDef, expectedResults);
        }
예제 #3
0
        public void RunTestFoldChangeEqualizeMedians(bool asSmallMolecules)
        {
            SrmDocument testDocument = OpenTestDocument();

            if (testDocument == null)
            {
                Assume.IsTrue(asSmallMolecules);
                return;
            }
            var expectedResults = MsStatsTestUtil.ReadExpectedResults(typeof(MsStatsNormalizationTest),
                                                                      "BrudererSubsetEqualizeMedians_TestingResult.csv");
            GroupComparisonDef groupComparisonDef = new GroupComparisonDef("test")
                                                    .ChangeControlValue("S2")
                                                    .ChangeCaseValue("S1")
                                                    .ChangeControlAnnotation("Condition")
                                                    .ChangeIdentityAnnotation("BioReplicate")
                                                    .ChangePerProtein(true)
                                                    .ChangeNormalizationMethod(NormalizationMethod.EQUALIZE_MEDIANS);

            VerifyFoldChanges(testDocument, groupComparisonDef, expectedResults);
        }