Пример #1
0
        // The class contructor given a DNA string.
        public DNA(string action, Tuple <int, int> origin, string dna)
        {
            this.dna = new List <Nucleotide>();
            List <Nucleobases> nucleobases = Nucleobase.ToDNA(dna);

            for (int i = 0; i < nucleobases.Count; i++)
            {
                this.dna.Add(new Nucleotide(action, origin, i, nucleobases[i]));
            }
        }
Пример #2
0
        // Constructs a section of DNA sequence
        public static List <Nucleotide> ToNucleotides(string action, Tuple <int, int> origin, int position, string dna)
        {
            List <Nucleotide>  nucleotides = new List <Nucleotide>();
            List <Nucleobases> nucleobases = Nucleobase.ToDNA(dna);

            for (int i = 0; i < nucleobases.Count; i++)
            {
                nucleotides.Add(new Nucleotide(action, origin, position + i, nucleobases[i]));
            }
            return(nucleotides);
        }
Пример #3
0
        // A single nucleotide polymorphism (SNP).
        // Replaces a single nucleobase (or nucleotide) within
        // an existing gene with a different nucleobase.
        private static void Snip(int speciesId, int geneId, int index, string dna)
        {
            int i = GeneIndex(speciesId, geneId);

            genes[i].Dna.Dna[index].Nucleobase = Nucleobase.ToDNA(dna)[0];
        }