/// <summary> /// ReadDb(Matrix ID specification) /// </summary> /// <param name="selMatrixId">Matrix ID</param> public void ReadDb(int selMatrixId) { Clear(); IdentificationManagerWrapper managerWrapper = IdentificationManagerWrapper.getInstance(); // Get matrix ID list int[] matrixIdArray = managerWrapper.getMatrices(); if (matrixIdArray == null) { this.SelectedMatrixId = MATRIX_ID_NONE; return; } _matrixIdList = matrixIdArray.ToList(); // Get matrix name list foreach (int item in _matrixIdList) { // the number of Matrix ID loop _matrixNameList.Add(managerWrapper.getMatrixName(item)); } foreach (int matrixId in _matrixIdList) { if (matrixId == selMatrixId) { this.SelectedMatrixId = selMatrixId; GetDBData(this.SelectedMatrixId); return; } } }
/// <summary> /// Get DB data /// </summary> /// <param name="selMatrixId">Selected matrix ID</param> private void GetDBData(int selMatrixId) { if (selMatrixId >= MATRIX_ID_MIN) { // Matrix Selected IdentificationManagerWrapper managerWrapper = IdentificationManagerWrapper.getInstance(); // Get group ID list int[] groupIdArray = managerWrapper.getGroups(selMatrixId); if (groupIdArray != null) { _groupIdList = groupIdArray.ToList(); // Get group name list, group color list foreach (int item in _groupIdList) { // the number of group ID loop _groupNameList.Add(managerWrapper.getGroupName(item)); _groupColorList.Add(managerWrapper.getGroupColor(item)); // Get sample ID list int[] sampleIdArray = managerWrapper.getMatrixSamplesFromGroup(item); if (sampleIdArray == null) { return; } _sampleIdList.Add(sampleIdArray.ToList()); // Get sample name list List <string> sampleNameList = new List <string>(); sampleNameList.Clear(); foreach (int sampleId in _sampleIdList.Last()) { // the number of sample ID loop string sampleName = managerWrapper.getMatrixSampleName(sampleId); sampleNameList.Add(sampleName); } _sampleNameList.Add(sampleNameList); } } // Get peak ID list int[] peakIdArray = managerWrapper.getMatrixPeaks(selMatrixId); if (peakIdArray != null) { _peakIdList = peakIdArray.ToList(); foreach (int item in _peakIdList) { // the number of peak ID loop _peakRtList.Add(managerWrapper.getMatrixPeakRt(item)); _peakMzList.Add(managerWrapper.getMatrixPeakMz(item)); } } } }
/// <summary> /// Graph ChangeSelectItem event handler /// </summary> /// <param name="sender">sender</param> /// <param name="e">event args</param> private void Graph_ChangeSelectItem(object sender, UserControlSimcaGraph.SelectItemEventArgs e) { if (!_checkBoxSyncQuant.Checked) { return; } bool activeTab = false; switch ((TAB_ID)_tabControlPlot.SelectedIndex) { case TAB_ID.SCORE_PLOT: if ((UserControlSimcaGraph)sender == _graphScore) { activeTab = true; } break; case TAB_ID.LOADING_PLOT: if ((UserControlSimcaGraph)sender == _graphLoading) { activeTab = true; } break; case TAB_ID.S_PLOT: if ((UserControlSimcaGraph)sender == _graphSPlot) { activeTab = true; } break; default: break; } if (!activeTab) { return; } // Renewal of an emphasis display IdentificationManagerWrapper managerWrapper = IdentificationManagerWrapper.getInstance(); managerWrapper.clearFocusedPeaks(); // clear if (e.SelectItemArray != null) { foreach (int peakId in e.SelectItemArray) { managerWrapper.addFocusedPeak(peakId); if (e.DoubleClick) { managerWrapper.activatePeak(peakId); } } } ClrPluginCallTool.refresh(); }