Esempio n. 1
0
        public static void DoQc(WorkflowParameters parameters)
        {
            //QcDataCollectionDDA qcDataCollection;
            dynamic       qcDataCollection;
            string        dataDirectory         = parameters.RawFileDirectory;
            string        qcDirectory           = parameters.QcParams.QcDirectory;
            string        qcSearchDataDirecotry = parameters.QcParams.QcSearchDataDirectory;
            List <string> fileList = new List <string>();

            string qcFile = Path.Combine(qcDirectory, "QC.xml");

            (fileList, qcDataCollection) = GetFileListAndQcFile(parameters);

            foreach (string fileName in fileList)
            {
                Console.WriteLine("\nProcessing {0}", fileName);

                if (!RawFileInfo.CheckIfValid(fileName))
                {
                    continue;
                }
                // okay, it is probably a real raw file, let's do the QC

                // check if the raw file already exists in the QC data with a different name
                if (CheckIfFilePresentInQcCollection(fileName, qcDataCollection))
                {
                    Log.Information("A file with the same creation date and time as {File} already exists in the QC data", fileName);

                    Console.WriteLine("A file with the same creation date and time as {File} already exists in the QC data. Skipping to next file.",
                                      fileName);

                    continue;
                }

                IRawFileThreadManager rawFileThreadManager = RawFileReaderFactory.CreateThreadManager(fileName);

                if (parameters.ExpType == ExperimentType.DDA)
                {
                    WorkFlowsDDA.QcDDA(rawFileThreadManager, parameters);
                }
                //else if (parameters.ExpType == ExperimentType.DIA)
                //{
                //    WorkFlowsDIA.QcDIA(rawFileThreadManager, parameters);
                //}

                /*
                 * using (IRawDataPlus rawFile = RawFileReaderFactory.ReadFile(fileName))
                 * {
                 *  rawFile.SelectInstrument(Device.MS, 1);
                 *
                 *  if (parameters.ExpType == ExperimentType.DDA)
                 *  {
                 *      WorkFlowsDDA.QcDDA(rawFile, parameters);
                 *  }
                 *  else if (parameters.ExpType == ExperimentType.DIA)
                 *  {
                 *      WorkFlowsDIA.QcDIA(rawFile, parameters);
                 *  }
                 * }*/

                Log.Information("QC finished: {File}", fileName);
            }

            Log.Information("QC of all files completed");
            Console.WriteLine("QC of all files completed!");
        }