コード例 #1
0
        public void MQuestReferenceDetailScoreTest()
        {
            var peakData1          = new MockTranPeakData <IDetailedPeakData>(INTENS1, IonType.a, IsotopeLabelType.light);
            var peakData2          = new MockTranPeakData <IDetailedPeakData>(INTENS2, IonType.a, IsotopeLabelType.heavy);
            var peakData3          = new MockTranPeakData <IDetailedPeakData>(INTENS3, IonType.precursor, IsotopeLabelType.light);
            var peakData4          = new MockTranPeakData <IDetailedPeakData>(INTENS3, IonType.precursor, IsotopeLabelType.heavy);
            var tranGroupData1     = new MockTranGroupPeakData <IDetailedPeakData>(new[] { peakData1 });
            var tranGroupData2     = new MockTranGroupPeakData <IDetailedPeakData>(new[] { peakData2 }, true);
            var tranGroupData3     = new MockTranGroupPeakData <IDetailedPeakData>(new[] { peakData1, peakData3 });
            var tranGroupData4     = new MockTranGroupPeakData <IDetailedPeakData>(new[] { peakData2, peakData4 }, true);
            var peptidePeakData    = new MockPeptidePeakData <IDetailedPeakData>(new[] { tranGroupData1, tranGroupData2 });
            var peptidePeakDataMs1 = new MockPeptidePeakData <IDetailedPeakData>(new[] { tranGroupData3, tranGroupData4 });
            var peptidePeakDatas   = new List <MockPeptidePeakData <IDetailedPeakData> > {
                peptidePeakData, peptidePeakDataMs1
            };
            var calcShape             = new MQuestReferenceShapeCalc();
            var calcCoelution         = new MQuestReferenceCoElutionCalc();
            var calcWeightedShape     = new MQuestWeightedReferenceShapeCalc();
            var calcWeightedCoelution = new MQuestWeightedReferenceCoElutionCalc();

            // These scores are the same with or without an extra MS1 transition
            foreach (var peptideData in peptidePeakDatas)
            {
                MQuestScoreEquals(calcShape, 0.3969832, peptideData);
                MQuestScoreEquals(calcCoelution, 3.0, peptideData);
                MQuestScoreEquals(calcWeightedShape, 0.3969832, peptideData);
                MQuestScoreEquals(calcWeightedCoelution, 3.0, peptideData);
            }
            // TODO: Figure out OpenSWATH weights
            // var calcWeighted = new MQuestWeightedShapeCalc();
            // AreCloseEnough(calcWeighted.Calculate(new PeakScoringContext(), peptidePeakData), 0.6984916);
        }
コード例 #2
0
        public void MQuestSummaryScoreTest()
        {
            var peakData1              = new MockTranPeakData <ISummaryPeakData>(INTENS1, IonType.a, null, 2, 0.5, 20);
            var peakData2              = new MockTranPeakData <ISummaryPeakData>(INTENS2, IonType.a, null, 2, -1.0, 300);
            var peakData3              = new MockTranPeakData <ISummaryPeakData>(INTENS3, IonType.precursor, null, 2, 5.0, 1000000, 0.8);
            var peakData4              = new MockTranPeakData <ISummaryPeakData>(INTENS3, IonType.precursor, null, 2, 5.0, 1000000, 0.2);
            var peptidePeakData        = new MockPeptidePeakData <ISummaryPeakData>(new[] { peakData1, peakData2 });
            var peptidePeakDataMs1     = new MockPeptidePeakData <ISummaryPeakData>(new[] { peakData1, peakData2, peakData3, peakData4 });
            var calcPrecursorMassError = new NextGenPrecursorMassErrorCalc();
            var calcProductMassError   = new NextGenProductMassErrorCalc();
            var calcIntensity          = new MQuestIntensityCalc();
            var calcCrossCorr          = new MQuestIntensityCorrelationCalc();
            var calcIdotp              = new NextGenIsotopeDotProductCalc();

            var peptidePeakDatas = new List <MockPeptidePeakData <ISummaryPeakData> > {
                peptidePeakData, peptidePeakDataMs1
            };

            // These scores are the same with or without an extra MS1 transition
            foreach (var peptideData in peptidePeakDatas)
            {
                MQuestScoreEquals(calcProductMassError, 0.99112, peptideData);
                MQuestScoreEquals(calcIntensity, 2.84732, peptideData);
                MQuestScoreEquals(calcCrossCorr, 0.924226, peptideData);
            }
            // The precursor mass error score differs when an MS1 transition is added
            MQuestScoreEquals(calcPrecursorMassError, double.NaN, peptidePeakData);
            MQuestScoreEquals(calcPrecursorMassError, 5.0, peptidePeakDataMs1);
            MQuestScoreEquals(calcIdotp, double.NaN, peptidePeakData);
            MQuestScoreEquals(calcIdotp, 0.795167, peptidePeakDataMs1);

            // TODO: Figure out OpenSWATH weights
            // var calcWeighted = new MQuestWeightedShapeCalc();
            // AreCloseEnough(calcWeighted.Calculate(new PeakScoringContext(), peptidePeakData), 0.6984916);
        }
コード例 #3
0
        public void MQuestDetailScoreTest()
        {
            var peakData1              = new MockTranPeakData <IDetailedPeakData>(INTENS1, IonType.a, null, 2, 0.5);
            var peakData2              = new MockTranPeakData <IDetailedPeakData>(INTENS2, IonType.a, null, 2, -1.0);
            var peakData3              = new MockTranPeakData <IDetailedPeakData>(INTENS3, IonType.precursor, null, 2, 5.0);
            var peptidePeakData        = new MockPeptidePeakData <IDetailedPeakData>(new[] { peakData1, peakData2 });
            var peptidePeakDataMs1     = new MockPeptidePeakData <IDetailedPeakData>(new[] { peakData1, peakData2, peakData3 });
            var calcShape              = new MQuestShapeCalc();
            var calcCoelution          = new MQuestCoElutionCalc();
            var calcWeightedShape      = new MQuestWeightedShapeCalc();
            var calcWeightedCoelution  = new MQuestWeightedCoElutionCalc();
            var calcWeightedCrossShape = new NextGenCrossWeightedShapeCalc();
            var calcSignalNoise        = new NextGenSignalNoiseCalc();

            var peptidePeakDatas = new List <MockPeptidePeakData <IDetailedPeakData> > {
                peptidePeakData, peptidePeakDataMs1
            };

            // These scores are the same with or without an extra MS1 transition
            foreach (var peptideData in peptidePeakDatas)
            {
                MQuestScoreEquals(calcShape, 0.3969832, peptideData);
                MQuestScoreEquals(calcCoelution, 3.0, peptideData);
                MQuestScoreEquals(calcWeightedShape, 0.3969832, peptideData);
                MQuestScoreEquals(calcWeightedCoelution, 3.0, peptideData);
                MQuestScoreEquals(calcSignalNoise, 1.3086293, peptideData);
            }
            // The MS1-MS2 cross score differs when an MS1 transition is added
            MQuestScoreEquals(calcWeightedCrossShape, 0.94669, peptidePeakDataMs1);

            // TODO: Figure out OpenSWATH weights
            // var calcWeighted = new MQuestWeightedShapeCalc();
            // AreCloseEnough(calcWeighted.Calculate(new PeakScoringContext(), peptidePeakData), 0.6984916);
        }
コード例 #4
0
        public void MQuestCrossCorrelationTest()
        {
            var peakData1   = new MockTranPeakData <IDetailedPeakData>(INTENS1);
            var peakData2   = new MockTranPeakData <IDetailedPeakData>(INTENS2);
            var xcorrMatrix = new MQuestCrossCorrelation(peakData1, peakData2, true);

            Assert.AreEqual(xcorrMatrix.XcorrDict.Count, 23);

            var xcorrDict = xcorrMatrix.XcorrDict;

            AreCloseEnough(xcorrDict[2], -0.31165141);
            AreCloseEnough(xcorrDict[1], -0.35036919);
            AreCloseEnough(xcorrDict[0], 0.03129565);
            AreCloseEnough(xcorrDict[-1], 0.30204049);
            AreCloseEnough(xcorrDict[-2], 0.13012441);
            AreCloseEnough(xcorrDict[-3], 0.39698322);
            AreCloseEnough(xcorrDict[-4], 0.16608774);

            var xcorrMatrixAuto = new MQuestCrossCorrelation(peakData1, new MockTranPeakData <IDetailedPeakData>(INTENS1), true);
            var xcorrDictAuto   = xcorrMatrixAuto.XcorrDict;

            AreCloseEnough(xcorrDictAuto[0], 1);
            AreCloseEnough(xcorrDictAuto[1], -0.227352707759245);
            AreCloseEnough(xcorrDictAuto[-1], -0.227352707759245);
            AreCloseEnough(xcorrDictAuto[2], -0.07501116);
            AreCloseEnough(xcorrDictAuto[-2], -0.07501116);
        }