Пример #1
0
 /// <summary>
 /// Open new fileStream to mzXML file.
 /// </summary>
 /// <param name="path"></param>
 public void Open(string path, ScanReaderOptions options)
 {
     if (!System.IO.File.Exists(path)) {
         throw new IOException("File not found: " + path);
     }
     FilePath = path;
     Reader = XmlReader.Create(FilePath);
     ReadHeader();
 }
Пример #2
0
        public void Open(string path, ScanReaderOptions options)
        {
            db = new SQLiteConnection("Data Source=" + path + ";Version=3");
            db.Open();

            var metadata = new SQLiteCommand("SELECT name, value FROM metadata", db);

            using (var reader = metadata.ExecuteReader())
                while (reader.Read())
                {
                    if (((string)reader["name"]) == "compression")
                    {
                        compression = (string)reader["value"];
                    }
                }
        }
Пример #3
0
        /// <summary>
        /// Open new Raw file with warning messages.
        /// </summary>
        /// <param name="path"></param>
        public void Open(string path, ScanReaderOptions options)
        {
            Options = options;
            rawFile = RawFileReaderAdapter.FileFactory(path);
            if (!rawFile.IsOpen)
            {
                Console.WriteLine(" RawFile Error: File could not be opened: " + path);
                Console.WriteLine(rawFile.FileError.WarningMessage);
                Console.WriteLine(rawFile.FileError.ErrorMessage);
                Console.WriteLine(rawFile.FileError.ErrorCode);
                throw new IOException("Failed to open RAW file.");
            }
            if (rawFile.IsError)
            {
                Console.WriteLine(" RawFile Error: reader error: " + path);
                throw new IOException("Error while opening RAW file.");
            }

            rawFile.SelectInstrument(ThermoBiz.Device.MS, 1);
            rawFile.IncludeReferenceAndExceptionData = true;
        }