Beispiel #1
0
        /*string _ProteinName;
        string _PeptideSeq;
        string _NGlycoSite;
        double _PeptideMass;
        string _GlycanComposition;
        double _GlycanMass;
        double _Y1;
        double _PPM;*/
        public FragEvents()
        {
            _id = -1;

            _TransformResult = new GlypID.HornTransform.clsHornTransformResults();

            _cid_intensity_values = new float[1];
            _cid_mz_values = new float[1];
            _CIDPeaks = new GlypID.Peaks.clsPeak[1];

            _hcd_mz_values = new float[1];
            _hcd_intensity_values = new float[1];
            _HCDPeaks = new GlypID.Peaks.clsPeak[1];

            _etd_intensity_values = new float[1];
            _etd_mz_values = new float[1];
            _ETDPeaks = new GlypID.Peaks.clsPeak[1];

            _glycanType = GlypID.enmGlycanType.NA;
            _hcdScore = 1;
            _etdScore = 0;
            _cidScore = 0;

            _hcd_scan = 0;
            _etd_scan = 0;
            _cid_scan = 0;

            _fdr = 1.0f;
            _cid_sequencing_score = 0;

            /*_ProteinName = "";
            _PeptideSeq = "";
            _NGlycoSite = "";

            _PeptideMass = 0;
            _GlycanComposition = "";
            _GlycanMass = 0;
            _PPM = 0;
            _Y1 = 0;*/

            _gp_record = new GlycopeptideRecord();
            _parent_mz = 0;
            _parent_scan =  0;
            _parent_scan_time = 0;

            _FalseHit = false;
            /*_hcd_parent_mz = 0;
            _etd_parent_mz = 0;
            _cid_parent_mz = 0;*/
        }
Beispiel #2
0
 public void ClearGPInfo()
 {
     _glycanType = GlypID.enmGlycanType.NA;
     GP_Record = new GlycopeptideRecord();
 }
Beispiel #3
0
        /// <summary>
        ///  Function to store glycopeptides
        /// </summary>
        /// <param name="sequences"> Peptide sequences</param>
        /// <param name="glycans"> Glycans</param>
        /// <param name="min_mass">Min Mass of the map</param>
        /// <param name="max_mass">Max mass of the map</param>
        public void SetGlycoPeptides(ref GlypID.Sequence.clsSequence[] sequences, ref GlypID.Glycan.clsGlycan[] glycans)
        {
            int num_gps = sequences.Length * glycans.Length;
            _glycopeptides = new List<GlycopeptideRecord>();

            for (int i = 0; i < sequences.Length; i++)
            {
                for (int j=0 ; j < glycans.Length; j++)
                {
                    GlycopeptideRecord gp = new GlycopeptideRecord();

                    gp.Sequence = sequences[i];
                    gp.SequenceAverageMass = sequences[i].CalculateSequenceMass(false) ;
                    gp.SequenceMonoMass = sequences[i].CalculateSequenceMass(true) ;

                    gp.Glycan = glycans[j];
                    gp.GlycanAverageMass = glycans[j].CalculateGlycanMass(false) ;
                    gp.GlycanMonoMass = glycans[j].CalculateGlycanMass(true) ;

                    gp.GP_Average_Mass = _utils.CalculateGPMass(gp.SequenceAverageMass, gp.GlycanAverageMass) ;
                    gp.GP_Mono_Mass = _utils.CalculateGPMass(gp.SequenceMonoMass, gp.GlycanMonoMass) ;

                    gp.IsDecoy = gp.Glycan.is_decoy | gp.Sequence.is_decoy;

                   _glycopeptides.Add(gp);
                }
            }
            //-- Sort by mono mass and create a hash table -- //
            _glycopeptides.Sort(delegate(GlycopeptideRecord g1, GlycopeptideRecord g2) { return g1.GP_Mono_Mass.CompareTo(g2.GP_Mono_Mass); });
        }
Beispiel #4
0
        public FragEvents(FragEvents e)
        {
            _id = e._id;
            _TransformResult = e._TransformResult;
            _parent_mz = e._parent_mz;
            _parent_scan = e._parent_scan;
            _parent_scan_time = e._parent_scan_time;
            _gp_record = e._gp_record;
            _glycanType = e._glycanType;

            _cid_scan = e._cid_scan;
            _cid_intensity_values = e._cid_intensity_values;
            _cid_mz_values = e._cid_mz_values;
            _CIDPeaks = e._CIDPeaks;
            _cidProfileType = e._cidProfileType;
            _cidScore = e._cidScore;
               // _cid_parent_mz = e._cid_parent_mz;

            _hcd_scan = e._hcd_scan;
            _hcd_intensity_values = e._hcd_intensity_values;
            _hcd_mz_values = e._hcd_mz_values;
            _HCDPeaks = e._HCDPeaks;
            _hcdProfileType = e._hcdProfileType;
            _hcdScore = e._hcdScore;
               // _hcd_parent_mz = e._hcd_parent_mz;

            _etd_scan = e._etd_scan;
            _etd_intensity_values = e._etd_intensity_values;
            _etd_mz_values = e._etd_mz_values;
            _ETDPeaks = e._ETDPeaks;
            _etdProfileType = e._etdProfileType;
            _etdScore = e._etdScore;
               // _etd_parent_mz = e._etd_parent_mz;

            _fdr = e._fdr;
            _cid_sequencing_score = e._cid_sequencing_score;
            _FalseHit = e._FalseHit;
        }
Beispiel #5
0
        /// <summary>
        /// Function to read in glycopeptides dictionary from file
        /// </summary>
        /// <param name="infile"></param>
        public void LoadGlycopeptidesFromFile(string infile, double min_mass, double max_mass, bool create_hash)
        {
            CSVFileHandler CsvFileHandler2 = new CSVFileHandler(infile, CSVFileHandler.READ_ONLY);
            CsvFileHandler2.openFile();
            String[] Attributes2;
            CsvFileHandler2.readLine();

            if (create_hash)
                _dGlycopeptides = new Dictionary<int, List<GlycopeptideRecord>>();
            else
                _glycopeptides = new List<GlycopeptideRecord>();

            while ((Attributes2 = CsvFileHandler2.readLine()) != null)
            {
                double gpmass = double.Parse(Attributes2[0]);

                if (gpmass >= min_mass && gpmass <= max_mass)
                {
                    GlycopeptideRecord gp = new GlycopeptideRecord();
                    gp.GP_Mono_Mass = gpmass ;
                    gp.GP_Average_Mass = double.Parse(Attributes2[1]) ;
                    gp.Sequence.proteinName = Attributes2[2] ;
                    gp.Sequence.sequence = Attributes2[3];
                    gp.Sequence.is_decoy = bool.Parse(Attributes2[4]);
                    gp.Sequence.nGlycoSite = Attributes2[5] ;
                    gp.SequenceMonoMass = double.Parse(Attributes2[6]) ;
                    gp.SequenceAverageMass = double.Parse(Attributes2[7]) ;
                    gp.Glycan.SetMonosaccharideCompostion(Attributes2[8]) ;
                    gp.Glycan.composition = Attributes2[8];
                    gp.Glycan.is_decoy = bool.Parse(Attributes2[9]) ;
                    gp.GlycanMonoMass = double.Parse(Attributes2[10]) ;
                    gp.GlycanAverageMass = double.Parse(Attributes2[11]) ;

                    gp.IsDecoy = gp.Sequence.is_decoy | gp.Glycan.is_decoy;

                    if (create_hash)
                    {
                        List<GlycopeptideRecord> value_gp_list = new List<GlycopeptideRecord>();
                        int key_mass = (int)Math.Floor(gp.GP_Mono_Mass);

                        int min_mass_int = (int)Math.Floor(min_mass);
                        int max_mass_int = (int)Math.Floor(max_mass);

                        if (!_dGlycopeptides.ContainsKey(key_mass))
                        {
                            if (value_gp_list.Count > 0)
                                value_gp_list.Clear();
                            value_gp_list.Add(gp);
                            _dGlycopeptides.Add(key_mass, value_gp_list);
                        }
                        else
                        {
                            value_gp_list.Clear();
                            value_gp_list = _dGlycopeptides[key_mass];
                            value_gp_list.Add(gp);
                            _dGlycopeptides[key_mass] = value_gp_list;

                        }
                    }
                    else
                        _glycopeptides.Add(gp);
                }
            }
            CsvFileHandler2.closeFile();
        }