'Fitmodel' estimates the  parameters of various codon-based models  of substitution, including those
described in  Guindon, Rodrigo, Dyer and Huelsenbeck  (2004). These models are  especially useful as
they accommodate site-specific switches between selection  regimes without a priori knowledge of the
positions in the tree where changes of selection regimes occurred.

The program  will ask for  two input files:  a tree file  and a sequence  file.  The tree  should be
unrooted and in NEWICK format.  The sequences  should be in PHYLIP interleaved or sequential format.
If you are planning  to use codon-based models, the sequence length should be  a multiple of 3.  The
program provides four types  of codon models: M1, M2, M2a, and M3  (see PAML manual).  Moreover, M2,
M2a  and M3  can  be  combined with  'switching'  models (option  'M').   Two  switching models  are
implemented: S1  and S2.  S1  constraints the rates  of changes between  dN/dS values to  be uniform
(e.g., the rates of changes between negative and positive selection is constrained to be the same as
the rate of change  between neutrality and positive selection) while S2  allows for differents rates
of change between the different classes of dN/dS values.

If  you are  using  a 'switching'  model,  'fitmodel' will  output file  with  the follwoing  names:
your_sequence_file_trees_w1,     your_sequence_file_trees_w2,     your_sequence_file_trees_w3    and
your_sequence_file_trees_wbest.  The w1, w2 and w3  files give the estimated tree with probabilities
of w1, w2,  and w3 (three maximum likelihood  dN/dS ratio estimates) calculated on each  edge of the
tree and  for each  site.  Hence, the  first tree in  one of  these files reports  the probabilities
calculated at the first  site of the alignment. Instead of probabilities,  the wbest file allows you
to identify  which of the tree  dN/dS is the most  probable on any give  edge, at any  given site. A
branch with label  0.0 means that w1  is the most probable class,  0.5 indicates the w2  is the most
probable and 1.0 means that w3 has the highest posterior probability.

Processing those  results manually  can be  very tedious.  The  program 'treeview'  reads 'fitmodel'
output file  and generates a postscript  file which displays the  phylogeny at each  codon site with
different colors on edges depending on the posterior probabilities estimated on each branch, at each
site (see file p1.pdf).   This is very useful to detect site  specific changes of selection regimes.
To compile 'treeview' on UNIX-like systems, apply the following changes to the file 'Makefile' :

PROG = FITMODELEXEC = fitmodel
# PROG = TREEVIEW# EXEC = treeview

changes to:

#PROG = FITMODEL#EXEC = fitmodel
PROG = TREEVIEWEXEC = treeview

Then type 'make  clean' and 'make'. This will  generate the binary for 'treeview'.   'treeview' is a
command-line program that  takes as first argument 'fitmodel' output tree  file. The second argument
is the name of the postscript file where the trees will be written.

Need more help? Contact me: guindon@stat.auckland.ac.nz

