Skip to content
This repository was archived by the owner on Aug 26, 2023. It is now read-only.

Begun docs for Phylo. #200

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
49 changes: 49 additions & 0 deletions docs/src/man/phylo.md
Original file line number Diff line number Diff line change
@@ -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)
```