Пример #1
0
        public static void WriteSearchMGF(QcParameters qcParameters, RawDataCollection rawData, IRawDataPlus rawFile, bool fixedScans = false)
        {
            var pars = qcParameters.searchParameters;

            int[] scans = AdditionalMath.SelectRandomScans(scans: rawData.scanIndex.ScanEnumerators[MSOrderType.Ms2], num: pars.NumSpectra, fixedScans: fixedScans);
            MGF.WriteMGF(rawData, rawFile, qcParameters.QcSearchDataDirectory, pars.MgfMassCutoff, scans, pars.MgfIntensityCutoff);
        }
Пример #2
0
        public static void WriteSearchMGF(WorkflowParameters parameters, CentroidStreamCollection centroids, SegmentScanCollection segments, RetentionTimeCollection retentionTimes,
                                          PrecursorMassCollection precursorMasses, PrecursorScanCollection precursorScans, TrailerExtraCollection trailerExtras, MethodDataContainer methodData,
                                          ScanIndex index, string rawFileName, bool fixedScans = false)
        {
            var pars = parameters.QcParams.SearchParameters;

            int[] scans = AdditionalMath.SelectRandomScans(scans: index.ScanEnumerators[MSOrderType.Ms2],
                                                           num: parameters.QcParams.NumberSpectra, fixedScans: parameters.QcParams.FixedScans);

            string mgfFile = ReadWrite.GetPathToFile(parameters.QcParams.QcSearchDataDirectory, rawFileName, ".mgf");

            MgfWriter.WriteMGF(rawFileName, centroids, segments, parameters, retentionTimes, precursorMasses, precursorScans,
                               trailerExtras, methodData, index, outputFile: mgfFile, scans: scans);
        }
Пример #3
0
        public static void RunIdentipy(RawDataCollection rawData, IRawDataPlus rawFile, string QcDataDirectory, SearchParameters idpyPars, bool writeMGF = true)
        {
            int[]  scans;
            string pyExec, idpyScript, mgfFile;

            // get the path to the python executable and identipy start script if they have not been specified
            if (idpyPars.PythonExecutable == null & idpyPars.IdentipyScript == null)
            {
                string pyDir = GetPythonDir();
                pyExec     = GetPythonExec(pyDir);
                idpyScript = GetIdentipyExec(pyDir);
                Log.Information("Found python directory: {PyDir}", pyDir);
                Log.Information("Found python executable: {PyExec}", pyExec);
                Log.Information("Found identipy start script: {IdpyScript}", idpyScript);
            }
            else
            {
                pyExec     = idpyPars.PythonExecutable;
                idpyScript = idpyPars.IdentipyScript;
            }

            if (writeMGF)
            {
                // get a random subset of scans
                scans = AdditionalMath.SelectRandomScans(scans: rawData.scanIndex.ScanEnumerators[MSOrderType.Ms2], num: idpyPars.NumSpectra);

                // write them to a mgf file
                MGF.WriteMGF(rawData, rawFile, QcDataDirectory, scans: scans, cutoff: idpyPars.MgfMassCutoff, intensityCutoff: idpyPars.MgfIntensityCutoff);
            }

            // recreate the path to the mgf
            mgfFile = Path.Combine(QcDataDirectory, Path.GetFileName(rawData.rawFileName) + ".mgf");

            // run identipy, supresseing RunTimeWarnings
            //IdentipyExecute(idpyExec, idpyPars.FastaDatabase, idpyPars.FixedMods, idpyPars.VariableMods, mgfFile);
            Console.WriteLine("Starting Identipy");
            Log.Information("Starting Identipy");
            IdentipyExecute(pyExec, idpyScript, mgfFile, idpyPars, rawData.methodData.MassAnalyzers[MSOrderType.Ms2]);
        }