Esempio n. 1
0
        public DnaSequence Evolve(DnaSequence dnaSequence, double time)
        {
            DnaSequence evolvedDnaSequence = new DnaSequence(dnaSequence.Size());

            for (int i = 0; i < dnaSequence.Size(); i++)
            {
                evolvedDnaSequence[i] = this.evolutionModel.GenerateNextBase(dnaSequence.ElementAt(i), time);
            }
            return(evolvedDnaSequence);
        }
Esempio n. 2
0
        // Constructor for root node
        public PhyloTreeNode(DnaSequence dnaSequence)
        {
            this.dnaSequence = dnaSequence;
            double timeToEvolve = ExponentialDistribution.randomExponential.NextDouble();

            this.timeFromStart = timeToEvolve;
            this.creationTime  = 0;
            this.childrenNodes = new List <PhyloTreeNode>();
            NodeEvolutionScheduler.scheduler.ScheduleNodeEvolution(this, timeToEvolve);
        }
Esempio n. 3
0
        private void Evolve()
        {
            DnaSequence          evolvedDnaSequence1 = DnaSequenceEvolver.evolver.Evolve(this.dnaSequence, this.timeFromStart);
            DnaSequence          evolvedDnaSequence2 = DnaSequenceEvolver.evolver.Evolve(this.dnaSequence, this.timeFromStart);
            List <PhyloTreeNode> childrenNodes       = new List <PhyloTreeNode>()
            {
                new PhyloTreeNode(this, evolvedDnaSequence1),
                new PhyloTreeNode(this, evolvedDnaSequence2)
            };

            this.childrenNodes = childrenNodes;
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            string userInputSequence = string.Empty;

            SetupEnviroment();

            Console.WriteLine("Please input root sequence:");
            userInputSequence = Console.ReadLine();

            DnaSequence userSequence = new DnaSequence(userInputSequence);

            NodeEvolutionScheduler.scheduler.StartScheduler();
            PhyloTree tree = new PhyloTree(userSequence);

            Program.tree = tree;
            Program.evolutionTimer.Enabled = true;
            Console.ReadLine();
        }
Esempio n. 5
0
 public PhyloTree(DnaSequence rootDnaSequence)
 {
     this.rootNode = new PhyloTreeNode(rootDnaSequence);
 }