示例#1
0
        //查看一个序列中的是否包含修饰,返回蛋白protein中的modification修饰列表的索引位置
        private static void update_protein_modification(Protein protein, ObservableCollection <PSM> psms)
        {
            List <Protein_Mod> modification = new List <Protein_Mod>();

            for (int i = 0; i < protein.psm_index.Count; ++i)
            {
                string        mod_sits = psms[protein.psm_index[i]].Mod_sites;
                List <string> mods     = Modification.get_modSites_list(mod_sits);
                for (int p = 0; p < mods.Count; ++p)
                {
                    Protein_Mod mod_tmp = new Protein_Mod(mods[p]);
                    int         index   = modification.IndexOf(mod_tmp);
                    if (index == -1)
                    {
                        modification.Add(mod_tmp);
                    }
                    else
                    {
                        ++modification[index].mod_count;
                    }
                }
            }
            modification.Sort();
            protein.modification = modification;
        }
示例#2
0
 public bool Equals(Protein_Mod other)
 {
     if (other == null)
     {
         return(false);
     }
     return(this.modification.Equals(other.modification));  // && this.mod_index.Equals(other.mod_index)
 }
示例#3
0
        int IComparable.CompareTo(Object obj)
        {
            Protein_Mod temp = (Protein_Mod)obj;

            if (this.mod_count < temp.mod_count)
            {
                return(1);
            }
            else if (this.mod_count > temp.mod_count)
            {
                return(-1);
            }
            return(0);
        }
示例#4
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            Protein_Mod temp = obj as Protein_Mod;

            if (temp == null)
            {
                return(false);
            }
            else
            {
                return(Equals(temp));
            }
        }
示例#5
0
        public static List <Protein_Modification> get_modSites_list(int start, int peptide_length, string modStr, Protein protein)
        {
            List <Protein_Modification> mods = new List <Protein_Modification>();

            string[] all_mod = modStr.Split(';');
            for (int i = 0; i < all_mod.Length - 1; ++i)
            {
                string[] one_mod       = all_mod[i].Split(',');
                int      peptide_index = int.Parse(one_mod[0]);
                if (peptide_index == 0)
                {
                    peptide_index = 1;
                }
                else if (peptide_index == peptide_length + 1)
                {
                    peptide_index = peptide_length;
                }
                string      mod_name = one_mod[1].Split('#')[0];
                Protein_Mod mod_tmp  = new Protein_Mod(mod_name);
                mods.Add(new Protein_Modification(start + peptide_index - 1, protein.modification.IndexOf(mod_tmp)));
            }
            return(mods);
        }