public double RegSVMEncode(string input, string CalTotalAminoV)
{
string Amino = "ACDEFGHIKLMNPQRSTVWY";
double[] AminoValue = new double[20];
string pat = @"\-?[0-9]*\.?[0-9]*";
Regex r = new Regex(pat, RegexOptions.IgnoreCase);
MatchCollection matches = r.Matches(CalTotalAminoV);
int j=0;
foreach (Match m in matches)
{
if ((m.Value != null) && (m.Value != ""))
{
AminoValue[j] = Convert.ToDouble(m.Value);
j++;
}
}
char[] ArrayAmino = Amino.ToCharArray();
double TotalNum = 0;
Hashtable ht = new Hashtable();
for (int i = 0; i < ArrayAmino.Length; i++)
{
ht.Add(ArrayAmino[i], AminoValue[i]);
}
input = input.Trim().ToUpper();
char[] ArrayInput = input.ToCharArray();
for (int i = 0; i < ArrayInput.Length; i++)
{
TotalNum += Convert.ToDouble(ht[ArrayInput[i]]);
}
return TotalNum;
}

浙公网安备 33010602011771号