-------------
Migrate 3.5.x
-------------
3.5.1 released March  2013 

Quick installation guide 
------------------------
- Unpack the compressed distribution file
- Macos, Unix binary distributions: move the migrateshell.app to your /Applications folder
- Source files: configure; make; sudo make install ;
  - if you have openmpi installed: make mpis  

Content
-------
- Overview
- Analyses summary
- Computer systems
- History of MIGRATE
- Distribution
- Installation
- Documentation
- Example folder
- Troubleshoothing
- Disclaimer


Migrate estimates population parameters, effective population sizes
and migration rates of n populations, using genetic data.  It 
uses a coalescent theory approach taking into account history of 
mutations and uncertainty of the genealogy. 

The estimates of the parameter values are achieved by
either a Maximum likelihood (ML) approach or Bayesian inference (BI).
The output is presented in an TEXT file _and_ in a PDF file. The PDF file
eventually will contain all possible analyses including histograms 
of posterior distributions. Currently only main tables (ML + BI), 
profile likelihood tables (ML), percentiles tables (ML), and 
posterior histograms (BI) and skylineplots are supported in the PDF.
 
Currently the following data types are supported:
-DNA sequence data
 - finite sites model: F84, Kimura two-parameter
 - finite sites model + rate variation among sites: 
   F84 + Gamma, F84 + arbitrary rates
-SNP data (single nucleotide polymorphism)
 - SNP are derived from sampled sequences and are completely linked
   except that we know that the sites are variable [not thoroughly tested] 
-Microsatellite data 
 - brownian motion model: a continuous approximation to the stepwise mutation model.
 - stepwise mutation model (if you want to finish your work in this century do not use))
-Electrophoretic marker data (infinite allele model).

Analyses
--------
IMPORTANT: support will cease for approaches with *, approaches with ** are
currently not supported (and often have an alternative)

- Estimation of population sizes and migration rates of a migration matrix
  model, or arbitrarily subsets of a migration matrix model, or an n-island
  model. Allowing for a geographic distance matrix so that effects geographic
  can be removed out of the analysis.(BI + ML*)
- Profile likelihood curves deliver approximate confidence intervals.(ML*)
- Allows approximate likelihood ratio tests and model selection using
  Akaike's Information criterion. (ML**)
- Marginal likelihood calculation to assist calculation of Bayes Factor (BI)
- Plots of overall immigration and emigration per population. (ML*)
- Allows a variable mutation rate AMONG loci. (ML** [+BI**])
- For sequences: allows a variable substitution rate among sites. (ML*+BI)
- For microsatellites: allows the definition of repeatnumber and use of fragment length as input
- Facilitates analyses of multimodal search space distributions with heating
  scheme and/or multi-run analyses. (ML*+BI)
- Histogram of migration events over time (ML* + BI)
- Plot of expected parameters through time (skyline plots) for all sizes and migration rates. 
- Dated samples (ML* + BI)
- Relabeling and merging of populations
- Random subset of individuals per population
- Several prior settings for BI


Computer systems
----------------
You can fetch Migrate from the website http://popgen.sc.fsu.edu 
as source code or binary executables. Currently I supply binaries for

- Macintosh 
  - Macintosh Intel:    migrate-n
                        migrateshell.app (includes migrate-n and fastmigrate-n)
- Windows: migrate-n.exe 
           migrate-n-mpi.exe 
           (to run migrate-n-mpi.exe you will need to install openmpi [version 1.6])

The source code should compile on all platforms (windows may be tricky)

The file is compressed as tar.gz or as zip file.
 	
The documentation contains information about
how to compile and use a parallelized version of migrate 
so that it can run concurrently on computer clusters
(using MPI [preferrably OpenMPI]).


History about bug fixes and new features
----------------------------------------
read the HISTORY file.

Distribution
------------
Migrate can be fetched from the www-site 
http://popgen.sc.fsu.edu/ 


Installation
------------

(a) Binaries
Unpack the compressed archive, open the directory migrate-3.5.1
- Mac: in the Finder copy migrateshell.app to the /Applications folder
  (double clicking the migrateshell.app will open a terminal window
  set the internals so that you can run migrate-n and also fastmigrate-n
  [although this may not work on the first try because additional software
  needs to be installed (follow the online instructions). There is also a migrate-n
  binary in the folder that can be used, but it would be best if you plae that into
  a location like /usr/local/bin (and then adjust your search path to access it).
- Windows: the preferred way to use migrate-n.exe is through the commandline 
  environment.
- UNIX: I suggest to use the source distribution to make the best use of your system

download and read the documentation and try the program
on a small data set.
 
For UNIX systems
the binary can go to standard directories (e.g. /usr/local/bin),
the rudimentary man page can go to the /usr/local/man/man1.

(b) Source (UNIX)
1. gunzip -c migrate-3.5.1.src.tar.gz | tar xf -
   or use 
   tar xvfz migrate-3.5.1.src.tar.gz
   [this creates a directory "migrate-3.5.1" with subdirectories 
   "src", and "examples" in it.]
2. cd migrate-3.5.1/src
3. type "./configure"
   This will create the Makefile 
   [./configure --help for more options]
 	
4. type "make" (please report warnings and especially errors).
   If you have a multiprocessor machine (non-Macintosh computer!) you perhaps want to try 
   "make thread" (this allows parallel execution of chains when 
   using the heating scheme). On Macs configure will use automatically the built in 
   threading framework (GrandCentral) that will be faster than the standard threading. 
   "make" will produce migrate-n with PDF support,
   this might not work on all machines, if it fails please tell me.

   The result of the compilation should be an executable 
   "migrate-n" in the src directory [it is called "migrate-n" because
   on some computer system there is a system program called "migrate"]

5. make install 
   This will install the programs and man-page into usr/local/bin, 
   /usr/local/man/man1
   [you need to be root or administrator to do this; this step is NOT necessary, 
   to use the program, but it would be convenient for all users
   of your system]
   or 
   move migrate-n to $HOME/bin or some 
   other convenient place.

6. change directory to example
   run "migrate-n parmfile.testml" and "migrate-n parmfile.testbayes", 
   on my 2008 macosx laptop the Bayesian run using parmfile.testbayes took about 2 minutes.
   If these two tests fail, please let me know!


Documentation
-------------
You need to download it separately from
http://popgen.sc.fsu.edu/Downloads.html

It is a PDF file and called  migratedoc.pdf.
The pdf file can be viewed and printed using Acrobat 
or any other PDF viewer.


Examples
--------
In the directory "example" you can find some example data sets.
You might wan to try the two parmfiles.testml and parmfile.testbayes
Use the Terminal.app (on macosx), or xterm (Linux), or cmd (Windows),
change directory to the example directory and then execute
for mac and unix: ../migrate-n parmfile.testbayes
for windows: ..\migrate-n parmfile.testbayes
or the ml version.


Fan-mail, complaints, questions and error-reports
-------------------------------------------------
Peter Beerli
beerli@fsu.edu
or
migrate-support@googlegroups.com


Disclaimers
-----------
Copyright 1997-2002 Peter Beerli and Joseph Felsenstein 
Copyright 2003-2008 Peter Beerli
Copyright 2009-2013 Peter Beerli and Michal Palczewski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Last update:
March 12 2013









