-
Notifications
You must be signed in to change notification settings - Fork 49
Introduction
Explicit networks have a biological interpretation: main evolutionary
history is depicted by the "major tree"; internal nodes represent
ancestral species; models can account for ILS and gene tree estimation error.
Explicit:
Implicit networks are typically descriptive,
do not discriminate between ILS, gene flow/hybridization or gene tree estimation error,
and can be hard to interpret biologically.
Implicit:
PhyloNetworks is a Julia package for phylogenetic networks with functions like
- read/write networks in parenthetical format,
- plot networks,
- change the root,
- estimate the maximum pseudolikelihood network,
- do bootstrap analysis, and
- summarize a sample of (bootstrap) networks.
Why Julia? Julia is a high-level and interactive programming language (like R or Matlab), but it is also high-performance (like C). Also, Julia allows for collaborations in an easy way through Github.
You can open Julia from the terminal (if you included the julia executable to your PATH, see requirements) or with the app.
We suggest to update the Julia packages regularly: Pkg.update()
, but
be careful of the "build status"
here.
Pkg.update()
will update to the latest registered version, but you
can also get unregistered changes. More details
here.
Inside Julia, you can use the PhyloNetworks package with
using PhyloNetworks
To change the directory used by julia in a session, say to a folder named "tutorial" in your "Desktop", you have 2 options.
- quit your session, navigate to the directory and restart julia there.
- or change the working directory within your Julia session like this
homedir() # just to show the command homedir() to extract the path to your home directory
cd("$(homedir())/Desktop/tutorial") # changes the working directory
pwd() # just to check: print working directory
If you are going to use the example data, make sure you are inside the
folder baseline.gamma0.3_n30
. If you are using your own data, make
sure that you are in the folder where that data is.
Recall that in parenthetical format, internal nodes can have a name:
To represent networks in parenthetical format, we simply need to split
each hybrid node into two nodes with the same name:
By convention, the hybrid tag is # + H,LGT,R + number
, and the minor
hybrid edge leads to a leaf.
Thus, we get: (((A,(B)#H1),(C,#H1)),D);
. We can write inheritance
probabilities in the parenthetical format: (C,#H1):branch length:bootstrap support:inheritance probability
.
In Julia:
net = readTopology("(((A,(B)#H1:::0.9),(C,#H1:::0.1)),D);")
writeTopology(net)
NOTE: the first time you run a function in Julia, it is compiled. So, it is slow. Subsequent runs of the function are faster.
net
, as obtained above, is a Julia object that can be manipulated inside Julia. For
example, you can plot it with:
plot(net)
p=plot(net)
using Gadfly
draw(PDF("myplot.pdf",4inch,4inch),p)
The hybrid edges are displayed in blue: dark blue for the major edge,
and light blue for the minor edge.
There are options to show node/edge numbers, edge length, inheritance probabilities,
change colors, etc. Type ?
within Julia to turn on the help mode, and then plot
to get help and options on the plot function.
We can also change the root placement to a different edge or node, or to an outgroup.
rootatnode!(net,"A")
plot(net)
WARNING: we need to be careful with the placement of the root, because it should agree with the direction of the hybrid edges.
Next: estimate a network from data with SNaQ.
PhyloNetworks Workshop
- home
- example data
-
TICR pipeline:
from sequences to quartet CFs
- the data
- MrBayes on all genes
- BUCKy
- Quartet MaxCut
- RAxML & ASTRAL
- PhyloNetworks: from quartet CFs or gene trees to phylogenetic networks
- TICR test: is a population tree with ILS sufficient (vs network)?
- Continuous trait evolution on a network