Beispiel #1
0
        public WiffFileReader(string wiffFilePath, string licenseFilePath)
        {
            if (string.IsNullOrWhiteSpace(wiffFilePath))
            {
                throw new ArgumentNullException("wiffFilePath");
            }
            if (string.IsNullOrWhiteSpace(licenseFilePath))
            {
                throw new ArgumentNullException("licenseFilePath");
            }
            if (!File.Exists(wiffFilePath))
            {
                throw new FileNotFoundException("Wiff file not exists.");
            }
            try
            {
                ReadWiffLicense(licenseFilePath);

                this.dataProvider = new AnalystWiffDataProvider(true);
                this.batch        = AnalystDataProviderFactory.CreateBatch(wiffFilePath, dataProvider);
                this.wiffFilePath = wiffFilePath;
                this.model        = MzLiteJson.HandleExternalModelFile(this, GetModelFilePath());
            }
            catch (Exception ex)
            {
                throw new MzLiteIOException(ex.Message, ex);
            }
        }
Beispiel #2
0
        public ThermoRawFileReader(string rawFilePath)
        {
            this.rawFilePath = rawFilePath;

            if (string.IsNullOrWhiteSpace(rawFilePath))
            {
                throw new ArgumentNullException("rawFilePath");
            }
            if (!File.Exists(rawFilePath))
            {
                throw new FileNotFoundException("Raw file not exists.");
            }

            try
            {
                rawFile = new MSFileReader_XRawfile() as IXRawfile5;
                rawFile.Open(rawFilePath);
                rawFile.SetCurrentController(0, 1);

                startScanNo = GetFirstSpectrumNumber(rawFile);
                endScanNo   = GetLastSpectrumNumber(rawFile);

                model = MzLiteJson.HandleExternalModelFile(this, GetModelFilePath());
            }
            catch (Exception ex)
            {
                throw new MzLiteIOException(ex.Message, ex);
            }
        }
Beispiel #3
0
        public BafFileReader(string bafFilePath)
        {
            if (string.IsNullOrWhiteSpace(bafFilePath))
            {
                throw new ArgumentNullException("bafFilePath");
            }
            if (!File.Exists(bafFilePath))
            {
                throw new FileNotFoundException("Baf file not exists.");
            }

            this.bafFilePath = bafFilePath;

            try
            {
                sqlFilePath = Baf2SqlWrapper.GetSQLiteCacheFilename(bafFilePath);

                // First argument = 1, ignore contents of Calibrator.ami (if it exists)
                baf2SqlHandle = Baf2SqlWrapper.baf2sql_array_open_storage(1, bafFilePath);

                if (baf2SqlHandle == 0)
                {
                    Baf2SqlWrapper.ThrowLastBaf2SqlError();
                }

                linq2BafSql = new Linq2BafSql(sqlFilePath);

                model = MzLiteJson.HandleExternalModelFile(this, GetModelFilePath());
                supportedVariables = SupportedVariablesCollection.ReadSupportedVariables(linq2BafSql);
            }
            catch (Exception ex)
            {
                throw new MzLiteIOException(ex.Message, ex);
            }
        }