Delila Program: migrate

migrate program

Documentation for the migrate program is below, with links to related programs in the "see also" section.

{version = 1.02; (* of migrate.p 1999 Dec 22}

(* begin module describe.migrate *)
(*
name
   migrate: selective migration of drunkard's walk

synopsis
   migrate(migratep: in, output: out)

files
   migratep:  parameters to control the program.  The file must contain the
        following parameters, one per line:

         The version number of the program.  This allows the user to be
         warned if an old parameter file is used.

         range: (integer) +/- range of the world
     This is the region that will be displayed.  A constant in the
     program (see technical notes) defines the range of the array.

         displaymax: (integer) vertical display maximum
            How many vertical lines are devoted to the display.

         pagejump: 'l' means produce a page jump

         maxgens: (integer) maximum number of generations to run

         initpop: (integer) initial population placed at zero

         survival rate: (two integers)
             probability of survival for negative and positive steps

         iseed: (real) initial random seed

  delaycount: (integer) number of times to do a futile addition to
      slow the display.  Start with a small value and work up to a
      reasonable delay.  3000000 gives near a 1 second delay on a Sun
      Sparcstation 20/61.

  touchhalt:  stop the program when this location is touched This
      allows one to determine how many steps of selective evolution
      are needed to get a particular distance from the origin.

   output: messages to the user

description

   The migrate program shows evolutionary selection in the context of the
   classical drunkard's walk.  In the drunkard's walk, a population of drunks
   comes out of a bar and starts stepping to the left or the right randomly.
   The drunks don't bump into each other, and so are really ghosts ...
   Statistics text books demonstrate that the distribution will approach a
   Gaussian distribution.

   The program adds only two new factors.  Each drunk really doesn't move.
   Instead "it" divides in two like a bacterium, and the two progeny are born
   one step to the left or the right of the parent.  The other new factor is
   that there are survival probabilities for the two directions.  By playing
   with these probabilities, the population can be made to migrate to the
   left or right.

   A natural example if this is the mechanism that bacteria use to find
   food.  They have two modes of movement, either tumbling or swimming.
   Which happens depends on the direction that they rotate their flagella.
   (Yes, it is a rotating part!  See Eisenbach1990.) The trouble for the
   bacterium is that it is too small to sense chemical gradients.  So it
   swims for a while and compares the new situation to the previous
   situation.  If things are getting better, it keeps going.  If not, it
   tumbles and then tries to swim again.

   This program demonstrates natural selection, and it also makes clear the
   falsity of the following argument.  Creationists often want to argue that
   the "probability" of forming a biological system is impossibly low.  For
   example, the E. coli genome is 4638858 basepairs long in GenBank entry
   U00096.  The probability of generating this sequence by equally probable
   choices for the 4 bases is

   1/(4^4638858) = 1/340282346638528859811704183484516925440 = 3.4x10^38

   (assuming that my computer really did the computation correctly!) This is
   then cited as evidence against evolution and for creationist views of how
   living things came into existance.

   The program here adds the missing factor to this argument, which is that
   there is selection at every generation.  This makes the probability
   computation given above invalid, BECAUSE THE PROBABILITIES ARE NOT
   INDEPENDENT.  That is, it is only valid to multiply probabilities if they
   are independent.  But selection at each generation means that the
   condition of THIS generation is not independent of what happened in the
   past.

examples

   Example migratep.1  BROWNIAN DRIFT

1.00     version of migrate that this parameter file is designed for.
27       range: +/- range of the world
40       displaymax: vertical display maximum
l        pagejump: 'l' means produce a page jump
100      maxgenss: maximum number of generations to run
10000    initpop: initial population placed at zero
0.5 0.5  survival rate: probability of survival for negative and positive steps
5        iseed: initial random seed
0        delaycount: number of times to do a futile addition to slow the display
25       touchhalt:  stop the program when this location is touched

At the first generation, the population looks like this:

maximum population density = 10000 is at location = 0
 ------------------                   ++++++++++++++++++
 222222221111111111--------- +++++++++111111111122222222
 7654321098765432109876543210123456789012345678901234567
|...........................*...........................|  40
|...........................*...........................|  39
|...........................*...........................|  38
|...........................*...........................|  37
|...........................*...........................|  36
|...........................*...........................|  35
|...........................*...........................|  34
|...........................*...........................|  33
|...........................*...........................|  32
|...........................*...........................|  31
|...........................*...........................|  30
|...........................*...........................|  29
|...........................*...........................|  28
|...........................*...........................|  27
|...........................*...........................|  26
|...........................*...........................|  25
|...........................*...........................|  24
|...........................*...........................|  23
|...........................*...........................|  22
|...........................*...........................|  21
|...........................*...........................|  20
|...........................*...........................|  19
|...........................*...........................|  18
|...........................*...........................|  17
|...........................*...........................|  16
|...........................*...........................|  15
|...........................*...........................|  14
|...........................*...........................|  13
|...........................*...........................|  12
|...........................*...........................|  11
|...........................*...........................|  10
|...........................*...........................|   9
|...........................*...........................|   8
|...........................*...........................|   7
|...........................*...........................|   6
|...........................*...........................|   5
|...........................*...........................|   4
|...........................*...........................|   3
|...........................*...........................|   2
|...........................*...........................|   1
|*******************************************************|   0
generation 1

This example reaches 25 from the origin in 44 steps.
The final population looks like:

maximum population density = 1264 is at location = -1
 ------------------                   ++++++++++++++++++
 222222221111111111--------- +++++++++111111111122222222
 7654321098765432109876543210123456789012345678901234567
|..........................*............................|  40
|..........................*.*..........................|  39
|..........................*.*..........................|  38
|..........................*.*..........................|  37
|..........................*.*..........................|  36
|........................*.*.*.*........................|  35
|........................*.*.*.*........................|  34
|........................*.*.*.*........................|  33
|........................*.*.*.*........................|  32
|........................*.*.*.*........................|  31
|........................*.*.*.*........................|  30
|......................*.*.*.*.*.*......................|  29
|......................*.*.*.*.*.*......................|  28
|......................*.*.*.*.*.*......................|  27
|......................*.*.*.*.*.*......................|  26
|......................*.*.*.*.*.*......................|  25
|......................*.*.*.*.*.*......................|  24
|....................*.*.*.*.*.*.*.*....................|  23
|....................*.*.*.*.*.*.*.*....................|  22
|....................*.*.*.*.*.*.*.*....................|  21
|....................*.*.*.*.*.*.*.*....................|  20
|....................*.*.*.*.*.*.*.*....................|  19
|....................*.*.*.*.*.*.*.*....................|  18
|....................*.*.*.*.*.*.*.*....................|  17
|....................*.*.*.*.*.*.*.*.*..................|  16
|..................*.*.*.*.*.*.*.*.*.*..................|  15
|..................*.*.*.*.*.*.*.*.*.*..................|  14
|..................*.*.*.*.*.*.*.*.*.*..................|  13
|..................*.*.*.*.*.*.*.*.*.*..................|  12
|..................*.*.*.*.*.*.*.*.*.*..................|  11
|..................*.*.*.*.*.*.*.*.*.*.*................|  10
|................*.*.*.*.*.*.*.*.*.*.*.*................|   9
|................*.*.*.*.*.*.*.*.*.*.*.*................|   8
|................*.*.*.*.*.*.*.*.*.*.*.*................|   7
|................*.*.*.*.*.*.*.*.*.*.*.*.*..............|   6
|..............*.*.*.*.*.*.*.*.*.*.*.*.*.*..............|   5
|..............*.*.*.*.*.*.*.*.*.*.*.*.*.*..............|   4
|..............*.*.*.*.*.*.*.*.*.*.*.*.*.*.*............|   3
|............*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*............|   2
|..........*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*..........|   1
|*******************************************************|   0
generation 44
the population touched 25
 program halt.

The population has spread out and reached 25 that way.  The average is still
zero.  If there were other factors keeping the population homogenous, the
variants would be trimmed away.

   Example migratep.2  SELECTION

1.00     version of migrate that this parameter file is designed for.
27       range: +/- range of the world
40       displaymax: vertical display maximum
l        pagejump: 'l' means produce a page jump
100      maxgenss: maximum number of generations to run
10000    initpop: initial population placed at zero
0.1 0.9  survival rate: probability of survival for negative and positive steps
5        iseed: initial random seed
0        delaycount: number of times to do a futile addition to slow the display
25       touchhalt:  stop the program when this location is touched

This example reaches 25 from the origin in 26 steps.
The final population looks like:

maximum population density = 2674 is at location = 21
 ------------------                   ++++++++++++++++++
 222222221111111111--------- +++++++++111111111122222222
 7654321098765432109876543210123456789012345678901234567
|................................................*......|  40
|................................................*......|  39
|................................................*......|  38
|................................................*......|  37
|................................................*......|  36
|................................................*......|  35
|................................................*......|  34
|..............................................*.*......|  33
|..............................................*.*......|  32
|..............................................*.*......|  31
|..............................................*.*.*....|  30
|..............................................*.*.*....|  29
|..............................................*.*.*....|  28
|..............................................*.*.*....|  27
|..............................................*.*.*....|  26
|..............................................*.*.*....|  25
|..............................................*.*.*....|  24
|..............................................*.*.*....|  23
|..............................................*.*.*....|  22
|............................................*.*.*.*....|  21
|............................................*.*.*.*....|  20
|............................................*.*.*.*....|  19
|............................................*.*.*.*....|  18
|............................................*.*.*.*....|  17
|............................................*.*.*.*....|  16
|............................................*.*.*.*....|  15
|............................................*.*.*.*....|  14
|............................................*.*.*.*....|  13
|............................................*.*.*.*....|  12
|............................................*.*.*.*....|  11
|............................................*.*.*.*.*..|  10
|..........................................*.*.*.*.*.*..|   9
|..........................................*.*.*.*.*.*..|   8
|..........................................*.*.*.*.*.*..|   7
|..........................................*.*.*.*.*.*..|   6
|..........................................*.*.*.*.*.*..|   5
|..........................................*.*.*.*.*.*..|   4
|........................................*.*.*.*.*.*.*..|   3
|........................................*.*.*.*.*.*.*..|   2
|......................................*.*.*.*.*.*.*.*..|   1
|*******************************************************|   0
generation 26
the population touched 25
 program halt.

The population reached 25 steps at almost one per generation.  More
importantly, the ENTIRE population migrated, and the average changed
significantly.

documentation

@article{Eisenbach1990,
author = "M. Eisenbach",
title = "Functions of the flagellar modes of rotation in bacterial
motility and chemotaxis",
journal = "Molec. Microb.",
volume = "4",
pages = "161-167",
year = "1990"}

  atchange program:
  https://alum.mit.edu/www/toms/atchange.html

  E. coli genome:
  ftp://ncbi.nlm.nih.gov/genbank/genomes/bacteria/ecoli.gbk

see also

  migratep
  migratep.1
  migratep.2

author
   Thomas Dana Schneider

bugs

technical notes

   The easiest way to run the program is under a Unix operating system.  Put
   the migratep file into your favorite editor.  Set up an atchange program
   running in a different window that will run the program whenever you write
   the migratep file out.  This allows one to play with the variables and
   watch the results without mousing around (which wastes an enor-mousE
   amount of time ;-).

   The populations are not stable.  They can grow or shrink exponentially
   depending the selection values.  The reason for the instability is that
   the population is not part of a balanced ecology.  This could be added to
   the model, but it would reduce the clarity of the results.  (Fortunately
   balanced ecologies obviously exist or the creationists would probably
   argue that this program demonstrates their impossibility!)

   There is a global constant (worldsize) that determines the maximum width
   of the world.

*)
(* end module describe.migrate *)
{This manual page was created by makman 1.45}


{created by htmlink 1.62}