Introduction

This is the general outline for running AdaptML. This guide was generated by Sarah Preheim, not Lawrence David, just to keep that in mind. It is meant to complement the user guide provided on the official web page, but also includes some additional information for non-experts.


Download

Download AdaptML from the Alm Lab website and install as directed:

http://almlab.mit.edu/adaptml.html


Input tree

Unrooted tree is used to run AdaptML. Usually I make them with phyml for 2,000 or fewer sequences:

phyml_v2.4.4/exe/phyml_linux all_u.phy 0 i 1 100 GTR e e 4 e BIONJ y y


Running AdaptML

Here is an example of how to run AdaptML:

python ../../latest_adaptml/habitats/trunk/AdaptML_Analyze.py tree=./All_simple_7_ur_particle.phy_phyml_tree.txt2 hab0=16 outgroup=ECK_1 write=./ thresh=0.025

 

Finding Stable Habitats

Although there was a set of habitats predicted, you want to determine how often those same habitats would be predicted from 100 different iterations of AdaptML.

For example:

Now try to standardize with 100 runs:

foreach f ( 0 1 2 3 4 5 6 7 8 9 )

foreach? foreach d (0 1 2 3 4 5 6 7 8 9)

foreach? mkdir ${f}${d}_dir

foreach? python ../../latest_adaptml/habitats/trunk/AdaptML_Analyze.py tree=./All_simple_7_ur_particle.phy_phyml_tree.txt2 hab0=16 outgroup=ECK_1 write=./${f}${d}_dir/ thresh=0.025

foreach? perl parse_migration3.pl ./${f}${d}_dir/habitat.matrix > ./${f}${d}_dir/habitat.matrix.tab

foreach? end

 

Make a list of all of the migration.tab files

ls *_dir/habitat.matrix.tab > migration_list.txt2

Then use temp_dist2.pl to get the habitat number distribution.

perl ~/bin/temp_dist2.pl migration_list.txt2

4    5

5    21

6    53

7    20

8    1

 

The original migration.tab file in ./040609_dir/ has 6 habitats, so just use that to see the percent matching.

Then use get_stable_habitats6.pl and you might have to change the percent matching

so it’s as high as it can go before it dies with double hits.

Results with 0.024:

11    39

3    100

13    100

10    80

12    100

14    99

 

Make clusters

Once you have found a set of stable habitats you want to go with, then make the clusters. This example is for the tree ./example_noroot.phy_phyml_tree.txt3, outgroup ECK_1 using 9900.file to make the final clusters (using python 2.5.1 and you may have to change the paths to point to the AdaptML software):

python ~/AdaptML_dir/latest_AdaptML/habitats/trunk/AdaptML_Analyze.py tree=./example_noroot.phy_phyml_tree.txt3 hab0=16 outgroup=ECK_1 write=./example_dir thresh=0.05

perl ~/bin/migration2color_codes.pl ./example_dir/migration.matrix color_template.txt > ./example_dir/color.file

mkdir ./example_dir/rand_trials

python ~/AdaptML_dir/latest_AdaptML/clusters/getstats/rand_JointML.py habitats=./example_dir/migration.matrix mu=./example_dir/mu.val tree=./example_noroot.phy_phyml_tree.txt3 outgroup=ECK_1 write=./example_dir/rand_trials/

python ~/AdaptML_dir/latest_AdaptML/clusters/getstats/GetLikelihoods.py ./example_dir/rand_trials/ ./example_dir/

python ~/AdaptML_dir/latest_AdaptML/clusters/trunk/JointML.py habitats=./example_dir/migration.matrix mu=./example_dir/mu.val  color=./example_dir/color.file tree=./example_noroot.phy_phyml_tree.txt3 write=./example_dir/ outgroup=ECK_1  thresh=./example_dir/9900.file

 

  • No labels