TreeNode 1.5.2
A library to manipulate phylogenetic trees
|
Represents a sequence of characters. More...
Public Member Functions | |
Sequence (ReadOnlySpan< char > sequence) | |
Creates a new Sequence. More... | |
Sequence (ReadOnlySpan< char > sequence, IReadOnlyList< char > states) | |
Creates a new Sequence. More... | |
Sequence (ReadOnlySpan< char > sequence, IReadOnlyList< char > states, IReadOnlyList< double > conservation) | |
Creates a new Sequence. More... | |
Sequence (ReadOnlySpan< char > sequence, IReadOnlyList< char > states, IReadOnlyList< double > conservation, IReadOnlyList< double > indelProfile) | |
Creates a new Sequence. More... | |
override string | ToString () |
IEnumerator< char > | GetEnumerator () |
Sequence | Evolve (RateMatrix rateMatrix, double time) |
Simulates the evolution of the Sequence over the specified amount of time , using the specified rate matrix. No indels are allowed to happen. More... | |
Sequence | Evolve (RateMatrix rateMatrix, IndelModel indelModel, double time) |
Simulates the evolution of the Sequence over the specified amount of time , using the specified rate matrix. Insertions and deletions happen according to the specified indelModel . More... | |
Sequence | Evolve (RateMatrix rateMatrix, IndelModel indelModel, double time, out Insertion[] insertions) |
Simulates the evolution of the Sequence over the specified amount of time , using the specified rate matrix. Insertions and deletions happen according to the specified indelModel . More... | |
Dictionary< string, Sequence > | Evolve (TreeNode tree, RateMatrix rateMatrix, double scale=1, IndelModel indelModel=null) |
Simulates the evolution of the sequence over a phylogenetic tree , with the specified rate matrix, scale factor, and insertion/deletion model. More... | |
Dictionary< string, Sequence > | EvolveAll (TreeNode tree, RateMatrix rateMatrix, double scale=1, IndelModel indelModel=null) |
Simulates the evolution of the sequence over a phylogenetic tree , with the specified rate matrix, scale factor, and insertion/deletion model. More... | |
Static Public Member Functions | |
static implicit | operator string (Sequence sequence) |
Converts a Sequence to a string More... | |
static Sequence | RandomSequence (int length, RateMatrix rateMatrix) |
Create a random sequence with the specified length , using the states and equilibrium frequencies from the rateMatrix . More... | |
static Sequence | RandomSequence (int length, IReadOnlyList< char > states) |
Create a random sequence with the specified length containing all states with equal probability. More... | |
static Sequence | RandomSequence (int length, char[] states) |
Create a random sequence with the specified length containing all states with equal probability. More... | |
static Sequence | RandomSequence (int length, IReadOnlyList< char > states, IReadOnlyList< double > stateFrequencies) |
Create a random sequence with the specified length containing each state with probabilities given by stateFrequencies . More... | |
static Sequence | RandomSequence (int length, char[] states, double[] stateFrequencies) |
Create a random sequence with the specified length containing each state with probabilities given by stateFrequencies . More... | |
Properties | |
ImmutableArray< char > | States [get] |
The possible states that make up the sequence. Note that some states may not actually be present in the sequence. More... | |
ImmutableArray< double >? | Conservation [get] |
The conservation profile of the sequence. If this is null , all positions in the sequence are equally conserved. More... | |
ImmutableArray< double >? | IndelProfile [get] |
The indel profile of the sequence. If this is null , all positions in the sequence have equal probability of being affected by an indel event. More... | |
string | StringSequence [get] |
Returns the sequence as a string . More... | |
int | Length [get] |
The length of the sequence. More... | |
int | Count [get] |
char | this[int index] [get] |
Represents a sequence of characters.
Definition at line 14 of file Sequence.cs.
PhyloTree.SequenceSimulation.Sequence.Sequence | ( | ReadOnlySpan< char > | sequence | ) |
PhyloTree.SequenceSimulation.Sequence.Sequence | ( | ReadOnlySpan< char > | sequence, |
IReadOnlyList< char > | states | ||
) |
Creates a new Sequence.
sequence | The sequence. |
states | The possible states for the sequence. |
Definition at line 95 of file Sequence.cs.
PhyloTree.SequenceSimulation.Sequence.Sequence | ( | ReadOnlySpan< char > | sequence, |
IReadOnlyList< char > | states, | ||
IReadOnlyList< double > | conservation | ||
) |
Creates a new Sequence.
sequence | The sequence. |
states | The possible states for the sequence. |
conservation | The conservation profile for the sequence. |
Definition at line 125 of file Sequence.cs.
PhyloTree.SequenceSimulation.Sequence.Sequence | ( | ReadOnlySpan< char > | sequence, |
IReadOnlyList< char > | states, | ||
IReadOnlyList< double > | conservation, | ||
IReadOnlyList< double > | indelProfile | ||
) |
Creates a new Sequence.
sequence | The sequence. |
states | The possible states for the sequence. |
conservation | The conservation profile for the sequence. |
indelProfile | The indel profile for the sequence. |
Definition at line 161 of file Sequence.cs.
Sequence PhyloTree.SequenceSimulation.Sequence.Evolve | ( | RateMatrix | rateMatrix, |
double | time | ||
) |
Simulates the evolution of the Sequence over the specified amount of time , using the specified rate matrix. No indels are allowed to happen.
rateMatrix | The rate matrix to simulate sequence evolution. |
time | The length of time over which the sequence evolves. |
Definition at line 288 of file Sequence.cs.
Sequence PhyloTree.SequenceSimulation.Sequence.Evolve | ( | RateMatrix | rateMatrix, |
IndelModel | indelModel, | ||
double | time | ||
) |
Simulates the evolution of the Sequence over the specified amount of time , using the specified rate matrix. Insertions and deletions happen according to the specified indelModel .
rateMatrix | The rate matrix to simulate sequence evolution. |
indelModel | The insertion/deletion model. |
time | The length of time over which the sequence evolves. |
Definition at line 303 of file Sequence.cs.
Sequence PhyloTree.SequenceSimulation.Sequence.Evolve | ( | RateMatrix | rateMatrix, |
IndelModel | indelModel, | ||
double | time, | ||
out Insertion[] | insertions | ||
) |
Simulates the evolution of the Sequence over the specified amount of time , using the specified rate matrix. Insertions and deletions happen according to the specified indelModel .
rateMatrix | The rate matrix to simulate sequence evolution. |
indelModel | The insertion/deletion model. |
time | The length of time over which the sequence evolves. |
insertions | An array containing all the insertion events that have occurred during the evolution of the sequence (useful to map the evolved sequence back onto the ancestral sequence). |
Definition at line 320 of file Sequence.cs.
Dictionary< string, Sequence > PhyloTree.SequenceSimulation.Sequence.Evolve | ( | TreeNode | tree, |
RateMatrix | rateMatrix, | ||
double | scale = 1 , |
||
IndelModel | indelModel = null |
||
) |
Simulates the evolution of the sequence over a phylogenetic tree , with the specified rate matrix, scale factor, and insertion/deletion model.
tree | The tree over which the sequence evolves. This is assumed to be rooted (i.e., the ancestral sequence is placed at the root of the tree). |
rateMatrix | The rate matrix that governs the evolution of the sequence. |
scale | A scaling factor. If this is different from 1, the effect is the same as multiplying the branch lengths of the tree or the rate matrix by the supplied value. |
indelModel | The model for insertions/deletions. If this is null, no insertions/deletions are allowed to happen. |
string
containing the TreeNode.Name of the node, and the value is a Sequence containing the sequence. The sequences are all aligned.Definition at line 351 of file Sequence.cs.
Dictionary< string, Sequence > PhyloTree.SequenceSimulation.Sequence.EvolveAll | ( | TreeNode | tree, |
RateMatrix | rateMatrix, | ||
double | scale = 1 , |
||
IndelModel | indelModel = null |
||
) |
Simulates the evolution of the sequence over a phylogenetic tree , with the specified rate matrix, scale factor, and insertion/deletion model.
tree | The tree over which the sequence evolves. This is assumed to be rooted (i.e., the ancestral sequence is placed at the root of the tree). |
rateMatrix | The rate matrix that governs the evolution of the sequence. |
scale | A scaling factor. If this is different from 1, the effect is the same as multiplying the branch lengths of the tree or the rate matrix by the supplied value. |
indelModel | The model for insertions/deletions. If this is null, no insertions/deletions are allowed to happen. |
string
containing the TreeNode.Id of the node, and the value is a Sequence containing the sequence. The sequences are all aligned.Definition at line 367 of file Sequence.cs.
IEnumerator< char > PhyloTree.SequenceSimulation.Sequence.GetEnumerator | ( | ) |
Definition at line 228 of file Sequence.cs.
|
static |
Converts a Sequence to a string
sequence | The Sequence to convert. |
Definition at line 216 of file Sequence.cs.
|
static |
Create a random sequence with the specified length containing all states with equal probability.
length | The length of the sequence. |
states | The character states to use for the sequence. |
|
static |
Create a random sequence with the specified length containing each state with probabilities given by stateFrequencies .
length | The length of the sequence. |
states | The character states to use for the sequence. |
stateFrequencies | The frequency for each state. |
|
static |
Create a random sequence with the specified length containing all states with equal probability.
length | The length of the sequence. |
states | The character states to use for the sequence. |
|
static |
Create a random sequence with the specified length containing each state with probabilities given by stateFrequencies .
length | The length of the sequence. |
states | The character states to use for the sequence. |
stateFrequencies | The frequency for each state. |
|
static |
Create a random sequence with the specified length , using the states and equilibrium frequencies from the rateMatrix .
length | The length of the sequence. |
rateMatrix | The rate matrix. |
override string PhyloTree.SequenceSimulation.Sequence.ToString | ( | ) |
Definition at line 222 of file Sequence.cs.
|
get |
The conservation profile of the sequence. If this is null
, all positions in the sequence are equally conserved.
Definition at line 27 of file Sequence.cs.
|
get |
Definition at line 55 of file Sequence.cs.
|
get |
The indel profile of the sequence. If this is null
, all positions in the sequence have equal probability of being affected by an indel event.
Definition at line 33 of file Sequence.cs.
|
get |
The length of the sequence.
Definition at line 49 of file Sequence.cs.
|
get |
The possible states that make up the sequence. Note that some states may not actually be present in the sequence.
Definition at line 22 of file Sequence.cs.
|
get |
Returns the sequence as a string
.
Definition at line 38 of file Sequence.cs.
|
get |
Definition at line 58 of file Sequence.cs.