예제 #1
0
        public void tester()
        {
            Run run = new XCaliburRun(xcaliburTestfile);
            MassTagCollection        massTagColl  = new MassTagCollection();
            MassTagIDGenericImporter mtidImporter = new MassTagIDGenericImporter(smartMethionineMatches, '\t');

            mtidImporter.Import(massTagColl);
            Console.WriteLine("SMART matches = " + massTagColl.MassTagIDList.Count());

            MassTagCollection        matchedMassTag = new MassTagCollection();
            MassTagIDGenericImporter matchImporter  = new MassTagIDGenericImporter(targetedMethionineMatches, '\t');

            matchImporter.Import(matchedMassTag);
            Console.WriteLine("Targeted matches = " + matchedMassTag.MassTagIDList.Distinct().Count());


            //List<long> common_massTags = massTagColl.MassTagIDList.Intersect(matchedMassTag.MassTagIDList).ToList();
            List <long> common_massTags = matchedMassTag.MassTagIDList.Intersect(massTagColl.MassTagIDList).ToList();

            List <long> targetedUniqueTags = matchedMassTag.MassTagIDList.Except(massTagColl.MassTagIDList).ToList();

            List <long> smartUniqueTags = massTagColl.MassTagIDList.Except(matchedMassTag.MassTagIDList).ToList();


            string listOfMTsForSMARTUnique = getStringListOfMassTags(smartUniqueTags);

            Console.WriteLine("Common matches = " + common_massTags.Count);
            Console.WriteLine("Unique to targeted = " + targetedUniqueTags.Count);
            Console.WriteLine("Unique to SMART = " + smartUniqueTags.Count);

            Console.WriteLine();
            Console.WriteLine(listOfMTsForSMARTUnique);
        }
        public void test1()
        {
            MassTagCollection        massTagColl  = new MassTagCollection();
            MassTagIDGenericImporter mtidImporter = new MassTagIDGenericImporter(mt_sourceFile1, ',');

            mtidImporter.Import(massTagColl);

            Assert.AreEqual(8353, massTagColl.MassTagIDList.Count);
        }
        public void import100MassTagIDs_andLookUpInDMSTest1()
        {
            this.massTagColl = new MassTagCollection();

            MassTagIDGenericImporter mtidImporter = new MassTagIDGenericImporter(mt_sourceFile1, ',');

            mtidImporter.Import(massTagColl);

            Assert.AreEqual(100, massTagColl.MassTagIDList.Count);
            Assert.AreEqual(85, massTagColl.MassTagIDList.Distinct().Count());


            MassTagFromSqlDBImporter importer = new MassTagFromSqlDBImporter("MT_Shewanella_ProdTest_P352", "porky");

            importer.Import(massTagColl);
            massTagColl.Display();

            Assert.AreEqual(114, massTagColl.MassTagList.Count);
        }
        public void get14864MassTagsTest()     // this takes about 1 minute on Gord's machine
        {
            MassTagCollection        massTagColl  = new MassTagCollection();
            MassTagIDGenericImporter mtidImporter = new MassTagIDGenericImporter(mt_sourceFile2, ',');

            mtidImporter.Import(massTagColl);

            Assert.AreEqual(21047, massTagColl.MassTagIDList.Count);
            Assert.AreEqual(14864, massTagColl.MassTagIDList.Distinct().Count());

            massTagColl.MassTagIDList = massTagColl.MassTagIDList.Distinct().ToList();

            MassTagFromSqlDBImporter importer = new MassTagFromSqlDBImporter("MT_Shewanella_ProdTest_P352", "porky");

            importer.SetMassTagsToRetrieve(massTagColl.MassTagIDList);
            importer.Import(massTagColl);
            massTagColl.Display();

            Assert.AreEqual(14864, massTagColl.MassTagList.Count);
        }
예제 #5
0
        public void test1()
        {
            Run run = new XCaliburRun(xcaliburTestfile);
            MassTagCollection        massTagColl  = new MassTagCollection();
            MassTagIDGenericImporter mtidImporter = new MassTagIDGenericImporter(cysteineMassTagSourceFile1, '\t');

            mtidImporter.Import(massTagColl);

            MassTagFromSqlDBImporter importer = new MassTagFromSqlDBImporter("MT_Shewanella_ProdTest_P352", "porky");

            importer.Import(massTagColl);

            Assert.AreEqual(737, massTagColl.MassTagIDList.Count);

            Assert.AreEqual(826, massTagColl.MassTagList.Count);

            ChromAlignerUsingVIPERInfo chromAligner = new ChromAlignerUsingVIPERInfo();

            chromAligner.Execute(run);

            PeakImporterFromText peakImporter = new DeconTools.Backend.Data.PeakImporterFromText(xcaliburAllPeaksFile);

            peakImporter.ImportPeaks(run.ResultCollection.MSPeakResultList);

            Task peakChromGen = new PeakChromatogramGenerator(20);

            Task smoother     = new DeconTools.Backend.ProcessingTasks.Smoothers.DeconToolsSavitzkyGolaySmoother(11, 11, 2);
            Task peakDet      = new DeconTools.Backend.ProcessingTasks.PeakDetectors.ChromPeakDetector(0.5, 0.5);
            Task chromPeakSel = new DeconTools.Backend.ProcessingTasks.ChromPeakSelector(1, 0.01, Globals.PeakSelectorMode.CLOSEST_TO_TARGET);

            MSGeneratorFactory msgenFactory = new MSGeneratorFactory();
            Task msgen = msgenFactory.CreateMSGenerator(run.MSFileType);


            DeconToolsV2.Peaks.clsPeakProcessorParameters peakParams = new DeconToolsV2.Peaks.clsPeakProcessorParameters(2, 0.75, true, DeconToolsV2.Peaks.PEAK_FIT_TYPE.QUADRATIC);
            Task mspeakDet             = new DeconToolsPeakDetector(peakParams);
            Task theorFeatureGen       = new TomTheorFeatureGenerator();
            Task targetedFeatureFinder = new BasicTFF(6);
            Task exporter = new BasicMTResultSQLiteExporter(cysteineAnalysisOutput1);


            IsotopicProfileFitScoreCalculator fitScoreCalc = new IsotopicProfileFitScoreCalculator();

            int         successCounter = 0;
            List <long> timingResults  = new List <long>();

            foreach (MassTag mt in massTagColl.MassTagList)
            {
                run.CurrentMassTag = mt;
                mt.MZ = mt.MonoIsotopicMass / mt.ChargeState + Globals.PROTON_MASS;

                Console.WriteLine();
                Console.WriteLine();
                Console.WriteLine("------------------- MassTag = " + mt.ID + "---------------------------");
                Console.WriteLine("monoMass = " + mt.MonoIsotopicMass.ToString("0.0000") + "; monoMZ = " + mt.MZ.ToString("0.0000") + "; ChargeState = " + mt.ChargeState + "; NET = " + mt.NETVal.ToString("0.000") + "; Sequence = " + mt.PeptideSequence + "\n");


                Stopwatch sw = new Stopwatch();
                sw.Start();
                try
                {
                    peakChromGen.Execute(run.ResultCollection);
                    smoother.Execute(run.ResultCollection);
                    peakDet.Execute(run.ResultCollection);
                    chromPeakSel.Execute(run.ResultCollection);
                    msgen.Execute(run.ResultCollection);
                    mspeakDet.Execute(run.ResultCollection);
                    theorFeatureGen.Execute(run.ResultCollection);
                    targetedFeatureFinder.Execute(run.ResultCollection);
                    fitScoreCalc.Execute(run.ResultCollection);
                    MassTagResultBase massTagResult = run.ResultCollection.MassTagResultList[mt];
                    massTagResult.DisplayToConsole();


                    Console.WriteLine("------------------------------ end --------------------------");
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Task failed. Message: " + ex.Message + ex.StackTrace);
                }
                sw.Stop();
                timingResults.Add(sw.ElapsedMilliseconds);

                if (mt == massTagColl.MassTagList.Last())
                {
                    exporter.Execute(run.ResultCollection);
                }
            }

            exporter.Cleanup();

            //List<IMassTagResult> successfulResults = run.ResultCollection.GetSuccessfulMassTagResults();

            foreach (long tr in timingResults)
            {
                Console.WriteLine(tr);
            }
            Console.WriteLine("-------- Analysis time for all MTs = " + timingResults.Sum());
            Console.WriteLine("-------- Average time for each MT = " + timingResults.Average());

            Console.WriteLine();
        }