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);
}
}
}
schema
最新推荐文章于 2024-07-09 22:26:42 发布