Phylogenetics: SMap lab
|EEB 349: Phylogenetics|
|In this lab you will learn how to use the program sMap, written by Giorgio Bianchini and Patricia Sánchez-Baracaldo. sMap uses stochastic character mapping to assess correlation among discrete characters.|
Login to Xanadu and request a machine as usual:
srun --pty -p mcbstudent --qos=mcbstudent bash
Use curl to download the tar-gzipped file sMap-linux-x64.tar.gz (note the L in -LO is important in this case because the URL involves a redirect that should be followed to get to the actual file):
Unpack the tar file:
tar zxvf sMap-linux-x64.tar.gz
You can now delete the tar.gz file if you want:
The executable file sMap is buried inside the directory created when you extracted the tar file. You can either always specify the full path to this file when you want to run it, or you can use a couple of different methods to make invoking it easier. One of the simplest methods is to create an alias:
Now typing sMap at the console, whereever you are, will invoke the program (try it!). You can see any aliases you've defined by typing alias at the command prompt.
Important: You'll notice that the alias is named sMap, not smap. There is a unix command named smap that your alias would replace if it were named smap. It is highly unlikely that you will ever use the smap command, but it is probably wise to not create aliases that replace existing functionality with something entirely different. So, I've named my alias sMap to avoid confusion (and that may be why the software itself has that capital M in the name).
If you want your alias to be present whenever you login to Xanadu, you need to add it to your .bashrc file. The .bashrc file is one of those files beginning with a dot that are hidden by default, so you will not see it when you type ls in your home directory. You can see if you tell the ls command that you want to see everything:
cd ls -la
Edit the .bashrc file (which may not even exist yet) and add (on a line by itself at the very bottom of the file) the same alias command that I specified above. This will be loaded the next time you log into Xanadu.
Downloading the data for the tutorial
Create a directory for this lab and navigate into it:
cd # to ensure that you are in your home directory mkdir smaplab cd smaplab
Download the Pontederiaceae data for the tutorial using curl:
curl -L https://github.com/arklumpus/sMap/blob/master/Tutorials/Tutorial8/Tutorial8.zip?raw=true > Tutorial8.zip unzip Tutorial8.zip rm Tutorial8.zip
We will be interested in exploring the evolutionary correlation between mating system and self-(in)compatibility in the plant family Pontederiaceae. This lab is basically a shortened version of similar tutorials in the sMap manual. If it turns out that you want to use sMap in your own research, I recommend that you take the time to go through the tutorials in the sMap manual, which is exemplary in its combination of clear overviews of models and methods and detailed and extensive tutorials.
The Pontederiaceae is a family of aquatic flowering plants (monocots) that attracted the attention of Charles Darwin because of the presence of a form of heterostyly known as tristyly in some species. In tristylous species, individual plants produce one of 3 types of flowers:
- style short and stamen filaments long and intermediate
- style intermediate and stamen filaments short and long
- style long and stamen filaments short and intermediate
Each of these morphs thus deposits pollen on a pollinator in locations that specifically physically preclude fertilization in flowers of the same morph, reducing the amount of self-fertilization at the expense of wasting some pollen. In some tristylous species, outcrossing is further promoted by self-incompatibility, which means that even if pollen were accidentally transferred from one flower to another on the same plant, no fertilization would occur. We might ask whether self-incompatibility and tristyly are evolutionarily correlated, and, if so, does self-incompatibility tend to evolve in already-tristylous species, or vice versa?
Mating system trait
The data for the mating system trait is in the file Pontederiaceae_flower.txt. The three states are
- M: monomorphic (flowers are all the same)
- E: enantiostylous (flowers are either "left-handed" or "right-handed" with respect to style position)
- T: tristylous (flowers are one of the three types described above)
Photos of the three flower morphs in Pontederia subovata can be seen in Figure 1 of the paper by Puentes et al. (2013).
The data for the self-compatibility trait is in the file Pontederiaceae_self.txt. The two states are
- C: self-compatible
- I: self-incompatible
Note that data for both traits in all 24 taxa are in the file Pontederiaceae.txt.
Nucleotide sequence data from the rbcL and ndhF genes were used for a Bayesian MCMC analysis, resulting in 1000 sampled trees from the posterior (file Pontederiaceae.treedist) as well as a 50% majority-rule consensus tree (Pontederiaceae.tre).
Stochastic mapping for the self-incompatibility trait
Create a directory called self inside your smaplab directory:
cd ~/smaplab mkdir self
Now run sMap as follows:
smap -t Pontederiaceae.treedist -T Pontederiaceae.tre -d Pontederiaceae_self.txt -o self/ard -n 1000 -i Pontederiaceae_self.model.Bayes.ARD.nex --pp 100
Here is a summary of the command line arguments:
- -t specifies the trees to be used (these are from analyses of the nucleotide data)
- -T specifies the tree to use for displaying results
- -d specifies the morphological data
- -o specifies the output file prefix
- -n specifies the number of mappings to perform
- -i specifies the model to be used
- --pp specifies the number of posterior predictive samples to be drawn for each of the 1000 parameter values that were estimated (one from each tree topology)
A Puentes, WW Cole, and SCH Barrett. 2013. Trimorphic Incompatibility in Pontederia subovata (Pontederiaceae): An Aquatic Macrophyte from Lowland South America. International Journal of Plant Sciences 174(1): 47-56. PDF