schema

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);
        }
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值