예제 #1
0
        public int Color_flag = 2; //0:N_color, 1:C_color, 2:A_color
        public MS2_Denovol_Setting(MS2_Help ms2_help, Denovol_Help den_help)
        {
            InitializeComponent();
            this.Ms2_help     = ms2_help;
            this.Denovol_help = den_help;
            if (Display_Help.IsEqual(this.Denovol_help.b_color, this.Denovol_help.current_color))
            {
                Color_flag = 0;
            }
            else if (Display_Help.IsEqual(this.Denovol_help.y_color, this.Denovol_help.current_color))
            {
                Color_flag = 1;
            }
            else if (Display_Help.IsEqual(this.Denovol_help.default_color, this.Denovol_help.current_color))
            {
                Color_flag = 2;
            }
            Color n_color = Color.FromArgb(this.Denovol_help.b_color.A, this.Denovol_help.b_color.R,
                                           this.Denovol_help.b_color.G, this.Denovol_help.b_color.B);
            Color c_color = Color.FromArgb(this.Denovol_help.y_color.A, this.Denovol_help.y_color.R,
                                           this.Denovol_help.y_color.G, this.Denovol_help.y_color.B);
            Color a_color = Color.FromArgb(this.Denovol_help.default_color.A, this.Denovol_help.default_color.R,
                                           this.Denovol_help.default_color.G, this.Denovol_help.default_color.B);

            this.N_btn.Background = new SolidColorBrush(n_color);
            this.C_btn.Background = new SolidColorBrush(c_color);
            this.A_btn.Background = new SolidColorBrush(a_color);
        }
예제 #2
0
 public Pnovol_Result_Window(List <Pnovo_Result> Pnovo_results, MS2_Help ms2_help)
 {
     InitializeComponent();
     this.Pnovo_results = new ObservableCollection <Pnovo_Result>(Pnovo_results);
     this.pNovo_result_grid.ItemsSource = this.Pnovo_results;
     this.MS2_help = ms2_help;
 }
예제 #3
0
        private void update(object sender, RoutedEventArgs e)
        {
            this.mainWindow.Dis_help.ddh.Font_SQ              = this.Font.Text;
            this.mainWindow.Dis_help.ddh.Font_BY              = this.Font.Text;
            this.mainWindow.Dis_help.ddh.Match_StrokeWidth    = double.Parse(this.MatchWeight.Text);
            this.mainWindow.Dis_help.ddh.NoNMatch_StrokeWidth = double.Parse(this.NoMatchWeight.Text);
            this.mainWindow.Dis_help.ddh.ME_Weight            = double.Parse(this.MZWeight.Text);
            this.mainWindow.Dis_help.ddh.FontSize_SQ          = double.Parse(this.FontSize.Text);
            this.mainWindow.Dis_help.ddh.FontSize_BY          = this.mainWindow.Dis_help.ddh.FontSize_SQ * 5 / 8;
            this.mainWindow.Dis_help.ddh.A_Match_Color        = this.A_color;
            this.mainWindow.Dis_help.ddh.B_Match_Color        = this.B_color;
            this.mainWindow.Dis_help.ddh.C_Match_Color        = this.C_color;
            this.mainWindow.Dis_help.ddh.X_Match_Color        = this.X_color;
            this.mainWindow.Dis_help.ddh.Y_Match_Color        = this.Y_color;
            this.mainWindow.Dis_help.ddh.Z_Match_Color        = this.Z_color;
            this.mainWindow.Dis_help.ddh.M_Match_Color        = this.M_color;
            this.mainWindow.Dis_help.ddh.I_Match_Color        = this.I_color;
            this.mainWindow.Dis_help.ddh.O_Match_Color        = this.O_color;
            if (changed_ladder)
            {
                this.mainWindow.Dis_help.ddh.FontSize_SQ = 0.0;
                this.mainWindow.Dis_help.ddh.FontSize_BY = 0.0;
            }
            MS2_Help ms2_help = new MS2_Help(this.mainWindow.Model2, this.mainWindow.Dis_help, Ladder_Help.Scale_Width, Ladder_Help.Scale_Height);

            ms2_help.window_sizeChg_Or_ZoomPan();
            //this.Close();
        }
예제 #4
0
        public Denovol_Help(PlotModel model, PSM_Help_Parent psm_help, MS2_Help ms2_help)
        {
            this.Model    = model;
            this.Psm_help = psm_help;
            this.Ms2_help = ms2_help;

            current_color = default_color;
        }
예제 #5
0
        private void Window_sizeChg(object sender, SizeChangedEventArgs e)
        {
            this.scale_width  = this.scale_width * this.ActualWidth / this.width;
            this.scale_height = this.scale_height * this.ActualHeight / this.height;
            this.width        = this.ActualWidth;
            this.height       = this.ActualHeight;
            MS2_Help ms2_help = new MS2_Help(Model, dis_help, this.scale_width, this.scale_height);

            ms2_help.window_sizeChg_Or_ZoomPan();
        }
예제 #6
0
        public Model_Window(PlotModel Model, Display_Help dis_help, double width, double height) //绘制二级匹配图
        {
            InitializeComponent();
            this.scale_width  = Ladder_Help.Scale_Width;
            this.scale_height = Ladder_Help.Scale_Height;
            this.width        = width;
            this.height       = height;
            this.Model        = Model;
            MS2_Help ms2_help = new MS2_Help(Model, dis_help, scale_width, scale_height);

            this.Model.Axes[1].AxisChanged += (s, e) =>
            {
                ms2_help = new MS2_Help(Model, dis_help, scale_width, scale_height);
                ms2_help.window_sizeChg_Or_ZoomPan();
            };
            this.dis_help    = dis_help;
            this.model.Model = this.Model;
            ms2_help.window_sizeChg_Or_ZoomPan();
            this.SizeChanged += Window_sizeChg;
            this.Title        = "PSM Figure";
        }
예제 #7
0
 public Model_Window_DeNovo(MainWindow mainW, PlotModel Model, Display_Help dis_help, double width, double height) //绘制二级匹配图
 {
     InitializeComponent();
     this.scale_width                = Ladder_Help.Scale_Width;
     this.scale_height               = Ladder_Help.Scale_Height;
     this.width                      = width;
     this.height                     = height;
     this.Model                      = Model;
     this.mainW                      = mainW;
     ms2_help                        = new MS2_Help(Model, dis_help, scale_width, scale_height);
     ms2_help.Den_help.isDenovol     = true;
     this.Model.Axes[1].AxisChanged += (s, e) =>
     {
         //ms2_help = new MS2_Help(Model, dis_help, scale_width, scale_height);
         //ms2_help.isDenovol = true;
         ms2_help.window_sizeChg_Or_ZoomPan();
     };
     this.dis_help    = dis_help;
     this.model.Model = this.Model;
     ms2_help.window_sizeChg_Or_ZoomPan();
     this.SizeChanged   += Window_sizeChg;
     this.Title          = "De novol";
     this.Original_Peaks = new List <PEAK>(dis_help.Psm_help.Spec.Peaks);
 }
예제 #8
0
        private void update(object sender, RoutedEventArgs e)
        {
            pep1_flag = this.pep1_label_cbx.SelectedIndex;
            pep2_flag = this.pep2_label_cbx.SelectedIndex;
            PSM_Help_2 psm_help_2 = this.mainW.Dis_help.Psm_help as PSM_Help_2;

            psm_help_2.Pep1 = new Peptide(this.pep1_sq_tbx.Text);
            string mods_str        = get_modification_str(0);
            double pep_theory_mass = 0.0;

            psm_help_2.Pep1.Tag_Flag = pep1_flag + 1;
            psm_help_2.Pep1.Mods     = Modification.get_modSites(psm_help_2.Pep1.Sq, mods_str, psm_help_2.Pep1.Tag_Flag, ref pep_theory_mass);
            psm_help_2.Pep2          = new Peptide(this.pep2_sq_tbx.Text);
            mods_str = get_modification_str(1);
            psm_help_2.Pep2.Tag_Flag = pep2_flag + 1;
            psm_help_2.Pep2.Mods     = Modification.get_modSites(psm_help_2.Pep2.Sq, mods_str, psm_help_2.Pep2.Tag_Flag, ref pep_theory_mass);
            ComboBoxItem item = this.link_cbx.SelectedItem as ComboBoxItem;

            psm_help_2.Xlink_mass = (double)Config_Help.link_hash[item.Content as string];
            int index1 = 0, index2 = 0;

            if (!isLinkPosition_right(this.link_position_tbx.Text, ref index1, ref index2))
            {
                MessageBox.Show("xLink position has error!");
                return;
            }
            psm_help_2.Link_pos1         = index1;
            psm_help_2.Link_pos2         = index2;
            PSM_Help_2.isNormal          = (bool)this.normal_ckb.IsChecked;
            PSM_Help_2.isInternal        = (bool)this.internal_ckb.IsChecked;
            this.mainW.Dis_help.Psm_help = psm_help_2;
            MS2_Help ms2_help = new MS2_Help(this.mainW.Model2, this.mainW.Dis_help, Ladder_Help.Scale_Width, Ladder_Help.Scale_Height);

            mainW.new_peptide = psm_help_2.Pep1;
            ms2_help.window_sizeChg_Or_ZoomPan();
        }
예제 #9
0
        private void update(object sender, RoutedEventArgs e)
        {
            if (mainW.Dis_help.Psm_help == null)
            {
                return;
            }
            //查看你选择了哪些匹配离子
            for (int i = 0; i < 3; ++i)
            {
                for (int j = 0; j < charge_num; ++j)
                {
                    if (Ion_Check[i * charge_num + j].IsChecked == true)
                    {
                        mainW.Dis_help.Psm_help.M_Match_Flag[i * charge_num + j] = 1;
                    }
                    else
                    {
                        mainW.Dis_help.Psm_help.M_Match_Flag[i * charge_num + j] = 0;
                    }
                }
            }
            for (int i = 3; i < 21; ++i)
            {
                for (int j = 0; j < charge_num; ++j)
                {
                    if (Ion_Check[i * charge_num + j].IsChecked == true)
                    {
                        if (i < 12)
                        {
                            mainW.Dis_help.Psm_help.N_Match_Flag[(i - 3) * charge_num + j] = 1;
                        }
                        else
                        {
                            mainW.Dis_help.Psm_help.C_Match_Flag[(i - 12) * charge_num + j] = 1;
                        }
                    }
                    else
                    {
                        if (i < 12)
                        {
                            mainW.Dis_help.Psm_help.N_Match_Flag[(i - 3) * charge_num + j] = 0;
                        }
                        else
                        {
                            mainW.Dis_help.Psm_help.C_Match_Flag[(i - 12) * charge_num + j] = 0;
                        }
                    }
                }
            }
            int internal_index = 21;

            for (int j = 0; j < charge_num; ++j)
            {
                if (Ion_Check[internal_index * charge_num + j].IsChecked == true)
                {
                    mainW.Dis_help.Psm_help.I_Match_Flag[j] = 1;
                }
                else
                {
                    mainW.Dis_help.Psm_help.I_Match_Flag[j] = 0;
                }
            }
            int immon_index = 22;

            for (int j = 0; j < charge_num; ++j)
            {
                if (Ion_Check[immon_index * charge_num + j].IsChecked == true)
                {
                    mainW.Dis_help.Psm_help.O_Match_Flag[j] = 1;
                }
                else
                {
                    mainW.Dis_help.Psm_help.O_Match_Flag[j] = 0;
                }
            }
            //
            mainW.Dis_help.Psm_help.Pep.Sq = this.seq.Text;
            string ppm = this.ppm_chk.Text;

            try
            {
                if (ppm == "ppm")
                {
                    mainW.Dis_help.Psm_help.Ppm_mass_error = double.Parse(this.tol.Text) * 1.0e-6;
                    mainW.Dis_help.Psm_help.Da_mass_error  = 0.0;
                    if (mainW.Dis_help.Psm_help.Ppm_mass_error == 0.0)
                    {
                        return;
                    }
                }
                else
                {
                    mainW.Dis_help.Psm_help.Da_mass_error  = double.Parse(this.tol.Text);
                    mainW.Dis_help.Psm_help.Ppm_mass_error = 0.0;
                    if (mainW.Dis_help.Psm_help.Da_mass_error == 0.0)
                    {
                        return;
                    }
                }
                mainW.Dis_help.Psm_help.Pep.Mods.Clear();
                string mods_str = "";
                if (mod_Sites[0].Mod != non_mod)
                {
                    int index = 0;
                    for (int l = 0; l < Config_Help.mod_label_name.Count(); ++l)
                    {
                        if (mod_Sites[0].Mod_Flag == Config_Help.mod_label_name[l])
                        {
                            index = l;
                            break;
                        }
                    }
                    mods_str += "0," + mod_Sites[0].Mod + "#" + index + ";";
                    //mainW.Dis_help.Psm_help.Pep.Mods.Add(new Modification(0, (double)Config_Help.modStr_hash[mod_Sites[0].Mod], mod_Sites[0].Mod));
                }
                for (int k = 0; k < mainW.Dis_help.Psm_help.Pep.Sq.Length; ++k)
                {
                    if (mod_Sites[k + 1].Mod != non_mod)
                    {
                        int index = 0;
                        for (int l = 0; l < Config_Help.mod_label_name.Count(); ++l)
                        {
                            if (mod_Sites[k + 1].Mod_Flag == Config_Help.mod_label_name[l])
                            {
                                index = l;
                                break;
                            }
                        }
                        mods_str += (k + 1) + "," + mod_Sites[k + 1].Mod + "#" + index + ";";
                        //mainW.Dis_help.Psm_help.Pep.Mods.Add(new Modification(k + 1, (double)Config_Help.modStr_hash[mod_Sites[k + 1].Mod], mod_Sites[k + 1].Mod));
                    }
                }
                if (mod_Sites[mainW.Dis_help.Psm_help.Pep.Sq.Length + 1].Mod != non_mod)
                {
                    int index = 0;
                    for (int l = 0; l < Config_Help.mod_label_name.Count(); ++l)
                    {
                        if (mod_Sites[mainW.Dis_help.Psm_help.Pep.Sq.Length + 1].Mod_Flag == Config_Help.mod_label_name[l])
                        {
                            index = l;
                            break;
                        }
                    }
                    mods_str += (mainW.Dis_help.Psm_help.Pep.Sq.Length + 1) + "," + mod_Sites[mainW.Dis_help.Psm_help.Pep.Sq.Length + 1].Mod + "#" + index + ";";
                    //mainW.Dis_help.Psm_help.Pep.Mods.Add(new Modification(mainW.Dis_help.Psm_help.Pep.Sq.Length + 1, (double)Config_Help.modStr_hash[mod_Sites[mainW.Dis_help.Psm_help.Pep.Sq.Length + 1].Mod], mod_Sites[mainW.Dis_help.Psm_help.Pep.Sq.Length + 1].Mod));
                }
                double pep_theory_mass = 0.0;
                if (mainW.selected_psm != null)
                {
                    mainW.Dis_help.Psm_help.Pep.Mods = Modification.get_modSites(mainW.Dis_help.Psm_help.Pep.Sq, mods_str, int.Parse(mainW.selected_psm.Pep_flag), ref pep_theory_mass);
                }
                else
                {
                    mainW.Dis_help.Psm_help.Pep.Mods = Modification.get_modSites(mainW.Dis_help.Psm_help.Pep.Sq, mods_str, 0, ref pep_theory_mass);
                }
                mainW.Dis_help.Psm_help.Pep.Pepmass = pep_theory_mass;
                //mainW.Dis_help.Psm_help.aa_index = this.aa_index_comboBox.SelectedIndex + 1;
                mainW.Dis_help.Psm_help.Pep.Tag_Flag = this.aa_index_comboBox.SelectedIndex + 1;
                mainW.psm_help = mainW.Dis_help.Psm_help as PSM_Help;
                MS2_Help ms2_help = new MS2_Help(this.mainW.Model2, this.mainW.Dis_help, Ladder_Help.Scale_Width, Ladder_Help.Scale_Height);
                mainW.new_peptide = mainW.Dis_help.Psm_help.Pep;
                ms2_help.window_sizeChg_Or_ZoomPan();
            }
            catch (Exception exe)
            {
                return;
            }
        }