Exemplo n.º 1
0
 internal SpectrumListFilterChangedEventArgs( SpectrumListForm sender, SpectrumDataSet dataSet )
 {
     matches = sender.GridView.RowCount;
     total = dataSet.SpectrumTable.Count;
 }
Exemplo n.º 2
0
        public void updateRow( SpectrumDataSet.SpectrumTableRow row, MassSpectrum spectrum )
        {
            spectrumList[spectrum.Index] = spectrum;

            Spectrum s = spectrum.Element; //GetElement(false);
            DataProcessing dp = spectrum.DataProcessing;
            Scan scan = null;
            InstrumentConfiguration ic = null;

            if(s.scanList.scans.Count > 0)
            {
                scan = s.scanList.scans[0];
                ic = scan.instrumentConfiguration;
            }

            if( dp == null )
                dp = s.dataProcessing;

            CVParam param;

            param = s.cvParam( CVID.MS_ms_level );
            row.MsLevel = !param.empty() ? (int) param.value : 0;

            param = scan != null ? scan.cvParam( CVID.MS_scan_start_time ) : new CVParam();
            row.ScanTime = !param.empty() ? (double) param.value : 0;

            param = s.cvParam( CVID.MS_base_peak_m_z );
            row.BasePeakMz = !param.empty() ? (double) param.value : 0;

            param = s.cvParam( CVID.MS_base_peak_intensity );
            row.BasePeakIntensity = !param.empty() ? (double) param.value : 0;

            param = s.cvParam( CVID.MS_total_ion_current );
            row.TotalIonCurrent = !param.empty() ? (double) param.value : 0;

            StringBuilder precursorInfo = new StringBuilder();
            if( row.MsLevel == 1 || s.precursors.Count == 0 )
                precursorInfo.Append( "n/a" );
            else
            {
                foreach( Precursor p in s.precursors )
                {
                    foreach( SelectedIon si in p.selectedIons )
                    {
                        if( precursorInfo.Length > 0 )
                            precursorInfo.Append( "," );
                        precursorInfo.Append( (double) si.cvParam( CVID.MS_selected_ion_m_z ).value );
                    }
                }
            }

            if( precursorInfo.Length == 0 )
                precursorInfo.Append( "unknown" );
            row.PrecursorInfo = precursorInfo.ToString();

            StringBuilder scanInfo = new StringBuilder();
            foreach( Scan scan2 in s.scanList.scans )
            {
                if( scan2.scanWindows.Count > 0 )
                {
                    foreach( ScanWindow sw in scan2.scanWindows )
                    {
                        if( scanInfo.Length > 0 )
                            scanInfo.Append( "," );
                        scanInfo.AppendFormat( "[{0}-{1}]",
                                              (double) sw.cvParam( CVID.MS_scan_window_lower_limit ).value,
                                              (double) sw.cvParam( CVID.MS_scan_window_upper_limit ).value );
                    }
                }
            }

            if( scanInfo.Length == 0 )
                scanInfo.Append( "unknown" );
            row.ScanInfo = scanInfo.ToString();

            row.SpotId = s.spotID;
            row.SpectrumType = s.cvParamChild( CVID.MS_spectrum_type ).name;
            row.DataPoints = s.defaultArrayLength;
            row.IcId = ( ic == null || ic.id.Length == 0 ? "unknown" : ic.id );
            row.DpId = ( dp == null || dp.id.Length == 0 ? "unknown" : dp.id );
        }