コード例 #1
0
 public Chromatogram(ManagedDataSource source, int index, ChromatogramList chromatogramList)
 {
     this.source           = source;
     this.chromatogramList = chromatogramList;
     this.index            = index;
     //element = chromatogram;
     id = Element.id;
     //index = element.index;
 }
コード例 #2
0
        public void UpdateRow(int rowIndex, ChromatogramList chromatogramList)
        {
            ChromatogramDataSet.ChromatogramTableRow row = (chromatogramBindingSource[rowIndex] as DataRowView).Row as ChromatogramDataSet.ChromatogramTableRow;

            if (chromatogramList != null)
            {
                this.chromatogramList[row.Index].ChromatogramList = chromatogramList;
                updateRow(row, this.chromatogramList[row.Index]);
                //dp = rowChromatogram.DataProcessing;
                //row.Tag = rowChromatogram = new Chromatogram( rowChromatogram, s );
                //rowChromatogram.DataProcessing = dp;
            }
            else
            {
                updateRow(row, this.chromatogramList[row.Index]);
                //s = rowChromatogram.Element;
                //dp = rowChromatogram.DataProcessing;
            }
        }
コード例 #3
0
        private void listView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            if (listView.SelectedItems.Count > 1)
            {
                List <string> dataSourceList = new List <string>();
                foreach (ListViewItem item in listView.SelectedItems)
                {
                    if (item.SubItems[1].Text != "File Folder")
                    {
                        dataSourceList.Add(String.Format("\"{0}\"", item.SubItems[0].Text));
                    }
                }
                sourcePathTextBox.Text = String.Join(" ", dataSourceList.ToArray());

                ticGraphControl.GraphPane.GraphObjList.Clear();
                ticGraphControl.GraphPane.CurveList.Clear();
                ticGraphControl.Visible = false;
            }
            else if (listView.SelectedItems.Count > 0)
            {
                sourcePathTextBox.Text = listView.SelectedItems[0].SubItems[0].Text;

                ticGraphControl.GraphPane.GraphObjList.Clear();
                ticGraphControl.GraphPane.CurveList.Clear();

                string sourcePath = Path.Combine(CurrentDirectory, sourcePathTextBox.Text);
                string sourceType = getSourceType(sourcePath);
                if (!String.IsNullOrEmpty(sourceType) &&
                    sourceType != "File Folder")
                {
                    using (MSDataFile msData = new MSDataFile(sourcePath))
                        using (ChromatogramList cl = msData.run.chromatogramList)
                        {
                            if (cl != null && !cl.empty() && cl.find("TIC") != cl.size())
                            {
                                ticGraphControl.Visible = true;
                                pwiz.CLI.msdata.Chromatogram tic = cl.chromatogram(cl.find("TIC"), true);
                                Map <double, double>         sortedFullPointList = new Map <double, double>();
                                IList <double> timeList      = tic.binaryDataArrays[0].data;
                                IList <double> intensityList = tic.binaryDataArrays[1].data;
                                int            arrayLength   = timeList.Count;
                                for (int i = 0; i < arrayLength; ++i)
                                {
                                    sortedFullPointList[timeList[i]] = intensityList[i];
                                }
                                ZedGraph.PointPairList points = new ZedGraph.PointPairList(
                                    new List <double>(sortedFullPointList.Keys).ToArray(),
                                    new List <double>(sortedFullPointList.Values).ToArray());
                                ZedGraph.LineItem item = ticGraphControl.GraphPane.AddCurve("TIC", points, Color.Black, ZedGraph.SymbolType.None);
                                item.Line.IsAntiAlias = true;
                                ticGraphControl.AxisChange();
                                ticGraphControl.Refresh();
                            }
                            else
                            {
                                ticGraphControl.Visible = false;
                            }
                        }
                }
                else
                {
                    ticGraphControl.Visible = false;
                }
            }
            else
            {
                sourcePathTextBox.Text = "";
            }
        }
コード例 #4
0
ファイル: Manager.cs プロジェクト: AlexandreBurel/pwiz-mzdb
 public Chromatogram GetChromatogram( Chromatogram metaChromatogram, ChromatogramList chromatogramList )
 {
     Chromatogram chromatogram = new Chromatogram( metaChromatogram, chromatogramList.chromatogram( metaChromatogram.Index, true ) );
     return chromatogram;
 }
コード例 #5
0
ファイル: Manager.cs プロジェクト: AlexandreBurel/pwiz-mzdb
 public Chromatogram GetChromatogram( int index, ChromatogramList chromatogramList )
 {
     return new Chromatogram( this, index, chromatogramList );
 }
コード例 #6
0
        public void UpdateRow( int rowIndex, ChromatogramList chromatogramList )
        {
            ChromatogramDataSet.ChromatogramTableRow row = ( chromatogramBindingSource[rowIndex] as DataRowView ).Row as ChromatogramDataSet.ChromatogramTableRow;

            if( chromatogramList != null )
            {
                this.chromatogramList[row.Index].ChromatogramList = chromatogramList;
                updateRow( row, this.chromatogramList[row.Index] );
                //dp = rowChromatogram.DataProcessing;
                //row.Tag = rowChromatogram = new Chromatogram( rowChromatogram, s );
                //rowChromatogram.DataProcessing = dp;
            } else
            {
                updateRow( row, this.chromatogramList[row.Index] );
                //s = rowChromatogram.Element;
                //dp = rowChromatogram.DataProcessing;
            }
        }
コード例 #7
0
        private void listView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            string sourcePath = null;
            string sourceType = null;
            int    runIndex   = 0;

            if (listView.SelectedItems.Count > 0)
            {
                List <string> dataSourceList = new List <string>();
                foreach (ListViewItem item in listView.SelectedItems)
                {
                    var sourceInfo = item.Tag as SourceInfo;
                    if (sourceInfo != null)
                    {
                        dataSourceList.Add(sourceInfo.path.ToString());
                        sourcePath = sourceInfo.path.Filepath;
                        sourceType = sourceInfo.type;
                        runIndex   = sourceInfo.path.RunIndex;
                    }
                    else
                    {
                        dataSourceList.Add(item.SubItems[0].Text);
                        sourcePath = Path.Combine(CurrentDirectory, sourcePathTextBox.Text);
                        sourceType = getSourceType(sourcePath);
                    }
                }
                sourcePathTextBox.Text = $"\"{String.Join("\" \"", dataSourceList.ToArray())}\"";
            }

            ticGraphControl.GraphPane.GraphObjList.Clear();
            ticGraphControl.GraphPane.CurveList.Clear();
            if (listView.SelectedItems.Count != 1)
            {
                ticGraphControl.Visible = false;
                return;
            }

            if (!String.IsNullOrEmpty(sourceType) &&
                sourceType != "File Folder")
            {
                using (MSData msd = new MSData())
                {
                    ReaderList.FullReaderList.read(sourcePath, msd, runIndex, SpectrumSource.GetReaderConfig());
                    using (ChromatogramList cl = msd.run.chromatogramList)
                    {
                        if (cl != null && !cl.empty() && cl.find("TIC") != cl.size())
                        {
                            ticGraphControl.Visible = true;
                            pwiz.CLI.msdata.Chromatogram tic = cl.chromatogram(cl.find("TIC"), true);
                            Map <double, double>         sortedFullPointList = new Map <double, double>();
                            IList <double> timeList      = tic.binaryDataArrays[0].data;
                            IList <double> intensityList = tic.binaryDataArrays[1].data;
                            int            arrayLength   = timeList.Count;
                            for (int i = 0; i < arrayLength; ++i)
                            {
                                sortedFullPointList[timeList[i]] = intensityList[i];
                            }
                            ZedGraph.PointPairList points = new ZedGraph.PointPairList(
                                new List <double>(sortedFullPointList.Keys).ToArray(),
                                new List <double>(sortedFullPointList.Values).ToArray());
                            ZedGraph.LineItem item = ticGraphControl.GraphPane.AddCurve("TIC", points, Color.Black, ZedGraph.SymbolType.None);
                            item.Line.IsAntiAlias = true;
                            ticGraphControl.AxisChange();
                            ticGraphControl.Refresh();
                        }
                        else
                        {
                            ticGraphControl.Visible = false;
                        }
                    }
                }
            }
            else
            {
                ticGraphControl.Visible = false;
            }
        }
コード例 #8
0
ファイル: MsDataFileImpl.cs プロジェクト: lgatto/proteowizard
 public void Dispose()
 {
     if (_spectrumList != null)
         _spectrumList.Dispose();
     _spectrumList = null;
     if (_chromatogramList != null)
         _chromatogramList.Dispose();
     _chromatogramList = null;
     if (_msDataFile != null)
         _msDataFile.Dispose();
     _msDataFile = null;
 }