Module dentist.common.scaffold
Work with scaffold graphs. A scaffold graph is an undirected graph with optional edge payloads.
For each contig of the input assembly there exist four nodes in the graph:
ContigPart
, ContigPart
, ContigPart
and
ContigPart
. These represent four locations relative to the contig.
Canonical edges are categorized by isDefault
(the contig itself),
isUnkown
(a gap marked by n
s), isGap
(pile up or insertion that
connects two contigs), isFrontExtension
or isBackExtension
(pile up
or insertion that extends beyond the begin/end of a contig).
Gap edges are further categorized as isParallel
or isAntiParallel
depending on weather the involved contigs are connected in the same
(parallel) or opposite (anti-parallel) orientation.
The scaffold graph is used to collect pile ups of read alignments and represent the final assembly.
See also
Functions
Name | Description |
---|---|
buildScaffold(numReferenceContigs, rawJoins)
|
Build a scaffold graph using rawJoins . This creates default edges for
contigs 1 .. numReferenceContigs + 1 and inserts the rawJoins .
Multi-edges are merged using mergeMultiEdges .
|
buildScaffold(rawJoins)
|
Build a scaffold graph using rawJoins . The nodes are deduced from
rawJoins .
|
concatenatePayloads()
|
Combine joins by concatenating their payloads. |
enforceJoinPolicy(scaffold, joinPolicy)
|
Enforce joinPolicy in scaffold . Write discarded joins to
forbiddenJoins if given.
|
getDefaultJoin(contigId)
|
Construct the default join for contigId . Initialize payload with
getPayload(contigId) if given.
|
getUnkownJoin(preContigId, postContigId, payload)
|
Get join for a stretch of unknown sequence (n s).
|
initScaffold(numReferenceContigs)
|
Creates a scaffold the default edges for contigs
1 .. numReferenceContigs + 1 . Optionally specify
a function that produces the payloads.
|
isAntiParallel(join)
|
Returns true iff join is a gap edge and anti-parallel. |
isBackExtension(join)
|
Returns true iff join is a back extension edge of the scaffold graph. |
isCyclic(scaffold, startNode, incidentEdgesCache)
|
Use linearWalk to determine if startNode is part of a cycle.
|
isDefault(join)
|
Returns true iff join is a default/contig edge of the scaffold graph. |
isExtension(join)
|
Returns true iff join is an extension edge of the scaffold graph. |
isFrontExtension(join)
|
Returns true iff join is a front extension edge of the scaffold graph. |
isGap(join)
|
Returns true iff join is a gap edge of the scaffold graph. |
isParallel(join)
|
Returns true iff join is a gap edge and parallel. |
isReal(contigPart)
|
True for the two real locations begin and end .
|
isTranscendent(contigPart)
|
True for the two symbolic locations pre and post .
|
isUnkown(join)
|
Returns true iff join is a unknown edge, ie. an edge for unknown sequence
(n s) of the scaffold graph.
|
isValid(join)
|
Returns true iff join is a valid canonical edge of the scaffold graph. |
linearWalk(scaffold, startNode, incidentEdgesCache)
|
Performs a linear walk through a scaffold graph starting in startNode .
A linear walk is a sequence of adjacent joins where no node is visited
twice unless the graph is cyclic in which case the first node will appear
twice. The implementation requires the graph to have linear components,
i.e. for every node the degree must be at most two. If the component of
startNode is cyclic then the walk will end in startNode and the
isCyclic flag will be set.
|
mergeExtensionsWithGaps(scaffold)
|
Remove extension edges were they coincide with a gap edge combining their payloads. This is intended to build pile ups with all reads that contribute to each gap. |
normalizeUnkownJoins(scaffold)
|
Normalizes unknown joins such that they join contigs or are removed as
applicable. Afterwards the gap joins may not be canonical anymore, i.e.
isUnkown may be false.
|
removeBlacklisted(scaffold, blacklist)
|
Remove blacklisted gap joins. Write discarded joins to
forbiddenJoins if given.
|
removeNoneJoins(scaffold)
|
Remove marked edges from the graph. This always keeps the default edges. |
scaffoldStarts(scaffold, incidentEdgesCache)
|
Returns a range of ContigNode s where full contig walks should start.
|
sumPayloads()
|
Combine joins by summing their payloads. |
Structs
Name | Description |
---|---|
LinearWalk
|
Range that walks linearly through its scaffold graph. |
Enums
Name | Description |
---|---|
ContigPart
|
Each contig has four designated parts where joins can start or end. |
JoinPolicy
|
Determine which kinds of joins are allowed. |
Aliases
Name | Type | Description |
---|---|---|
ContigNode
|
std
|
A contig is represented by four ContigNodes in the scaffold graph: one
for each ContigPart .
|
IncidentEdgesCache
|
Scaffold!T
|
IncidentEdgesCache for Scaffold!T .
|
Join
|
Scaffold!T
|
An edge of the scaffold graph. |
Scaffold
|
Graph!(ContigNode,void,No.isDirected,T)
|
Data structure for the scaffold graph described in the module documentation. |