Пример #1
0
        public void TestMSGFPlusResults()
        {
            const string workDir     = @"F:\My Documents\Projects\JoshAldrich\AScore\AScore_DLL\TestCase";
            var          fht         = Path.Combine(workDir, "CPTAC_CompREF_00_iTRAQ_NiNTA_01b_22Mar12_Lynx_12-02-29_msgfdb_fht.txt");
            var          param       = Path.Combine(workDir, "AScore_CID_0.5Da_ETD_0.5Da_HCD_0.05Da_MSGF1E-12.xml");
            var          dta         = Path.Combine(workDir, "CPTAC_CompREF_00_iTRAQ_NiNTA_01b_22Mar12_Lynx_12-02-29_dta.txt");
            var          resultsFile = Path.Combine(workDir, "CPTAC_CompREF_00_iTRAQ_NiNTA_01b_22Mar12_Lynx_12-02-29_msgfdb_fht_ascore.txt");

            var peptideMassCalculator = GetDefaultPeptideMassCalculator();

            PsmResultsManager dfht = new MsgfdbFHT(fht);
            var pfile = new ParameterFileManager(param);

            var spectraCache = new SpectraManagerCache(peptideMassCalculator);

            spectraCache.OpenFile(dta);

            var sw = System.Diagnostics.Stopwatch.StartNew();

            var ascoreEngine = new AScore_DLL.AScoreProcessor();

            ascoreEngine.RunAScoreOnSingleFile(spectraCache, dfht, pfile, resultsFile);

            sw.Stop();
            Console.WriteLine("Time elapsed: {0:F1} seconds", sw.Elapsed.TotalSeconds);
            Console.WriteLine("Results in " + resultsFile);
        }
Пример #2
0
        public void SisiConfirm()
        {
            var dtaname = new string[] {
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\09302010_MG1655_phospho_S_08_B_100930113735_dta.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10012010_MG1655_phospho_S_09_B_101001105913_dta.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10012010_MG1655_phospho_s06_101002094806_dta.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10012010_MG1655_phospho_s10_101001105913_dta.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10022010_MG1655_phospho_S11_rerun_101005165350_dta.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10022010_MG1655_phospho_s12_101002094806_dta.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10022010_MG1655_phospho_s7_101002094806_dta.txt"
            };
            var datasetname = new string[] {
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\09302010_MG1655_phospho_S_08_B_100930113735_msgfdb_fht.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10012010_MG1655_phospho_S_09_B_101001105913_msgfdb_fht.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10012010_MG1655_phospho_s06_101002094806_msgfdb_fht.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10012010_MG1655_phospho_s10_101001105913_msgfdb_fht.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10022010_MG1655_phospho_S11_rerun_101005165350_msgfdb_fht.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10022010_MG1655_phospho_s12_101002094806_msgfdb_fht.txt",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\10022010_MG1655_phospho_s7_101002094806_msgfdb_fht.txt"
            };
            var ascParam = new string[] {
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\HistPhos.xml",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\HistPhos.xml",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\HistPhos.xml",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\HistPhos.xml",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\HistPhos.xml",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\HistPhos.xml",
                @"C:\Users\aldr699\Documents\2012\Sisi_Work\PhosphohistidineConfirmation\HistPhos.xml"
            };

            var peptideMassCalculator = GetDefaultPeptideMassCalculator();

            for (var i = 0; i < dtaname.Length; i++)
            {
                var outFile = Path.Combine(
                    Path.GetDirectoryName(datasetname[i]),
                    Path.GetFileNameWithoutExtension(datasetname[i]) + "_AScore.txt");
                PsmResultsManager datasetMan = new MsgfdbFHT(datasetname[i]);
                //DtaManager dtaManager = new DtaManager(dtaname[i]);
                var spectraCache = new SpectraManagerCache(peptideMassCalculator);
                spectraCache.OpenFile(dtaname[i]);
                var paramFile    = new ParameterFileManager(ascParam[i]);
                var ascoreEngine = new AScore_DLL.AScoreProcessor();
                //ascoreEngine.AlgorithmRun(dtaManager, datasetMan, paramFile, outFile);
                ascoreEngine.RunAScoreOnSingleFile(spectraCache, datasetMan, paramFile, outFile);
            }
        }
Пример #3
0
        /// <summary>
        /// Configure and run the AScore algorithm
        /// </summary>
        /// <param name="ascoreOptions"></param>
        /// <returns></returns>
        public int RunAScore(AScoreOptions ascoreOptions)
        {
            var paramManager = new ParameterFileManager(ascoreOptions.AScoreParamFile);

            RegisterEvents(paramManager);

            Console.WriteLine();

            if (paramManager.DynamicMods.Count > 0 || paramManager.StaticMods.Count > 0)
            {
                OnStatusEvent("Loaded modifications from: " + ascoreOptions.AScoreParamFile);

                foreach (var mod in paramManager.StaticMods)
                {
                    OnStatusEvent(Utilities.GetModDescription("Static,   ", mod));
                }

                foreach (var mod in paramManager.DynamicMods)
                {
                    OnStatusEvent(Utilities.GetModDescription("Dynamic,  ", mod));
                }

                foreach (var mod in paramManager.TerminiMods)
                {
                    OnStatusEvent(Utilities.GetModDescription("Terminus, ", mod));
                }

                Console.WriteLine();
            }

            PsmResultsManager psmResultsManager;

            switch (ascoreOptions.SearchType)
            {
            case AScoreOptions.SearchMode.XTandem:
                OnStatusEvent("Caching data in " + PathUtils.CompactPathString(ascoreOptions.DbSearchResultsFile, 80));
                psmResultsManager = new XTandemFHT(ascoreOptions.DbSearchResultsFile);
                break;

            case AScoreOptions.SearchMode.Sequest:
                OnStatusEvent("Caching data in " + PathUtils.CompactPathString(ascoreOptions.DbSearchResultsFile, 80));
                psmResultsManager = new SequestFHT(ascoreOptions.DbSearchResultsFile);
                break;

            case AScoreOptions.SearchMode.Inspect:
                OnStatusEvent("Caching data in " + PathUtils.CompactPathString(ascoreOptions.DbSearchResultsFile, 80));
                psmResultsManager = new InspectFHT(ascoreOptions.DbSearchResultsFile);
                break;

            case AScoreOptions.SearchMode.Msgfdb:
            case AScoreOptions.SearchMode.Msgfplus:
                OnStatusEvent("Caching data in " + PathUtils.CompactPathString(ascoreOptions.DbSearchResultsFile, 80));
                if (ascoreOptions.SearchResultsType == AScoreOptions.DbSearchResultsType.Mzid)
                {
                    if (ascoreOptions.CreateUpdatedDbSearchResultsFile)
                    {
                        psmResultsManager = new MsgfMzidFull(ascoreOptions.DbSearchResultsFile);
                    }
                    else
                    {
                        psmResultsManager = new MsgfMzid(ascoreOptions.DbSearchResultsFile);
                    }
                }
                else
                {
                    psmResultsManager = new MsgfdbFHT(ascoreOptions.DbSearchResultsFile);
                }
                break;

            default:
                OnErrorEvent(string.Format(
                                 "Incorrect search type: {0} , supported values are {1}",
                                 ascoreOptions.SearchType,
                                 string.Join(", ", Enum.GetNames(typeof(AScoreOptions.SearchMode)))
                                 ));
                return(-13);
            }
            var peptideMassCalculator = new PeptideMassCalculator();

            var spectraManager = new SpectraManagerCache(peptideMassCalculator);

            RegisterEvents(spectraManager);

            OnStatusEvent("Output directory: " + ascoreOptions.OutputDirectoryInfo.FullName);

            var ascoreEngine = new AScoreAlgorithm();

            RegisterEvents(ascoreEngine);

            // Initialize the options
            FilterOnMSGFScore = ascoreOptions.FilterOnMSGFScore;

            // Run the algorithm
            if (ascoreOptions.MultiJobMode)
            {
                RunAScoreWithMappingFile(ascoreOptions, spectraManager, psmResultsManager, paramManager);
            }
            else
            {
                spectraManager.OpenFile(ascoreOptions.MassSpecFile, ascoreOptions.ModSummaryFile);

                RunAScoreOnSingleFile(ascoreOptions, spectraManager, psmResultsManager, paramManager);
            }

            OnStatusEvent("AScore Complete");

            if (ascoreOptions.CreateUpdatedDbSearchResultsFile)
            {
                if (ascoreOptions.SearchResultsType == AScoreOptions.DbSearchResultsType.Fht)
                {
                    CreateUpdatedFirstHitsFile(ascoreOptions);
                }
                else if (psmResultsManager is MsgfMzidFull mzidFull)
                {
                    mzidFull.WriteToMzidFile(ascoreOptions.UpdatedDbSearchResultsFileName);
                    OnStatusEvent("Results merged; new file: " + PathUtils.CompactPathString(ascoreOptions.UpdatedDbSearchResultsFileName, 80));
                }
            }

            return(0);
        }
Пример #4
0
        public void Sisi_Kidneys()
        {
            const string ascoreP   = "HCDPhos.xml";
            const string directSeq = @"C:\Users\aldr699\Documents\2012\Sisi_Work\DarthVehDas\Sequest";
            const string directMsg = @"C:\Users\aldr699\Documents\2012\Sisi_Work\DarthVehDas\MSGFDB";

            var fhtFiles = new List <string> {
                "Kidney_ACHN_Das_1_pTyr_HCD_8May12_Lynx_12-02-29_fht.txt",
                "Kidney_ACHN_Veh_1_pTyr_HCD_10May12_Lynx_12-02-29_fht.txt",
                "Kidney_ACHN_Veh_2_IMAC_HCD_10May12_Lynx_12-02-31_fht.txt",
                "Kidney_ACHN_Das_2_IMAC_HCD_11May12_Lynx_12-02-31_fht.txt"
            };

            var msgfdbFile = new List <string> {
                "Kidney_ACHN_Das_1_pTyr_HCD_8May12_Lynx_12-02-29_msgfdb_fht.txt",
                "Kidney_ACHN_Veh_1_pTyr_HCD_10May12_Lynx_12-02-29_msgfdb_fht.txt",
                "Kidney_ACHN_Veh_2_IMAC_HCD_10May12_Lynx_12-02-31_msgfdb_fht.txt",
                "Kidney_ACHN_Das_2_IMAC_HCD_11May12_Lynx_12-02-31_msgfdb_fht.txt"
            };

            const string direct2 = @"C:\Users\aldr699\Documents\2012\Sisi_Work\DarthVehDas";

            var dtaFiles = new List <string> {
                "Kidney_ACHN_Das_1_pTyr_HCD_8May12_Lynx_12-02-29_dta.txt",
                "Kidney_ACHN_Veh_1_pTyr_HCD_10May12_Lynx_12-02-29_dta.txt",
                "Kidney_ACHN_Veh_2_IMAC_HCD_10May12_Lynx_12-02-31_dta.txt",
                "Kidney_ACHN_Das_2_IMAC_HCD_11May12_Lynx_12-02-31_dta.txt"
            };

            var peptideMassCalculator = GetDefaultPeptideMassCalculator();

            for (var j = 1; j < 2; j++)
            {
                for (var i = 0; i < 4; i++)
                {
                    string fht;
                    string direct;
                    if (j == 0)
                    {
                        direct = directSeq;
                        fht    = fhtFiles[i];
                    }
                    else
                    {
                        direct = directMsg;
                        fht    = msgfdbFile[i];
                    }

                    var tempfht = Path.Combine(direct, fht);
                    var tempdta = Path.Combine(direct2, dtaFiles[i]);
                    var ascP    = Path.Combine(direct2, ascoreP);
                    var tempout = Path.Combine(direct, fhtFiles[i].Substring(0, fhtFiles[i].Length - 4) + "_AScore.txt");
                    PsmResultsManager dsman;
                    if (j == 0)
                    {
                        dsman = new SequestFHT(tempfht);
                    }
                    else
                    {
                        dsman = new MsgfdbFHT(tempfht);
                    }
                    if (dsman == null)
                    {
                        Console.WriteLine("Failed to load fht");
                    }
                    //DtaManager dtman = new DtaManager(tempdta);
                    var spectraCache = new SpectraManagerCache(peptideMassCalculator);
                    spectraCache.OpenFile(tempdta);
                    var pman = new ParameterFileManager(ascP);

                    var ascoreEngine = new AScore_DLL.AScoreProcessor();
                    //ascoreEngine.AlgorithmRun(dtman, dsman, pman, tempout);
                    ascoreEngine.RunAScoreOnSingleFile(spectraCache, dsman, pman, tempout);
                }
            }
        }
Пример #5
0
        public void QuYi()
        {
            const string direct = @"C:\Documents and Settings\aldr699\My Documents2011\EColiPhos";

            const string ascoreP = "parameterFile.xml";

            var fhtFiles = new List <string> {
                "775945_10012010_MG1655_phospho_s05_101002094806_msgfdb_fht.txt",
                "775946_10012010_MG1655_phospho_s11_101002094806_msgfdb_fht.txt",
                "775947_10022010_MG1655_phospho_s7_101002094806_msgfdb_fht.txt",
                "775948_10012010_MG1655_phospho_s10_101001105913_msgfdb_fht.txt",
                "775949_10012010_MG1655_phospho_s06_101002094806_msgfdb_fht.txt",
                "775950_10022010_MG1655_phospho_s12_101002094806_msgfdb_fht.txt",
                "775951_10022010_MG1655_phospho_S8FT_101005165350_msgfdb_fht.txt",
                "775944_10012010_MG1655_phospho_S_09_B_101001105913_msgfdb_fht.txt",
                "775942_09302010_MG1655_phospho_S_08_B_100930113735_msgfdb_fht.txt",
                "775952_10022010_MG1655_phospho_S11_rerun_101005165350_msgfdb_fht.txt",
                "775955_MG1655_phospho_S-01FT_5Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775956_MG1655_phospho_S-02FT_5Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775957_MG1655_phospho_S-03FT_8Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775958_MG1655_phospho_S-06FT_8Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775959_MG1655_phospho_S-09FT_12Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775960_MG1655_phospho_S-10FT_12Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775961_MG1655_phospho_S-12FT_15Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775962_MG1655_phospho_S-01_15Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775963_MG1655_phospho_S-02_17Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775964_MG1655_phospho_S-03_17Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775965_MG1655_phospho_S-04_17Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775966_MG1655_phospho_S-07_17Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775967_MG1655_phospho_S-12_19Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775968_MG1655_phospho_S-10_19Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775969_MG1655_phospho_S-09_19Nov10_Hawk_10-11-02p_msgfdb_fht.txt",
                "775953_10022010_MG1655_phospho_S05_rerun_101005165350_msgfdb_fht.txt",
                "775943_09302010_MG1655_phospho_S_04_B_100930113735_msgfdb_fht.txt",
                "775954_10022010_MG1655_phospho_S06_rerun_101005165350_msgfdb_fht.txt"
            };

            var dtaFiles = new List <string> {
                "10012010_MG1655_phospho_s05_101002094806_dta.txt",
                "10012010_MG1655_phospho_s11_101002094806_dta.txt",
                "10022010_MG1655_phospho_s7_101002094806_dta.txt",
                "10012010_MG1655_phospho_s10_101001105913_dta.txt",
                "10012010_MG1655_phospho_s06_101002094806_dta.txt",
                "10022010_MG1655_phospho_s12_101002094806_dta.txt",
                "10022010_MG1655_phospho_S8FT_101005165350_dta.txt",
                "10012010_MG1655_phospho_S_09_B_101001105913_dta.txt",
                "09302010_MG1655_phospho_S_08_B_100930113735_dta.txt",
                "10022010_MG1655_phospho_S11_rerun_101005165350_dta.txt",
                "MG1655_phospho_S-01FT_5Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-02FT_5Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-03FT_8Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-06FT_8Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-09FT_12Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-10FT_12Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-12FT_15Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-01_15Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-02_17Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-03_17Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-04_17Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-07_17Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-12_19Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-10_19Nov10_Hawk_10-11-02p_dta.txt",
                "MG1655_phospho_S-09_19Nov10_Hawk_10-11-02p_dta.txt",
                "10022010_MG1655_phospho_S05_rerun_101005165350_dta.txt",
                "09302010_MG1655_phospho_S_04_B_100930113735_dta.txt",
                "10022010_MG1655_phospho_S06_rerun_101005165350_dta.txt"
            };

            var peptideMassCalculator = GetDefaultPeptideMassCalculator();

            for (var i = 0; i < fhtFiles.Count; i++)
            {
                var tempfht = Path.Combine(direct, fhtFiles[i]);
                var tempdta = Path.Combine(direct, dtaFiles[i]);
                var ascP    = Path.Combine(direct, ascoreP);
                var tempout = Path.Combine(direct, fhtFiles[i].Substring(0, fhtFiles[i].Length - 4) + "_AScore.txt");

                PsmResultsManager dsman = new MsgfdbFHT(tempfht);
                //DtaManager dtman = new DtaManager(tempdta);
                var spectraCache = new SpectraManagerCache(peptideMassCalculator);
                spectraCache.OpenFile(tempdta);
                var pman = new ParameterFileManager(ascP);

                var ascoreEngine = new AScore_DLL.AScoreProcessor();
                //ascoreEngine.AlgorithmRun(dtman, dsman, pman, tempout);
                ascoreEngine.RunAScoreOnSingleFile(spectraCache, dsman, pman, tempout);
            }
        }