Пример #1
0
        private static void Main(string[] args)
        {
            //test data
            //var sequence1 = new[] { 'C', 'G', 'T', 'G', 'A', 'A', 'T', 'T', 'C', 'A', 'T' };
            //var sequence2 = new[] { 'G', 'A', 'C', 'T', 'T', 'A', 'C' };
            //var sequence1 = new[] {'G', 'A', 'C', 'T', 'A', 'C'};
            //var sequence2 = new[] {'A', 'C', 'G', 'C'};
            //var sequence1 = new[] { 'A', 'C', 'A', 'C', 'T'};
            //var sequence2 = new[] { 'A', 'C', 'T' };
            var sequence1 = new[] { 'c', 'c', 'a', 't', 'c', 'a', 'a', 'a', 'g', 'a', 'g', 'a', 'g', 'a', 'a', 'a', 'g', 'a', 'g' };
            var sequence2 = new[] { 'g', 'c', 'c', 'a', 't', 'c', 'a', 'a', 'a', 'g', 'a', 'g', 'a', 'g', 'a', 'g' };

            //var sequence1 = new[] { 'G', 'A' };
            //var sequence2 = new[] {'G', 'C'};


            var sequenceGrid = new SequenceGridNucleotide(sequence1, sequence2);

            sequenceGrid.Initialize();
            sequenceGrid.FillMatrix();
            sequenceGrid.ExecuteTraceback();
            var alignedSequence = sequenceGrid.AlignedSequence();

            PrintMatrix(sequence1, sequence2, sequenceGrid);
            PrintSequenceAligned(alignedSequence.ToList());
            PrintPath(sequenceGrid);
        }
        public ActionResult Execute(SequenceAlignerModel model)
        {
            var sequenceGrid = new SequenceGridNucleotide(model.Sequence1.ToCharArray(), model.Sequence2.ToCharArray());

            sequenceGrid.Initialize();
            sequenceGrid.FillMatrix();
            sequenceGrid.ExecuteTraceback();
            var alignedSequence = sequenceGrid.AlignedSequence().ToList();

            for (int i = 0; i < alignedSequence.Count(); i++)
            {
                model.Sequence1Aligned += alignedSequence[i].Key + " ";
            }
            for (int i = 0; i < alignedSequence.Count(); i++)
            {
                model.Sequence2Aligned += alignedSequence[i].Value + " ";
            }
            return(PartialView("DnaGlobal", model));
        }
Пример #3
0
 public void When()
 {
     _sequenceGridNucleotide = new SequenceGridNucleotide(_seq1, _seq2);
     _sequenceGridNucleotide.Initialize();
     _sequenceGridNucleotide.FillMatrix();
 }