Example #1
0
 public pLink_Result()
 {
     this.psms   = new ObservableCollection <pLink.PSM>();
     spectra     = new ObservableCollection <Spectra>();
     title_index = new Hashtable();
     Link_Names  = new List <string>();
     Link_masses = new List <double>();
     pLink_label = new pLink_Label();
 }
Example #2
0
        public static void load_label_information(string file_path, pLink_Label pll)
        {
            StreamReader sr = new StreamReader(file_path);

            while (!sr.EndOfStream)
            {
                string line = sr.ReadLine();
                if (line.Trim() == "")
                {
                    continue;
                }
                if (line.StartsWith("LL_INFO_LABEL"))
                {
                    string[] strs       = line.Split(new char[] { '=', ';' })[1].Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    string   label_name = strs.Last();
                    pll.Flag = 2;                     //无标记
                    if (label_name.StartsWith("R:-")) //表示交联剂的标记
                    {
                        pll.Flag = 0;
                    }
                    else if (label_name.StartsWith("R:*")) //表示肽段的标记
                    {
                        pll.Flag = 1;
                    }
                    string[] strs2 = label_name.Split(new char[] { ',', '{', '}' }, StringSplitOptions.RemoveEmptyEntries);
                    for (int start = 1; start < strs2.Length; start += 3)
                    {
                        string element_name1 = strs2[1];
                        string element_name2 = strs2[2];
                        double mass          = (double)Config_Help.element_hash[element_name1] - (double)Config_Help.element_hash[element_name2];
                        pll.Element_names.Add(element_name1);
                        pll.Masses.Add(mass);
                    }
                }
            }
            sr.Close();
        }
Example #3
0
        public List <double> get_masses(pLink_Label pll)
        {
            List <double> masses = new List <double>();

            masses.Add(0.0);
            masses.Add(0.0);
            if (pll.Flag == 1) //肽段标记
            {
                get_masses_peptide(masses, this.Pep1);
                get_masses_peptide(masses, this.Pep2);
                masses[0] = (masses[0] + Xlink_mass + this.Spec.Charge * Config_Help.massZI) / this.Spec.Charge;
                masses[1] = (masses[1] + Xlink_mass + this.Spec.Charge * Config_Help.massZI) / this.Spec.Charge;
            }
            else if (pll.Flag == 0) //交联剂标记
            {
                get_masses_peptide(masses, this.Pep1);
                get_masses_peptide(masses, this.Pep2);
                masses[1] = masses[0];
                get_masses(masses, pll.Linker_Masses);
                masses[0] = (masses[0] + this.Spec.Charge * Config_Help.massZI) / this.Spec.Charge;
                masses[1] = (masses[1] + this.Spec.Charge * Config_Help.massZI) / this.Spec.Charge;
            }
            return(masses);
        }