public interface Dag
Interface Dag
represents a leveled directed acyclic graph (DAG).
DAG
are required to be immutable.Modifier and Type | Method and Description |
---|---|
int |
childNode(int level,
int edge)
Returns the index of the specified child node in the DAG.
|
float |
condEdgeProb(int level,
int edge)
Returns the ratio of the sum of the weights of the sequences that pass
through the specified edge of the DAG and
the sum of the weights of the sequences that pass through the parent
node of the specified edge of the DAG.
|
float |
edgeProb(int level,
int edge)
Returns the ratio of the sum of the weights of the sequences that pass
through the specified edge of the DAG and the sum of the weights of all
sequences.
|
float |
edgeWeight(int level,
int edge)
Returns the sum of the weights of the sequences that pass
through the specified edge of the DAG.
|
int |
inEdge(int level,
int childNode,
int inEdge)
Returns the index of the specified edge in the DAG.
|
boolean |
isChildOf(int parentLevel,
int parentEdge,
int childEdge)
Returns
true if the child node of the specified parent
edge equals the parent node of the specified child edge and
returns false otherwise. |
Markers |
markers()
Returns the markers represented by this DAG.
|
int |
maxEdges()
Returns the maximum number of edges at any level of the DAG.
|
int |
maxNodes()
Returns the maximum number of parent nodes at any level of the DAG.
|
int |
nChildNodes(int level)
Returns the number of child nodes at the specified level of the DAG.
|
long |
nEdges()
Returns the number of edges in the DAG.
|
int |
nEdges(int level)
Returns the number of edges at the specified level of the DAG.
|
int |
nInEdges(int level,
int childNode)
Returns the number of ingoing edges for the specified node of the DAG.
|
int |
nLevels()
Returns the number of markers.
|
long |
nNodes()
Returns the number of nodes in the DAG.
|
int |
nOutEdges(int level,
int parentNode)
Returns the number of outgoing edges for the specified node of the DAG.
|
int |
nParentNodes(int level)
Returns the number of parent nodes at the specified level of the DAG.
|
int |
outEdge(int level,
int parentNode,
int outEdge)
Returns the index of the specified edge in the DAG.
|
int |
outEdgeBySymbol(int level,
int parentNode,
int symbol)
Returns the index of the specified edge at the specified level of the
DAG or
-1 if no such edge exists. |
int |
parentNode(int level,
int edge)
Returns the index of the specified parent node in the DAG.
|
float |
parentProb(int level,
int parentNode)
Returns the ratio of the sum of the weights of the sequences that pass
through the specified parent node of the DAG and the sum of the weights
of all sequences.
|
float |
parentWeight(int level,
int parentNode)
Returns the sum of the weights of the sequences that pass
through the specified node of the DAG.
|
double[] |
posArray()
Returns an array of length
this.nMarkers() whose j -th
element is the distance from the root node to
the child node at level j of the DAG. |
int |
symbol(int level,
int edge)
Returns the symbol labeling the specified edge of the DAG.
|
java.lang.String |
toString()
Returns a string representation of
this . |
java.lang.String |
toString(int start,
int end)
Returns a description of the specified levels of the DAG.
|
int nEdges(int level)
level
- a level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
int nParentNodes(int level)
level
- a level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
int nChildNodes(int level)
level
- a level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
int parentNode(int level, int edge)
level
- a level of the DAG.edge
- the index of an edge at the specified level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
edge < 0 || edge >= this.nEdges(level)
int childNode(int level, int edge)
level
- a level of the DAGedge
- the index of an edge at the specified level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
edge < 0 || edge >= this.nEdges(level)
int symbol(int level, int edge)
level
- a level of the DAGedge
- the index of an edge at the specified level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
edge < 0 || edge >= this.nEdges(level)
float edgeWeight(int level, int edge)
level
- a level of the DAGedge
- the index of an edge at the specified level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
edge < 0 || edge >= this.nEdges(level)
float parentWeight(int level, int parentNode)
level
- a level of the DAGparentNode
- the index of a parent node at the specified level
of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
parentNode < 0 || node >= this.nParentNodes(level)
float condEdgeProb(int level, int edge)
level
- a level of the DAGedge
- the index of an edge at the specified level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
edge < 0 || edge >= this.nEdges(level)
float edgeProb(int level, int edge)
level
- a level of the DAGedge
- the index of an edge at the specified level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
edge < 0 || edge >= this.nEdges(level)
float parentProb(int level, int parentNode)
level
- a level of the DAGparentNode
- the index of a parent node at the specified level
of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
parentNode < 0 || parentNode >= this.nParentNodes(level)
int nLevels()
Markers markers()
long nNodes()
long nEdges()
int maxNodes()
int maxEdges()
int nOutEdges(int level, int parentNode)
level
- a level of the DAGparentNode
- the index of a parent node at the specified
level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
parentNode < 0 || parentNode >= this.nParentNodes(level)
int outEdge(int level, int parentNode, int outEdge)
level
- a level of the DAGparentNode
- the index of a parent node at the specified
level of the DAGoutEdge
- the index of an outgoing edge of the specified
parent nodejava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
parentNode < 0 || parentNode >= nParentNodes(level)
java.lang.IndexOutOfBoundsException
- if
outEdge < 0 || outEdge >= this.nOutEdges(level, parentNode)
int outEdgeBySymbol(int level, int parentNode, int symbol)
-1
if no such edge exists.level
- a level of the DAGparentNode
- the index of a parent node at the specified
level of the DAGsymbol
- a symbol labeling an outgoing edge of the specified
parent node of the DAG-1
if no such edge existsjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
parentNode < 0 || parentNode >= this.nParentNodes(level)
java.lang.IndexOutOfBoundsException
- if
symbol < 0 || symbol >= this.marker(level).nAlleles()
}int nInEdges(int level, int childNode)
level
- a level of the DAGchildNode
- the index of a child node at the specified
level of the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
childNode < 0 || childNode >= this.nChildNodes(level)
int inEdge(int level, int childNode, int inEdge)
level
- a level of the DAGchildNode
- the index of a child node at the specified
level of the DAGinEdge
- the index of an ingoing edge of the specified
child node in the DAGjava.lang.IndexOutOfBoundsException
- if
level < 0 || level >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
childNode < 0 || childNode >= nChildNodes(level)
java.lang.IndexOutOfBoundsException
- if
inEdge < 0 || inEdge >= this.nInEdges(level, childNode)
boolean isChildOf(int parentLevel, int parentEdge, int childEdge)
true
if the child node of the specified parent
edge equals the parent node of the specified child edge and
returns false
otherwise.parentLevel
- a level of the DAGparentEdge
- the index of an edge at the specified level
of the DAGchildEdge
- the index of an edge at level (parentLevel + 1)
of the DAGtrue
if the child node of the specified parent
edge equals the parent node of the specified child edgejava.lang.IndexOutOfBoundsException
- if
parentLevel < 0 || parentLevel >= (this.nMarkers() - 1)
java.lang.IndexOutOfBoundsException
- if
parentEdge < 0 || parentEdge >= this.nEdges(level)
java.lang.IndexOutOfBoundsException
- if
childEdge < 0 || childEdge >= this.nEdges(level + 1)
double[] posArray()
this.nMarkers()
whose j
-th
element is the distance from the root node to
the child node at level j
of the DAG.
The distance from parent node to child node at level lev
equals -Math.log10(P)
where P
is the weighted conditional
edge probability at level lev
, when each edge e
is
weighted by this.counts(lev, e)
.this.nMarkers()
whose j
-th
element is the distance from the root node to
the child node at level j
of the DAGjava.lang.String toString(int start, int end)
start
- the first level (inclusive)end
- the last level (exclusive)java.lang.IllegalArgumentException
- if
start < 0 || start > end || end >= this.nMarkers()
java.lang.String toString()
this
. The exact
details of the representation are unspecifed and subject to change.toString
in class java.lang.Object
this