예제 #1
0
 public static string AutoDetermineBestInputFile(string inputDirectoryPath, List <string> datasetNames,
                                                 out PeptideHitResultTypes matchedResultType)
 {
     return(ReaderFactory.AutoDetermineBestInputFile(inputDirectoryPath, datasetNames, out matchedResultType));
 }
예제 #2
0
        public static void Main()
        {
            //const string synFileSequest = @"Seq201304121552_Auto934225\Firestone_Soil_07_18_05APR13_Frodo_12-12-04_syn.txt";
            //const string synFileMSGFPlus = @"MSG201304261714_Auto938181\FSFA-299b_25Apr13_Methow_13-02-13_msgfplus_syn.txt";

            const string resultsPathSequest = @"\\proto-7\VOrbi05\2013_2\Firestone_Soil_07_18_05APR13_Frodo_12-12-04\Seq201304121552_Auto934225";
            // const string resultsPathMSGFPlus = "MSG201304261714_Auto938181"

            // const string resultsPathMSGFPlus = "\\proto-7\VOrbiETD03\2015_1\proteogeomics_32_crude_heavy_peptides_200f_25Feb15_Tiger_15-01-26\MSG201503091410_Auto1169297"
            const string resultsPathMSGFPlus = @"C:\DMS_WorkDir";

            //const string resultsXTandem = @"\\proto-7\VOrbiETD01\2013_3\QC_Shew_13_04_pt1_1_2_27Jun13_Leopard_13-05-20\XTM201307011524_Auto958319"

            //const string resultsMSAlign = @"\\proto-9\VOrbiETD02\2014_1\Synocho_D2_2\MSA201402281500_Auto1030272"

            string synOrFhtFile;
            var    matchedResultType = PHRPReader.PeptideHitResultTypes.Unknown;

            if (false)
            {
                Console.WriteLine();
                synOrFhtFile = ReaderFactory.AutoDetermineBestInputFile(resultsPathSequest, out matchedResultType);
                if (!string.IsNullOrEmpty(synOrFhtFile) && matchedResultType != PHRPReader.PeptideHitResultTypes.Unknown)
                {
                    TestPHRPReader(synOrFhtFile, blnSkipDuplicates: true);
                }
            }

            var msgfPlusDirectory = new DirectoryInfo(resultsPathMSGFPlus);

            if (!msgfPlusDirectory.Exists)
            {
                Console.WriteLine("Warning, Folder not found: " + resultsPathMSGFPlus);
            }

            if (msgfPlusDirectory.Exists)
            {
                Console.WriteLine();
                synOrFhtFile = ReaderFactory.AutoDetermineBestInputFile(resultsPathMSGFPlus, out matchedResultType);
                if (!string.IsNullOrEmpty(synOrFhtFile) && matchedResultType != PHRPReader.PeptideHitResultTypes.Unknown)
                {
                    TestPHRPReader(synOrFhtFile, blnSkipDuplicates: false);
                }
            }

            if (msgfPlusDirectory.Exists)
            {
                Console.WriteLine();
                synOrFhtFile = ReaderFactory.AutoDetermineBestInputFile(resultsPathMSGFPlus, out matchedResultType);
                if (!string.IsNullOrEmpty(synOrFhtFile) && matchedResultType != PHRPReader.PeptideHitResultTypes.Unknown)
                {
                    TestPHRPReader(synOrFhtFile, blnSkipDuplicates: true);
                }
            }

            if (msgfPlusDirectory.Exists)
            {
                // Look for an MSGF+ parameter file to parse
                var lstFiles = msgfPlusDirectory.GetFiles("MSGFDB*.txt");
                if (lstFiles.Length > 0)
                {
                    TestMSGFPlusParamFileParsing(lstFiles.First().FullName);
                }
            }

            var sequestDirectory = new DirectoryInfo(resultsPathSequest);

            if (!sequestDirectory.Exists)
            {
                Console.WriteLine("Warning, Folder not found: " + resultsPathSequest);
            }

            if (!sequestDirectory.Exists)
            {
                return;
            }

            var startTimeNoSkipDup = default(DateTime);
            var endTimeNoSkipDup   = default(DateTime);

            var startTimeSkipDup = default(DateTime);
            var endTimeSkipDup   = default(DateTime);

            Console.WriteLine();
            synOrFhtFile = ReaderFactory.AutoDetermineBestInputFile(resultsPathSequest);
            if (!string.IsNullOrEmpty(synOrFhtFile) && matchedResultType != PHRPReader.PeptideHitResultTypes.Unknown)
            {
                startTimeNoSkipDup = DateTime.UtcNow;
                TestPHRPReader(synOrFhtFile, blnSkipDuplicates: false);
                endTimeNoSkipDup = DateTime.UtcNow;
            }

            Console.WriteLine();
            synOrFhtFile = ReaderFactory.AutoDetermineBestInputFile(resultsPathSequest, out matchedResultType);
            if (!string.IsNullOrEmpty(synOrFhtFile) && matchedResultType != PHRPReader.PeptideHitResultTypes.Unknown)
            {
                startTimeSkipDup = DateTime.UtcNow;
                TestPHRPReader(synOrFhtFile, blnSkipDuplicates: true);
                endTimeSkipDup = DateTime.UtcNow;
            }

            Console.WriteLine();

            Console.WriteLine("Elapsed time (Keep Duplicates): " + endTimeNoSkipDup.Subtract(startTimeNoSkipDup).TotalSeconds.ToString("0.0") + " seconds");
            Console.WriteLine("Elapsed time (Skip Duplicates): " + endTimeSkipDup.Subtract(startTimeSkipDup).TotalSeconds.ToString("0.0") + " seconds");
            Console.WriteLine();
        }