public Form1() { InitializeComponent(); rbProfTfsMhdac.Visible = false; #if ENABLE_MHDAC_TESTS rbProfTfsMhdac.Visible = true; #endif rbProfTfsIter.Visible = false; rbFrameMsIter.Visible = false; rbFrameMsArrayOfIters.Visible = false; lbFileContents.Text = "No file is yet opened."; lbFileContents2.Text = ""; gbCCS.Enabled = false; lbStatus.Text = ""; // m_currentFilePath = @"D:\Data\Asms_Demo\KnitFile.d"; m_currentFilePath = @"C:\Assembly\Test\TestData\ImsSynthChrom.d"; m_reader = null; rbAllIonsHigh.Enabled = false; rbAllIonsLow.Enabled = false; rbAllIonsAll.Enabled = false; lbStatusAllIons.Visible = false; #if PNNL_VERSION // placeholder for internal tests rbFrameMsArrayOfIters.Visible = true; #endif }
private void cbBrowse_Click(object sender, EventArgs e) { if (m_reader != null) { m_reader.Close(); } m_reader = null; BrowseForInputFile(); }
private void cbOpen_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtFilePath.Text)) { MessageBox.Show("No input file is specified"); return; } string filePath = txtFilePath.Text.Trim(); if (!Directory.Exists(filePath)) { MessageBox.Show(string.Format("Folder {0} does not exist.", filePath)); return; } if (!MidacFileAccess.FileHasImsData(filePath)) { lbFileContents.Text = "File does not have IM-MS data (not opened)"; lbFileContents2.Text = ""; gbCCS.Enabled = false; return; } if (m_reader != null) { m_reader.Close(); } m_reader = null; // Returns a reader alredy opened to the specified file path m_reader = MidacFileAccess.ImsDataReader(filePath); m_currentFilePath = filePath; // Get overall file metadata IMidacFileInfo fileInfo = m_reader.FileInfo; // show something about the contents of the file string tfsType = ""; if (m_reader.HasPeakTfsSpectra) { tfsType += "Peak"; } if (m_reader.HasProfileTfsSpectra) { tfsType += tfsType.Length > 0 ? " and Profile" : "Profile"; } lbFileContents.Text = string.Format("{0} frames with max of {1} drift bins/frame; with {2} Total Frame Spectra for each frame", fileInfo.NumFrames, fileInfo.MaxNonTfsMsPerFrame, tfsType); gbCCS.Enabled = m_reader.HasSingleFieldCcsInformation; lbFileContents2.Text = string.Format("{0} prepared for CCS conversions", m_reader.HasSingleFieldCcsInformation ? "Is" : "Is NOT"); // If there are high/low fragmentation frames, find out how many if (fileInfo.HasHiLoFragData) { IMidacMsFiltersChrom chromFilters = MidacFileAccess.DefaultMsChromFilters; chromFilters.ApplicableFilters = ApplicableFilters.FragmentationClass; chromFilters.FragmentationClass = FragmentationClass.HighEnergy; int numHighFrames = m_reader.FilteredFrameNumbers(chromFilters).Length; chromFilters.FragmentationClass = FragmentationClass.LowEnergy; int numLowFrames = m_reader.FilteredFrameNumbers(chromFilters).Length; rbAllIonsAll.Enabled = true; rbAllIonsHigh.Enabled = true; rbAllIonsLow.Enabled = true; lbStatusAllIons.Visible = true; lbStatusAllIons.Text = string.Format("{0} High-CE frames; {1} Low-CE frames", numHighFrames, numLowFrames); } else { rbAllIonsAll.Enabled = false; rbAllIonsHigh.Enabled = false; rbAllIonsLow.Enabled = false; lbStatusAllIons.Visible = false; } // Force read of some data before we start; gets some assertions out of the way. IMidacUnitConverter converter = m_reader.FrameInfo(1).FrameUnitConverter; }