From 202ff17a11e7d17a4955bc894f7795ee5b789133 Mon Sep 17 00:00:00 2001 From: Ward9250 Date: Mon, 23 May 2016 22:50:23 +0100 Subject: [PATCH] Begun docs for Phylo. --- docs/mkdocs.yml | 1 + docs/src/index.md | 1 + docs/src/man/phylo.md | 49 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 docs/src/man/phylo.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 0e92f997c..9093cead5 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -45,6 +45,7 @@ pages: - IO API: man/reading.md - Biological Sequences: man/seq.md - Alignments: man/alignments.md + - Phylogenetics: man/phylo.md - Intervals: man/intervals.md - Structure: man/structure.md - Tools: man/tools.md diff --git a/docs/src/index.md b/docs/src/index.md index d33d9b2b5..9df1b17eb 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -5,6 +5,7 @@ Pages = [ "man/install.md", "man/seq.md", "man/alignments.md", + "man/phylo.md", "man/intervals.md", "man/structure.md", "man/tools.md" diff --git a/docs/src/man/phylo.md b/docs/src/man/phylo.md new file mode 100644 index 000000000..188fa2209 --- /dev/null +++ b/docs/src/man/phylo.md @@ -0,0 +1,49 @@ +# Bio.Phylo: Phylogenetic trees and models of ancestry + +```@meta +CurrentModule = Bio.Phylo +DocTestSetup = quote + using Bio.Phylo +end +``` + +The `Bio.Phylo` module provides data types and methods for working with +phylogenetic trees and other similar structures that model evolutionary history +and relatedness between taxa. + +## Types + +### Phylogenies + +The phylogeny datatype represents phylogenetic trees in BioJulia. + +The internal structure and representation of the Phylogeny type uses a DiGraph. +DiGraph is a type representing a directed graph and is implemented in the +LightGraphs.jl package. +When a phylogenetic tree is created, the DiGraph is initiated with enough vertices +to be able to represent a fully bifurcating phylogeny, no more and no less. +The vertices of the DiGraph are reserved for different specific purposes. + +Vertex ranges: +* 1:tree.ntaxa => leaf vertices +* tree.ntaxa + 1 => root vertex +* tree.ntaxa + 1:<#nodes> => clade vertices + +As it is common to annotate phylogenies with data, the type is parametric with +two parameters C, and B. Parameter C represents a datatype that annotates clades +of the phylogeny, and parameter B represents a datatype that annotates branches +of the phylogeny. + +Phylogenies can be created with the provided constructors for example, +constructing a phylogeny from just an array of Taxa names creates a basic and +fully unresolved star phylogeny, which can annotate clades and branches with +`Float64` values, which enables you to annotate branch lengths to branches and +confidence values to clades. + +```jlcon +julia> tree = Phylogeny([:Human, :Chimp, :Dog, :Fish]) +Bio.Phylo.Phylogeny{Float64,Float64}({7, 4} directed graph,Bio.Indexers.Indexer{Int64}(Dict(:Fish=>4,:Dog=>3,:Chimp=>2,:Root=>5,:Human=>1),[:Human,:Chimp,:Dog,:Fish,:Root]),Float64[],Dict{Pair{Int64,Int64},Float64}(),4,false,true) + +julia> tree = Phylogeny(["Human", "Chimp", "Dog", "Fish"]) +Bio.Phylo.Phylogeny{Float64,Float64}({7, 4} directed graph,Bio.Indexers.Indexer{Int64}(Dict(:Fish=>4,:Dog=>3,:Chimp=>2,:Root=>5,:Human=>1),[:Human,:Chimp,:Dog,:Fish,:Root]),Float64[],Dict{Pair{Int64,Int64},Float64}(),4,false,true) +```