コード例 #1
0
 public void Close()
 {
     Raw.Close();
 }
コード例 #2
0
ファイル: Class1.cs プロジェクト: leiwang-me/COL_Lib
        public Class1(string argFileName, int argScanNo)
        {
            _scanNum  = argScanNo;
            _filename = argFileName;
            GlypID.HornTransform.clsHornTransform           Transform            = new GlypID.HornTransform.clsHornTransform();
            GlypID.Peaks.clsPeakProcessor                   cidPeakProcessor     = new GlypID.Peaks.clsPeakProcessor();
            GlypID.Peaks.clsPeakProcessor                   parentPeakProcessor  = new GlypID.Peaks.clsPeakProcessor();
            GlypID.HornTransform.clsHornTransformParameters transform_parameters = new GlypID.HornTransform.clsHornTransformParameters();
            GlypID.Peaks.clsPeakProcessorParameters         peak_parameters      = new GlypID.Peaks.clsPeakProcessorParameters();
            Raw = new GlypID.Readers.clsRawData(_filename, GlypID.Readers.FileType.FINNIGAN);

            Raw.GetSpectrum(_scanNum, ref _cidMzs, ref _cidIntensities);

            Transform.TransformParameters = transform_parameters;

            _msLevel = Raw.GetMSLevel(_scanNum);

            if (_msLevel > 1)
            {
                _parentScanNum = Raw.GetParentScan(_scanNum);
                _parentMz      = (float)Raw.GetParentMz(_scanNum);
            }
            else
            {
                return; //MS scan
            }
            Raw.GetSpectrum(_parentScanNum, ref _parentRawMzs, ref _parentRawIntensitys);

            _cidPeaks = new GlypID.Peaks.clsPeak[1];
            cidPeakProcessor.ProfileType = GlypID.enmProfileType.CENTROIDED;
            cidPeakProcessor.DiscoverPeaks(ref _cidMzs, ref _cidIntensities, ref _cidPeaks,
                                           Convert.ToSingle(transform_parameters.MinMZ), Convert.ToSingle(transform_parameters.MaxMZ), false);
            _parentPeaks = new GlypID.Peaks.clsPeak[1];
            parentPeakProcessor.ProfileType = GlypID.enmProfileType.PROFILE;
            parentPeakProcessor.DiscoverPeaks(ref _parentRawMzs, ref _parentRawIntensitys, ref _parentPeaks,
                                              Convert.ToSingle(transform_parameters.MinMZ), Convert.ToSingle(transform_parameters.MaxMZ), true);
            _parentBackgroundIntensity = (float)parentPeakProcessor.GetBackgroundIntensity(ref _parentRawIntensitys);
            double min_peptide_intensity = _parentBackgroundIntensity * transform_parameters.PeptideMinBackgroundRatio;

            if (transform_parameters.UseAbsolutePeptideIntensity)
            {
                if (min_peptide_intensity < transform_parameters.AbsolutePeptideIntensity)
                {
                    min_peptide_intensity = transform_parameters.AbsolutePeptideIntensity;
                }
            }
            _transformResult = new GlypID.HornTransform.clsHornTransformResults[1];
            bool found = Transform.FindPrecursorTransform(Convert.ToSingle(_parentBackgroundIntensity), Convert.ToSingle(min_peptide_intensity), ref _parentRawMzs, ref _parentRawIntensitys, ref _parentPeaks, Convert.ToSingle(_parentMz), ref _transformResult);

            if (Raw.IsFTScan(_parentScanNum))
            {
                // High resolution data
                found = Transform.FindPrecursorTransform(Convert.ToSingle(_parentBackgroundIntensity), Convert.ToSingle(min_peptide_intensity), ref _parentRawMzs, ref _parentRawIntensitys, ref _parentPeaks, Convert.ToSingle(_parentMz), ref _transformResult);
            }
            if (!found)
            {
                // Low resolution data or bad high res spectra
                short cs = Raw.GetMonoChargeFromHeader(_scanNum);
                if (cs > 0)
                {
                    short[] charges = new short[1];
                    charges[0] = cs;
                    Transform.AllocateValuesToTransform(Convert.ToSingle(_parentMz), 500, ref charges, ref _transformResult);
                }
                else
                {
                    // instrument has no charge just store 2 and 3.
                    short[] charges = new short[2];
                    charges[0] = 2;
                    charges[1] = 3;
                    Transform.AllocateValuesToTransform(Convert.ToSingle(_parentMz), 500, ref charges, ref _transformResult);
                }
            }

            _parentMonoMW = (float)_transformResult[0].mdbl_mono_mw;
            _parentCharge = (int)_transformResult[0].mshort_cs;
            MaxIntensityPeak();

            Raw.Close();
        }
コード例 #3
0
ファイル: Class1.cs プロジェクト: chpaul/COL_Lib
        public Class1(string argFileName,int argScanNo)
        {
            _scanNum = argScanNo;
            _filename = argFileName;
            GlypID.HornTransform.clsHornTransform Transform = new GlypID.HornTransform.clsHornTransform();
            GlypID.Peaks.clsPeakProcessor cidPeakProcessor = new GlypID.Peaks.clsPeakProcessor();
            GlypID.Peaks.clsPeakProcessor parentPeakProcessor = new GlypID.Peaks.clsPeakProcessor();
            GlypID.HornTransform.clsHornTransformParameters transform_parameters = new GlypID.HornTransform.clsHornTransformParameters();
            GlypID.Peaks.clsPeakProcessorParameters peak_parameters = new GlypID.Peaks.clsPeakProcessorParameters();
            Raw = new GlypID.Readers.clsRawData(_filename, GlypID.Readers.FileType.FINNIGAN);

            Raw.GetSpectrum(_scanNum, ref _cidMzs, ref _cidIntensities);

            Transform.TransformParameters = transform_parameters;

            _msLevel = Raw.GetMSLevel(_scanNum);

            if (_msLevel > 1)
            {
                _parentScanNum = Raw.GetParentScan(_scanNum);
                _parentMz = (float)Raw.GetParentMz(_scanNum);
            }
            else
            {
                return; //MS scan
            }
            Raw.GetSpectrum(_parentScanNum, ref _parentRawMzs, ref _parentRawIntensitys);

            _cidPeaks = new GlypID.Peaks.clsPeak[1];
            cidPeakProcessor.ProfileType = GlypID.enmProfileType.CENTROIDED;
            cidPeakProcessor.DiscoverPeaks(ref _cidMzs, ref _cidIntensities, ref _cidPeaks,
                        Convert.ToSingle(transform_parameters.MinMZ), Convert.ToSingle(transform_parameters.MaxMZ), false);
            _parentPeaks = new GlypID.Peaks.clsPeak[1];
            parentPeakProcessor.ProfileType = GlypID.enmProfileType.PROFILE;
            parentPeakProcessor.DiscoverPeaks(ref _parentRawMzs, ref _parentRawIntensitys, ref _parentPeaks,
                        Convert.ToSingle(transform_parameters.MinMZ), Convert.ToSingle(transform_parameters.MaxMZ), true);
            _parentBackgroundIntensity = (float)parentPeakProcessor.GetBackgroundIntensity(ref _parentRawIntensitys);
            double min_peptide_intensity = _parentBackgroundIntensity * transform_parameters.PeptideMinBackgroundRatio;

            if (transform_parameters.UseAbsolutePeptideIntensity)
            {
                if (min_peptide_intensity < transform_parameters.AbsolutePeptideIntensity)
                    min_peptide_intensity = transform_parameters.AbsolutePeptideIntensity;
            }
            _transformResult = new GlypID.HornTransform.clsHornTransformResults[1];
            bool found = Transform.FindPrecursorTransform(Convert.ToSingle(_parentBackgroundIntensity), Convert.ToSingle(min_peptide_intensity), ref _parentRawMzs, ref _parentRawIntensitys, ref _parentPeaks, Convert.ToSingle(_parentMz), ref _transformResult);
            if (Raw.IsFTScan(_parentScanNum))
            {
                // High resolution data
                found = Transform.FindPrecursorTransform(Convert.ToSingle(_parentBackgroundIntensity), Convert.ToSingle(min_peptide_intensity), ref _parentRawMzs, ref _parentRawIntensitys, ref _parentPeaks, Convert.ToSingle(_parentMz), ref _transformResult);
            }
            if (!found)
            {
                // Low resolution data or bad high res spectra
                short cs = Raw.GetMonoChargeFromHeader(_scanNum);
                if (cs > 0)
                {
                    short[] charges = new short[1];
                    charges[0] = cs;
                    Transform.AllocateValuesToTransform(Convert.ToSingle(_parentMz),500, ref charges, ref _transformResult);

                }
                else
                {
                    // instrument has no charge just store 2 and 3.
                    short[] charges = new short[2];
                    charges[0] = 2;
                    charges[1] = 3;
                    Transform.AllocateValuesToTransform(Convert.ToSingle(_parentMz), 500,ref charges, ref _transformResult);
                }
            }

            _parentMonoMW = (float)_transformResult[0].mdbl_mono_mw;
            _parentCharge = (int)_transformResult[0].mshort_cs;
            MaxIntensityPeak();

            Raw.Close();
        }