public static Operon ParseOperon(string HTTPResp) { Operon Oper = new Operon(); string OperonBody = HTTPResp.Remove(0, HTTPResp.IndexOf(@"<TR CLASS=" + '"' + "colum2" + '"' + ">")); OperonBody = OperonBody.Remove(OperonBody.IndexOf(@"</TR>"), OperonBody.Length - OperonBody.IndexOf(@"</TR>")); string[] Values = OperonBody.Split(new string[] { "<TD>" }, StringSplitOptions.None); // I = 1 to skip header for (int I = 1; I < Values.Length; I++) { Values[I] = Values[I].Remove(Values[I].IndexOf("</TD>"), Values[I].Length - Values[I].IndexOf("</TD>")); } Oper.No = Values[1]; Oper.Name = Values[2]; Oper.GeneName = Values[3]; Oper.LocusName = Values[4]; Oper.GI = Values[5]; // gene id? | protein id? Oper.Strand = int.Parse(Values[6]); Oper.PosLeft = int.Parse(Values[7]); Oper.PosRight = int.Parse(Values[8]); Oper.GeneProduct = Values[9]; Oper.PositionWithinOperon = int.Parse(Values[10]); Oper.Info = Values[11]; return(Oper); }
public static Operon ParseOperon(string HTTPResp) { Operon Oper = new Operon(); string OperonBody = HTTPResp.Remove(0, HTTPResp.IndexOf(@"<TR CLASS=" + '"' + "colum2" + '"' + ">")); OperonBody = OperonBody.Remove(OperonBody.IndexOf(@"</TR>"), OperonBody.Length - OperonBody.IndexOf(@"</TR>")); string[] Values = OperonBody.Split(new string[] { "<TD>" }, StringSplitOptions.None); // I = 1 to skip header for (int I = 1; I < Values.Length; I++) { Values[I] = Values[I].Remove(Values[I].IndexOf("</TD>"), Values[I].Length - Values[I].IndexOf("</TD>")); } Oper.No = Values[1]; Oper.Name = Values[2]; Oper.GeneName = Values[3]; Oper.LocusName = Values[4]; Oper.GI = Values[5]; // gene id? | protein id? Oper.Strand = int.Parse(Values[6]); Oper.PosLeft = int.Parse(Values[7]); Oper.PosRight = int.Parse(Values[8]); Oper.GeneProduct = Values[9]; Oper.PositionWithinOperon = int.Parse(Values[10]); Oper.Info = Values[11]; return Oper; }