Exemplo n.º 1
0
        public void criticalErrorInPeakDetectorTest1()
        {
            UIMFRun run = new DeconTools.Backend.Runs.UIMFRun(fpgaUIMFFilePath2);

            FrameSetCollectionCreator ffcc = new FrameSetCollectionCreator(run, 425, 432, 3, 1);

            ffcc.Create();

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 1, 500, 9, 1);

            sscc.Create();

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

            DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector();

            peakDet.PeakBackgroundRatio = 4;
            peakDet.SigNoiseThreshold   = 3;


            foreach (var frame in run.FrameSetCollection.FrameSetList)
            {
                run.CurrentFrameSet = frame;

                foreach (var scan in run.ScanSetCollection.ScanSetList)
                {
                    run.CurrentScanSet = scan;

                    msgen.Execute(run.ResultCollection);
                    peakDet.Execute(run.ResultCollection);
                }
            }
        }
Exemplo n.º 2
0
        public void checkIntegrityOfUIMF_RawDataTest1()
        {
            UIMFRun run = new DeconTools.Backend.Runs.UIMFRun(fpgaUIMFFilePath2);

            FrameSetCollectionCreator ffcc = new FrameSetCollectionCreator(run, 696, 696, 3, 1);

            ffcc.Create();

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 350, 500, 9, 1);

            sscc.Create();

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

            DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector();

            peakDet.PeakBackgroundRatio = 6;
            peakDet.SigNoiseThreshold   = 3;


            StringBuilder sb = new StringBuilder();


            sb.Append("frame\tscan\tmaxIntens\tnumZeros\n");

            foreach (var frame in run.FrameSetCollection.FrameSetList)
            {
                run.CurrentFrameSet = frame;

                foreach (var scan in run.ScanSetCollection.ScanSetList)
                {
                    run.CurrentScanSet = scan;

                    msgen.Execute(run.ResultCollection);

                    List <int> indices = getIndicesOf0MZValues(run.XYData.Xvalues);

                    double maxY = run.XYData.GetMaxY();


                    if (indices.Count > -1)
                    {
                        sb.Append(frame.PrimaryFrame);
                        sb.Append("\t");
                        sb.Append(scan.PrimaryScanNumber);
                        sb.Append("\t");
                        sb.Append(maxY);
                        sb.Append("\t");
                        sb.Append(indices.Count);
                        sb.Append("\n");
                    }
                }
            }

            Console.WriteLine(sb.ToString());
        }
Exemplo n.º 3
0
        public void examineFPGAUIMFTest1()
        {
            Run run = new DeconTools.Backend.Runs.UIMFRun(fpgaUIMFFilePath);

            FrameSetCollectionCreator ffcc = new FrameSetCollectionCreator(run, 1, 1, 1, 1);

            ffcc.Create();

            ScanSetCollectionCreator sscc = new ScanSetCollectionCreator(run, 285, 285, 9, 1);

            sscc.Create();

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

            DeconToolsPeakDetector peakDet = new DeconToolsPeakDetector();

            peakDet.PeakBackgroundRatio = 6;
            peakDet.SigNoiseThreshold   = 3;

            HornDeconvolutor decon = new HornDeconvolutor();

            decon.MinPeptideBackgroundRatio = 5;


            foreach (var scanset in run.ScanSetCollection.ScanSetList)
            {
                run.CurrentScanSet             = scanset;
                ((UIMFRun)run).CurrentFrameSet = new FrameSet(1);
                msgen.Execute(run.ResultCollection);

                peakDet.Execute(run.ResultCollection);

                decon.Execute(run.ResultCollection);
            }
        }
Exemplo n.º 4
0
        public Run CreateRun(string filename)
        {
            Run run;

            var fullfileName = getFullPath(filename);

            var extension = Path.GetExtension(fullfileName).ToLower();

            if (extension.Equals(".mzxml") || extension.Equals(".mzml") || extension.Equals(".mz5"))
            {
                pwiz.ProteowizardWrapper.DependencyLoader.ValidateLoader();
            }

#if !Disable_DeconToolsV2
            //check for ICR2LS type extension....
            var match = Regex.Match(extension, @"\.\d\d\d\d\d$");
            if (match.Success)
            {
                return(new ICR2LSRun(fullfileName));
            }
#endif

            var fileNameWithoutPathOrExtension = Path.GetFileNameWithoutExtension(fullfileName).ToLower();

            var dirInfo  = new DirectoryInfo(fullfileName);
            var isFolder = dirInfo.Exists;

            if (isFolder)
            {
                run = determineIfRunIsABrukerTypeAndCreateRun(fullfileName);

                if (run != null)
                {
                    return(run);
                }
                else
                {
                    // there was likely some problem... but will let the remaining code execute and see if ms filetype can
                    // be determined from the extension.
                }
            }


            switch (extension)
            {
            case ".raw":
                run = new XCaliburRun2(fullfileName);
                break;

#if !Disable_DeconToolsV2
            case ".imf":
                run = new IMFRun(fullfileName);
                break;
#endif
            case ".txt":
                run = new MSScanFromTextFileRun(fullfileName);
                break;

            case ".mzxml":
                run = new MzRun(fullfileName);
                break;

            case ".mz5":
                run = new MzRun(fullfileName);
                break;

            case ".mzml":
                run = new MzRun(fullfileName);
                break;

            case ".uimf":
                run = new UIMFRun(fullfileName);
                break;

            case ".db":                                //might want to remove this later
                run = new UIMFRun(fullfileName);
                break;

            case ".d":
                run = new AgilentDRun(fullfileName);
                break;

            // Deprecated in February 2017
            // case ".yafms":
            //     run = new YAFMSRun(fullfileName);
            //     break;

            default:
                throw new ApplicationException("File type - " + extension + " -  is not supported in DeconTools");
            }

            Check.Require(run != null, "Run failed to be initialized. Run object is empty. I'm guessing the datafile either 1) corrupt or 2) not supported by the installed instrument manufacturer's dlls, or 3) not supported by DeconTools");
            return(run);
        }
Exemplo n.º 5
0
        public Run CreateRun(Globals.MSFileType filetype, string f)
        {
            Run run;

            if (filetype == Globals.MSFileType.MZXML_Rawdata)
            {
                pwiz.ProteowizardWrapper.DependencyLoader.ValidateLoader();
            }

            var fileName = getFullPath(f);

            switch (filetype)
            {
            case Globals.MSFileType.Undefined:
                run = null;
                break;

            case Globals.MSFileType.Agilent_WIFF:
                run = null;
                break;

            case Globals.MSFileType.Agilent_D:
                run = new AgilentDRun(fileName);
                break;

            case Globals.MSFileType.Ascii:
                run = new MSScanFromTextFileRun(fileName);
                break;

            case Globals.MSFileType.Bruker:
                run = new BrukerV3Run(fileName);
                break;

#if !Disable_DeconToolsV2
            case Globals.MSFileType.Bruker_V2:
                run = new BrukerV2Run(fileName);
                break;
#endif
            case Globals.MSFileType.Bruker_Ascii:
                run = null;
                break;

            case Globals.MSFileType.Finnigan:
                run = new XCaliburRun2(fileName);
                break;

            case Globals.MSFileType.ICR2LS_Rawdata:
                run = null;
                break;

            case Globals.MSFileType.Micromass_Rawdata:
                run = null;
                break;

            case Globals.MSFileType.MZXML_Rawdata:
                run = new MzRun(fileName);
                break;

#if !Disable_DeconToolsV2
            case Globals.MSFileType.PNNL_IMS:
                run = new IMFRun(fileName);
                break;
#endif
            case Globals.MSFileType.PNNL_UIMF:
                run = new UIMFRun(fileName);
                break;

            case Globals.MSFileType.SUNEXTREL:
                run = null;
                break;

            // Deprecated in February 2017
            // case Globals.MSFileType.YAFMS:
            //    run = new YAFMSRun(fileName);
            //    break;
            default:
                run = null;
                break;
            }

            return(run);
        }