Пример #1
0
        public static DNK BuildWright(DNK ss)
        {
            string r = "";

            for (int i = 0; i < ss.a.Length; i++)
            {
                if (ss.a[i] == 'A')
                {
                    r = r + "T";
                }
                else if (ss.a[i] == 'G')
                {
                    r = r + "C";
                }
                else if (ss.a[i] == 'T')
                {
                    r = r + "A";
                }
                else
                {
                    r = r + "G";
                }
            }
            DNK rr = new DNK(r);

            return(rr);
        }
Пример #2
0
        public void Output()
        {
            DNK j = new DNK(a);

            Console.WriteLine(a);
            DNK k = BuildWright(j);

            Console.WriteLine(k.a);
        }
Пример #3
0
        public static int Check(DNK h, DNK hh)
        {
            int k = 0;

            for (int i = 0; i < h.a.Length; i++)
            {
                if (h.a[i] == hh.a[i])
                {
                    k++;
                }
            }
            return(k);
        }
Пример #4
0
        static void Main()
        {
            Console.WriteLine("ВВедите размер 1 желаемой ДНК:");
            int n1 = Convert.ToInt32(Console.ReadLine());
            DNK c1 = new DNK(n1);

            Console.WriteLine("ВВедите размер 2 желаемой ДНК:");
            int n2 = Convert.ToInt32(Console.ReadLine());
            DNK c2 = new DNK(n2);

            Console.WriteLine("\tПалиндром 1 ДНК:");
            DNK cc = DNK.BuildWright(c1);

            cc.Output();
            Console.WriteLine("\tПалиндром 2 ДНК:");
            DNK ccc = DNK.BuildWright(c2);

            ccc.Output();
            Console.WriteLine("\t\tCompering 1,2 ДНК:");
            int test = DNK.Check(c1, c2);

            if (test == c1.a.Length)
            {
                Console.WriteLine(" ДНКs are the same");
            }
            else
            {
                Console.WriteLine("ДНКs are different");
            }
            Console.WriteLine("------------------ 1 ДНК:------------------");
            c1.Output();
            Console.WriteLine("------------------ 2 ДНК:------------------");
            c2.Output();

            double s = 100;

            Console.WriteLine("\t\t\t 1 ДНК:");
            double[] mas1 = c1 % s;
            Console.WriteLine("\t\t\t 2 ДНК:");
            double[] mas2 = c2 % s;

            Console.WriteLine("\nZадайте параметр азотистого основания 1 ДНК, мы вернем его индекс:");

            char l = Convert.ToChar(Console.ReadLine());

            int[] m = c1[l];

            Console.ReadKey();
        }