private void resetButton_Click(object sender, EventArgs e)
        {
            resetButton.Enabled                = false;
            context.Visible                    = true;
            helpLabel.Visible                  = true;
            successfullyCut                    = false;
            enzymeCombo.Enabled                = true;
            cutSiteLabel.Visible               = true;
            pushClockwiseButton.Enabled        = true;
            pushCounterclockwiseButton.Enabled = true;
            cutBeginningButton.Enabled         = true;
            cutEndButton.Enabled               = true;
            cornerBox2.Top    -= baseDisplaySize * 3;
            cornerBox1.Visible = true;
            cornerBox3.Visible = true;
            cornerBox4.Visible = true;
            string newDNA;

            switch (newDNAcombo.SelectedIndex)
            {
            case 0:
                newDNA = pAMP_DNA;
                break;

            case 1:
                newDNA = pKAN_DNA;
                break;

            case 2:
                newDNA = humira_DNA;
                break;

            case 3:
                newDNA = humulin_DNA;
                break;

            default:
                newDNA = pAMP_DNA;
                break;
            }
            plasmid = BasePair.createFromString(newDNA);
            //DNA_Index = startPicker.Next(plasmid.Length);
            DNA_Index  = 0;
            chosenGene = newDNAcombo.Text;
            if (chosenGene == "Humira" || chosenGene == "Humulin")
            {
                completeLoop = false;
            }
            if (chosenGene == "pKAN" || chosenGene == "pAMP")
            {
                completeLoop = true;
            }
            cutBeginning = -1;
            cutEnd       = -1;
            displayPanel.Refresh();
        }
        public static BasePair[] createFromStringBottom(string dna)
        {
            BasePair[] returnValue = new BasePair[dna.Length];
            int        i           = 0;

            foreach (char value in dna)
            {
                returnValue[i] = new BasePair(value, false);
                i++;
            }
            return(returnValue);
        }
 public geneCutter()
 {
     InitializeComponent();
     this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
     this.Text = "Gene Merger | " + Globals.name + " - " + Globals.period;
     plasmid   = BasePair.createFromString(pAMP_DNA);
     enzymeCombo.SelectedIndex = 0;
     //DNA_Index = startPicker.Next(plasmid.Length);
     DNA_Index = 0;
     newDNAcombo.SelectedIndex = 0;
     chosenGene              = "pAMP";
     ecoAMPcheck.Checked     = Globals.ecoAMPcut;
     bamAMPcheck.Checked     = Globals.bamAMPcut;
     ecoKANcheck.Checked     = Globals.ecoKANcut;
     bamKANcheck.Checked     = Globals.bamKANcut;
     ecoHumulinCheck.Checked = Globals.ecoHumulinCut;
     bamHumulinCheck.Checked = Globals.bamHumulinCut;
     ecoHumiraCheck.Checked  = Globals.ecoHumiraCut;
     bamHumiraCheck.Checked  = Globals.bamHumiraCut;
     resetButton.Enabled     = false;
 }
Exemple #4
0
        private void insertGene(object sender, System.EventArgs e)
        {
            Button clickedButton = (Button)sender;

            if (clickedButton.Name.Contains("1"))
            {
                switch (clickedButton.Name.Substring(0, clickedButton.Name.Length - 1))
                {
                case "ecoAMPbutton":
                    leftCutSite = ecoCutSite;
                    leftPlasmid = "ecoAMP";
                    leftTop     = BasePair.createFromString(Globals.ecoAMPcutSite.Substring(0, 8));
                    leftBottom  = BasePair.createFromString(Globals.ecoAMPcutSite.Substring(3, Globals.ecoAMPcutSite.Length - 3));
                    break;

                case "bamAMPbutton":
                    leftCutSite = bamCutSite;
                    leftPlasmid = "bamAMP";
                    leftTop     = BasePair.createFromString(Globals.bamAMPcutSite.Substring(0, 8));
                    leftBottom  = BasePair.createFromString(Globals.bamAMPcutSite.Substring(3, Globals.bamAMPcutSite.Length - 3));
                    break;

                case "ecoKANbutton":
                    leftCutSite = ecoCutSite;
                    leftPlasmid = "ecoKAN";
                    leftTop     = BasePair.createFromString(Globals.ecoKANcutSite.Substring(0, 8));
                    leftBottom  = BasePair.createFromString(Globals.ecoKANcutSite.Substring(3, Globals.ecoKANcutSite.Length - 3));
                    break;

                case "bamKANbutton":
                    leftCutSite = bamCutSite;
                    leftPlasmid = "bamKAN";
                    leftTop     = BasePair.createFromString(Globals.bamKANcutSite.Substring(0, 8));
                    leftBottom  = BasePair.createFromString(Globals.bamKANcutSite.Substring(3, Globals.bamKANcutSite.Length - 3));
                    break;

                case "ecoHumiraButton":
                    leftPlasmid = "ecoHumira";
                    leftCutSite = ecoCutSite;
                    leftTop     = BasePair.createFromString(Globals.ecoHumiraCutSite.Substring(0, 8));
                    leftBottom  = BasePair.createFromString(Globals.ecoHumiraCutSite.Substring(3, Globals.ecoHumiraCutSite.Length - 3));
                    break;

                case "bamHumiraButton":
                    leftPlasmid = "bamHumira";
                    leftCutSite = bamCutSite;
                    leftTop     = BasePair.createFromString(Globals.bamHumiraCutSite.Substring(0, 8));
                    leftBottom  = BasePair.createFromString(Globals.bamHumiraCutSite.Substring(3, Globals.bamHumiraCutSite.Length - 3));
                    break;

                case "ecoHumulinButton":
                    leftPlasmid = "ecoHumulin";
                    leftCutSite = ecoCutSite;
                    leftTop     = BasePair.createFromString(Globals.ecoHumulinCutSite.Substring(0, 8));
                    leftBottom  = BasePair.createFromString(Globals.ecoHumulinCutSite.Substring(3, Globals.ecoHumulinCutSite.Length - 3));
                    break;

                case "bamHumulinButton":
                    leftPlasmid = "bamHumulin";
                    leftCutSite = bamCutSite;
                    leftTop     = BasePair.createFromString(Globals.bamHumulinCutSite.Substring(0, 8));
                    leftBottom  = BasePair.createFromString(Globals.bamHumulinCutSite.Substring(3, Globals.bamHumulinCutSite.Length - 3));
                    break;
                }
            }
            else if (clickedButton.Name.Contains("2"))
            {
                switch (clickedButton.Name.Substring(0, clickedButton.Name.Length - 1))
                {
                case "ecoAMPbutton":
                    rightCutSite = ecoCutSite;
                    rightPlasmid = "ecoAMP";
                    rightTop     = BasePair.createFromString(Globals.ecoAMPcutSite.Substring(0, 8));
                    rightBottom  = BasePair.createFromString(Globals.ecoAMPcutSite.Substring(3, Globals.ecoAMPcutSite.Length - 3));
                    break;

                case "bamAMPbutton":
                    rightCutSite = bamCutSite;
                    rightPlasmid = "bamAMP";
                    rightTop     = BasePair.createFromString(Globals.bamAMPcutSite.Substring(0, 8));
                    rightBottom  = BasePair.createFromString(Globals.bamAMPcutSite.Substring(3, Globals.bamAMPcutSite.Length - 3));
                    break;

                case "ecoKANbutton":
                    rightCutSite = ecoCutSite;
                    rightPlasmid = "ecoKAN";
                    rightTop     = BasePair.createFromString(Globals.ecoKANcutSite.Substring(0, 8));
                    rightBottom  = BasePair.createFromString(Globals.ecoKANcutSite.Substring(3, Globals.ecoKANcutSite.Length - 3));
                    break;

                case "bamKANbutton":
                    rightCutSite = bamCutSite;
                    rightPlasmid = "bamKAN";
                    rightTop     = BasePair.createFromString(Globals.bamKANcutSite.Substring(0, 8));
                    rightBottom  = BasePair.createFromString(Globals.bamKANcutSite.Substring(3, Globals.bamKANcutSite.Length - 3));
                    break;

                case "ecoHumiraButton":
                    rightPlasmid = "ecoHumira";
                    rightCutSite = ecoCutSite;
                    rightTop     = BasePair.createFromString(Globals.ecoHumiraCutSite.Substring(0, 8));
                    rightBottom  = BasePair.createFromString(Globals.ecoHumiraCutSite.Substring(3, Globals.ecoHumiraCutSite.Length - 3));
                    break;

                case "bamHumiraButton":
                    rightPlasmid = "bamHumira";
                    rightCutSite = bamCutSite;
                    rightTop     = BasePair.createFromString(Globals.bamHumiraCutSite.Substring(0, 8));
                    rightBottom  = BasePair.createFromString(Globals.bamHumiraCutSite.Substring(3, Globals.bamHumiraCutSite.Length - 3));
                    break;

                case "ecoHumulinButton":
                    rightPlasmid = "ecoHumulin";
                    rightCutSite = ecoCutSite;
                    rightTop     = BasePair.createFromString(Globals.ecoHumulinCutSite.Substring(0, 8));
                    rightBottom  = BasePair.createFromString(Globals.ecoHumulinCutSite.Substring(3, Globals.ecoHumulinCutSite.Length - 3));
                    break;

                case "bamHumulinButton":
                    rightPlasmid = "bamHumulin";
                    rightCutSite = bamCutSite;
                    rightTop     = BasePair.createFromString(Globals.bamHumulinCutSite.Substring(0, 8));
                    rightBottom  = BasePair.createFromString(Globals.bamHumulinCutSite.Substring(3, Globals.bamHumulinCutSite.Length - 3));
                    break;
                }
            }
            combinePanel.Refresh();
            if (leftTop != null && leftBottom != null && rightTop != null && rightBottom != null)
            {
                merge();
            }
        }