public static int GetSinglePartialSum(Nucleotid parentNucleotid, Nucleotid childNucleotid) { int result = 1; while (!childNucleotid.StartsWith(parentNucleotid.Sequence.Substring(result), Global.ErrorToleration) && result < parentNucleotid.Sequence.Length) { result++; } return(result); }
public static Nucleotid Complimentary(Nucleotid nucleotid) { switch (nucleotid) { case Nucleotid.A: return Nucleotid.T; case Nucleotid.G: return Nucleotid.C; case Nucleotid.C: return Nucleotid.G; case Nucleotid.T: return Nucleotid.A; default: throw new ArgumentOutOfRangeException("nucleotid"); } }
private static void InitData(string fileName, int windowLength) { var nucleotids = File.ReadAllLines(fileName); var nucleotidList = new List <Nucleotid>(); foreach (var item in nucleotids) { Nucleotid nucl = new Nucleotid() { Sequence = item }; nucleotidList.Add(nucl); } Global.ErrorToleration = 0; Global.MaxLength = windowLength; Global.Nucleotids = nucleotidList; }
public void SetUp() { nucleotid = new Nucleotid(); }
// A-0 G-1 C-2 T-3 public static char ToChar(Nucleotid nucleotid) { switch (nucleotid) { case Nucleotid.A: return 'A'; case Nucleotid.G: return 'G'; case Nucleotid.C: return 'C'; case Nucleotid.T: return 'T'; default: throw new ArgumentOutOfRangeException("nucleotid"); } }