Quasispecies
PyCellChemistry documentation index
/Users/lidia/main/research/acbook/web/website/ac-home/pycellchem/pycellchem-2.0/src/Quasispecies.py

#---------------------------------------------------------------------------
#
# Quasispecies.py: demonstration of quasispecies evolutionary dynamics
# using binary strings, book chapter 7
#
# usage: python quasispecies.py [ <mp> <histfile> ]
# where:
# mp is the proportion of mutations with respect to the error threshold
# histfile is the name of an output file that will contain the histogram
# of species at the end of the simulation, grouped by their distance to
# the optimum (number of bits that differ from the optimum sequence
# (here '1111111111')
#
# by Lidia Yamamoto, Kraainem, Belgium, July 2013
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Copyright (C) 2015 Lidia A. R. Yamamoto
# Contact: http://www.artificial-chemistries.org/
#
# This file is part of PyCellChemistry.
#
# PyCellChemistry is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 3, as published by the Free Software Foundation.
#
# PyCellChemistry is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PyCellChemistry, see file COPYING. If not, see
# http://www.gnu.org/licenses/
#


Modules
artchem.BinaryStrings
numpy
sys


Classes
Evolution.Evolution
Quasispecies


class Quasispecies(Evolution.Evolution)
Methods defined here:
__init__(self, mp)
create a random initial population of molecules with
intentionally bad fitness; set the mutation probability
per bit as a proportion 'mp' of the error threshold
dist_histogram(self)
histogram of number of species at hamming distance d=[0;nbits]
from master sequence
plot(self, vtime)
plot fitness information
plot_dist_histogram(self, fname)
plot distance histogram to file 'fname'
propensity(self, mol)
propensity of a given reaction
react(self)
one iteration of Gillespie's SSA on the quasi-species equation
run(self, histfile)
stochastic implementation of quasi-species equation using
Gillespie's SSA
set_propensities(self)
initial calculation of all propensities
update_propensity(self, mol, dm)
update propensity of molecule, given that dm units of it were
added (dm > 0) or removed (dm < 0)

Methods inherited from Evolution.Evolution:
avgfitness(self)
compute the average fitness of the population
bestworstfit(self, mset)
find the best and worst individuals in a given multiset
fitness(self, binstr)
calculate the fitness of an individual (normalized to one)
optimum(self)
produce an optimum individual for the desired fitness function
randmol(self)
generate a random molecule in the form of an N-bit integer


Generated automatically by pydoc, July 10, 2015