schema

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wxm328017574/article/details/80330704
using System;
using System.Collections.Generic;
using System.Text;
namespace Binding_Sites_Prediction
{
    class schemaClass
    {      
        public string schema(string testing, string flag, string validseq)
        {
            string sch_testing = "";
            string[] str_line = testing.Split('\n');
            string[] str_flag = flag.Split('\n');
            string[] str_validseq = validseq.Split(' ');
            int valid = 0;

            for (int i = 0; i < str_line.Length; i++)
            {               
                valid = Int32.Parse (str_validseq[i]);
                if (i >= 0 && i <= 4)
                {
                    string temp = "";

                    for (int j = 0; j <= i + 5; j++)
                    {
                        temp +=  str_line[j] + " ";
                    }
                    string[] str_space = temp.Split(' ');
                    //sch_testing += str_flag[valid] + " ";
                    sch_testing +=  "1 ";
                    for (int count = 0; count < str_space.Length - 1; count++)
                    {
                        int index = count +1 ;

                        sch_testing += index + ":" + str_space[count] + " ";

                    }
                    sch_testing =  sch_testing + "\n";
                }

                if (i >= 5 && i < str_line.Length - 5)
                {
                    string temp = "";
                    for (int j = -5; j <= 5; j++)
                    {
                        temp += str_line[i + j] + " ";
                    }
                    string[] str_space = temp.Split(' ');
                    //sch_testing += str_flag[valid] + " ";
                    sch_testing += "1 ";
                    for (int count = 0; count < str_space.Length - 1; count++)
                    {
                        int index = count + 1;
                        sch_testing += index + ":" + str_space[count] + " ";
                    }
                    sch_testing = sch_testing + "\n";
                }

                if (i >= str_line .Length -5 && i < str_line .Length )
                {
                    string temp = "";
                    for (int j = i - 5 ; j < str_line .Length ;j++)
                    {
                        temp += str_line[j] + " ";
                    }
                    string[] str_space = temp.Split(' ');
                    //sch_testing += str_flag[valid] + " ";
                    sch_testing += "1 ";
                    for (int count = 0; count < str_space.Length - 1; count++)
                    {
                        int index = count + 1;
                        sch_testing += index + ":" + str_space[count] + " ";
                    }
                    sch_testing =  sch_testing + "\n";
                }

            }                            
            return (sch_testing);
        }
    }
}
阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页