Installation
Install Julia
Julia is a high-level and interactive programming language (like R or Matlab), but it is also high-performance (like C). To install Julia, follow instructions here. For a quick & basic tutorial on Julia, see learn x in y minutes.
Editors:
- Visual Studio Code provides an editor and an integrated development environment (IDE) for Julia: highly recommended! Positron is a great (and similar) alternative.
- Install the Julia extension in VS Code or Positron.
- We can also run Julia in a Pluto notebook. Pluto.jl is a great to get started with Julia.
Julia code is just-in-time compiled. This means that the first time we run a function, it will be compiled at that moment. Future calls to the function will be much faster. Trying out toy examples for the first calls is a good idea.
Install PhyloNetworks
To install the package, type inside Julia:
using Pkg
Pkg.add("PhyloNetworks")
If you already installed the package and want the latest registered version, do this to update all of your packages:
Pkg.update()
It is important to update the package regularly as it is undergoing constant development. Join the google group for updates here.
Pkg.update()
will install the latest registered version, but there could be other improvements in the master
branch of the repository. If you want to update to the latest unregistered version of the package, you can do Pkg.add(PackageSpec(name="PhyloNetworks", rev="master"))
just beware that the latest changes could be not as robust. If you want to go back to the registered package, you can do Pkg.free("PhyloNetworks")
.
Similarly, you can pin a version of the package Pkg.pin("PhyloNetworks")
so that Pkg.update()
will not modify it. You can always free a pinned package with Pkg.free("PhyloNetworks")
. More on package management here.
The PhyloNetworks package has dependencies like NLopt and DataFrames (see the Project.toml
file for the full list), but everything is installed automatically.
The companion package PhyloPlots has utilities to visualize networks, and for interoperability, such as to export networks to R (which can then be plotted via R). To install:
using Pkg
Pkg.add("PhyloPlots")
PhyloPlots depends on PhyloNetworks, and has further dependencies like RCall
To check that your installation worked, type this in Julia to load the package. This is something to type every time you start a Julia session:
using PhyloNetworks
This step can also take a while, to pre-compile the code (after a package update for instance).