⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 核酸双序列比对程序
💻 CS
📖 第 1 页 / 共 3 页
字号:
			// 
			// matrixd
			// 
			this.matrixd.AccessibleDescription = resources.GetString("matrixd.AccessibleDescription");
			this.matrixd.AccessibleName = resources.GetString("matrixd.AccessibleName");
			this.matrixd.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("matrixd.Anchor")));
			this.matrixd.AutoSize = ((bool)(resources.GetObject("matrixd.AutoSize")));
			this.matrixd.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("matrixd.BackgroundImage")));
			this.matrixd.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("matrixd.Dock")));
			this.matrixd.Enabled = ((bool)(resources.GetObject("matrixd.Enabled")));
			this.matrixd.Font = ((System.Drawing.Font)(resources.GetObject("matrixd.Font")));
			this.matrixd.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("matrixd.ImeMode")));
			this.matrixd.Location = ((System.Drawing.Point)(resources.GetObject("matrixd.Location")));
			this.matrixd.MaxLength = ((int)(resources.GetObject("matrixd.MaxLength")));
			this.matrixd.Multiline = ((bool)(resources.GetObject("matrixd.Multiline")));
			this.matrixd.Name = "matrixd";
			this.matrixd.PasswordChar = ((char)(resources.GetObject("matrixd.PasswordChar")));
			this.matrixd.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("matrixd.RightToLeft")));
			this.matrixd.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("matrixd.ScrollBars")));
			this.matrixd.Size = ((System.Drawing.Size)(resources.GetObject("matrixd.Size")));
			this.matrixd.TabIndex = ((int)(resources.GetObject("matrixd.TabIndex")));
			this.matrixd.Text = resources.GetString("matrixd.Text");
			this.matrixd.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("matrixd.TextAlign")));
			this.matrixd.Visible = ((bool)(resources.GetObject("matrixd.Visible")));
			this.matrixd.WordWrap = ((bool)(resources.GetObject("matrixd.WordWrap")));
			// 
			// label4
			// 
			this.label4.AccessibleDescription = resources.GetString("label4.AccessibleDescription");
			this.label4.AccessibleName = resources.GetString("label4.AccessibleName");
			this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("label4.Anchor")));
			this.label4.AutoSize = ((bool)(resources.GetObject("label4.AutoSize")));
			this.label4.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("label4.Dock")));
			this.label4.Enabled = ((bool)(resources.GetObject("label4.Enabled")));
			this.label4.Font = ((System.Drawing.Font)(resources.GetObject("label4.Font")));
			this.label4.Image = ((System.Drawing.Image)(resources.GetObject("label4.Image")));
			this.label4.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label4.ImageAlign")));
			this.label4.ImageIndex = ((int)(resources.GetObject("label4.ImageIndex")));
			this.label4.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("label4.ImeMode")));
			this.label4.Location = ((System.Drawing.Point)(resources.GetObject("label4.Location")));
			this.label4.Name = "label4";
			this.label4.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("label4.RightToLeft")));
			this.label4.Size = ((System.Drawing.Size)(resources.GetObject("label4.Size")));
			this.label4.TabIndex = ((int)(resources.GetObject("label4.TabIndex")));
			this.label4.Text = resources.GetString("label4.Text");
			this.label4.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label4.TextAlign")));
			this.label4.Visible = ((bool)(resources.GetObject("label4.Visible")));
			// 
			// optimalalign
			// 
			this.optimalalign.AccessibleDescription = resources.GetString("optimalalign.AccessibleDescription");
			this.optimalalign.AccessibleName = resources.GetString("optimalalign.AccessibleName");
			this.optimalalign.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("optimalalign.Anchor")));
			this.optimalalign.AutoSize = ((bool)(resources.GetObject("optimalalign.AutoSize")));
			this.optimalalign.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("optimalalign.Dock")));
			this.optimalalign.Enabled = ((bool)(resources.GetObject("optimalalign.Enabled")));
			this.optimalalign.Font = ((System.Drawing.Font)(resources.GetObject("optimalalign.Font")));
			this.optimalalign.Image = ((System.Drawing.Image)(resources.GetObject("optimalalign.Image")));
			this.optimalalign.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("optimalalign.ImageAlign")));
			this.optimalalign.ImageIndex = ((int)(resources.GetObject("optimalalign.ImageIndex")));
			this.optimalalign.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("optimalalign.ImeMode")));
			this.optimalalign.Location = ((System.Drawing.Point)(resources.GetObject("optimalalign.Location")));
			this.optimalalign.Name = "optimalalign";
			this.optimalalign.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("optimalalign.RightToLeft")));
			this.optimalalign.Size = ((System.Drawing.Size)(resources.GetObject("optimalalign.Size")));
			this.optimalalign.TabIndex = ((int)(resources.GetObject("optimalalign.TabIndex")));
			this.optimalalign.Text = resources.GetString("optimalalign.Text");
			this.optimalalign.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("optimalalign.TextAlign")));
			this.optimalalign.Visible = ((bool)(resources.GetObject("optimalalign.Visible")));
			// 
			// oplign
			// 
			this.oplign.AccessibleDescription = resources.GetString("oplign.AccessibleDescription");
			this.oplign.AccessibleName = resources.GetString("oplign.AccessibleName");
			this.oplign.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("oplign.Anchor")));
			this.oplign.AutoSize = ((bool)(resources.GetObject("oplign.AutoSize")));
			this.oplign.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("oplign.BackgroundImage")));
			this.oplign.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("oplign.Dock")));
			this.oplign.Enabled = ((bool)(resources.GetObject("oplign.Enabled")));
			this.oplign.Font = ((System.Drawing.Font)(resources.GetObject("oplign.Font")));
			this.oplign.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("oplign.ImeMode")));
			this.oplign.Location = ((System.Drawing.Point)(resources.GetObject("oplign.Location")));
			this.oplign.MaxLength = ((int)(resources.GetObject("oplign.MaxLength")));
			this.oplign.Multiline = ((bool)(resources.GetObject("oplign.Multiline")));
			this.oplign.Name = "oplign";
			this.oplign.PasswordChar = ((char)(resources.GetObject("oplign.PasswordChar")));
			this.oplign.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("oplign.RightToLeft")));
			this.oplign.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("oplign.ScrollBars")));
			this.oplign.Size = ((System.Drawing.Size)(resources.GetObject("oplign.Size")));
			this.oplign.TabIndex = ((int)(resources.GetObject("oplign.TabIndex")));
			this.oplign.Text = resources.GetString("oplign.Text");
			this.oplign.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("oplign.TextAlign")));
			this.oplign.Visible = ((bool)(resources.GetObject("oplign.Visible")));
			this.oplign.WordWrap = ((bool)(resources.GetObject("oplign.WordWrap")));
			// 
			// label5
			// 
			this.label5.AccessibleDescription = resources.GetString("label5.AccessibleDescription");
			this.label5.AccessibleName = resources.GetString("label5.AccessibleName");
			this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("label5.Anchor")));
			this.label5.AutoSize = ((bool)(resources.GetObject("label5.AutoSize")));
			this.label5.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("label5.Dock")));
			this.label5.Enabled = ((bool)(resources.GetObject("label5.Enabled")));
			this.label5.Font = ((System.Drawing.Font)(resources.GetObject("label5.Font")));
			this.label5.Image = ((System.Drawing.Image)(resources.GetObject("label5.Image")));
			this.label5.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label5.ImageAlign")));
			this.label5.ImageIndex = ((int)(resources.GetObject("label5.ImageIndex")));
			this.label5.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("label5.ImeMode")));
			this.label5.Location = ((System.Drawing.Point)(resources.GetObject("label5.Location")));
			this.label5.Name = "label5";
			this.label5.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("label5.RightToLeft")));
			this.label5.Size = ((System.Drawing.Size)(resources.GetObject("label5.Size")));
			this.label5.TabIndex = ((int)(resources.GetObject("label5.TabIndex")));
			this.label5.Text = resources.GetString("label5.Text");
			this.label5.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label5.TextAlign")));
			this.label5.Visible = ((bool)(resources.GetObject("label5.Visible")));
			// 
			// indent
			// 
			this.indent.AccessibleDescription = resources.GetString("indent.AccessibleDescription");
			this.indent.AccessibleName = resources.GetString("indent.AccessibleName");
			this.indent.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("indent.Anchor")));
			this.indent.AutoSize = ((bool)(resources.GetObject("indent.AutoSize")));
			this.indent.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("indent.BackgroundImage")));
			this.indent.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("indent.Dock")));
			this.indent.Enabled = ((bool)(resources.GetObject("indent.Enabled")));
			this.indent.Font = ((System.Drawing.Font)(resources.GetObject("indent.Font")));
			this.indent.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("indent.ImeMode")));
			this.indent.Location = ((System.Drawing.Point)(resources.GetObject("indent.Location")));
			this.indent.MaxLength = ((int)(resources.GetObject("indent.MaxLength")));
			this.indent.Multiline = ((bool)(resources.GetObject("indent.Multiline")));
			this.indent.Name = "indent";
			this.indent.PasswordChar = ((char)(resources.GetObject("indent.PasswordChar")));
			this.indent.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("indent.RightToLeft")));
			this.indent.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("indent.ScrollBars")));
			this.indent.Size = ((System.Drawing.Size)(resources.GetObject("indent.Size")));
			this.indent.TabIndex = ((int)(resources.GetObject("indent.TabIndex")));
			this.indent.Text = resources.GetString("indent.Text");
			this.indent.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("indent.TextAlign")));
			this.indent.Visible = ((bool)(resources.GetObject("indent.Visible")));
			this.indent.WordWrap = ((bool)(resources.GetObject("indent.WordWrap")));
			// 
			// Form1
			// 
			this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
			this.AccessibleName = resources.GetString("$this.AccessibleName");
			this.AutoScale = false;
			this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
			this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
			this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
			this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
			this.Controls.Add(this.indent);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.oplign);
			this.Controls.Add(this.optimalalign);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.matrixd);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.button3);
			this.Controls.Add(this.button2);
			this.Controls.Add(this.textBox3);
			this.Controls.Add(this.textBox2);
			this.Controls.Add(this.textBox1);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label1);
			this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
			this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
			this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
			this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
			this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
			this.Name = "Form1";
			this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
			this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
			this.Text = resources.GetString("$this.Text");
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}
        //function p:scores method
		public int p(char si,char tj)
		{
		   if(si=='a'||si=='c'||si=='g'||si=='t')
				{
					if(tj=='a'||tj=='c'||tj=='g'||tj=='t')
					{
						if(si==tj)
						{
							return 1;
						}
						else 
						{
							return 0;
						}
					}
					
					else 
					{
					
						return -1;
					}
				}
			else 
				{
					return -1;
					
				}
				
		
		}
	   //function max:gain the maximum.
		public int max(int x1,int x2,int x3)
		{
			if(x1>=x2)
			{
				if(x1>=x3)
				{
					return x1;
				}
				else 
				{
					return x3;
				}
			}
			else
			{
				if(x2<x3)
				{
					return x3;
				}
				else 
				{
					return x2;
				}
			}

		}
		//function abs:gain the absolute value
		public int abs(int x)
		{
			if(x<0)
			{
				return -1*x;
			}
			else
			{
				return x;
			}
		}
       //alignment
		private void button1_Click(object sender, System.EventArgs e)
		{
			//clear the score matrix
			matrixd.Clear();
			oplign.Clear();
			indent.Clear();
			//
			Form2 form2= new Form2();
			Form3 form3= new Form3();
			if(textBox1.Text=="")
				form2.Show();
			else 
				if(textBox2.Text=="")
				form3.Show();
			else 
			{ 
				//
				char[] seqs=new char[100];
				char[] seqa=new char[100];
				char[] seq1=new char[100];
				char[] seq2=new char[100];
				
				//
				string str1,str2;
				int score=0;
				str1=textBox1.Text;
				str2=textBox2.Text;
				seq1=str1.ToCharArray(0,str1.Length);
				for(int i=0;i<seq1.Length;i+=1)
					seqs[i]=seq1[i];
				seq2=str2.ToCharArray(0,str2.Length);
				for(int i=0;i<seq2.Length;i+=1)
					seqa[i]=seq2[i];
				//m:length of source sequence
				//n: length of alignment sequence
				int m,n,maxlen,minlen;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -