dentist.common.scaffold

Work with scaffold graphs.

Members

Aliases

ContigNode
alias ContigNode = Tuple!(size_t, "contigId", ContigPart, "contigPart")

A contig is represented by four ContigNodes in the scaffold graph.

Scaffold
alias Scaffold(T) = Graph!(ContigNode, void, No.isDirected, T)

Represents a set of joins which conclude possibly several scaffolding variants.

Enums

ContigPart
enum ContigPart

Each contig has four designated parts where joins can start or end.

JoinPolicy
enum JoinPolicy

Determine which kinds of joins are allowed.

Functions

buildScaffold
Scaffold!T buildScaffold(in size_t numReferenceContigs, R rawJoins)

Build a scaffold graph using rawJoins. This creates default edges and inserts the rawJoins.

discardAmbiguousJoins
Scaffold!T discardAmbiguousJoins(Scaffold!T scaffold, in double bestPileUpMargin)

This removes ambiguous gap insertions.

enforceJoinPolicy
Scaffold!T enforceJoinPolicy(Scaffold!T scaffold, in JoinPolicy joinPolicy)

Enforce joinPolicy in scaffold.

getDefaultJoin
Join!T getDefaultJoin(size_t contigId)
Join!T getDefaultJoin(size_t contigId)

Get the default join for contigId. Initialize payload with getPayload(contigId) if given.

getUnkownJoin
Join!T getUnkownJoin(size_t preContigId, size_t postContigId, T payload)

Get join for a stretch of unknown sequence (ns).

initScaffold
Scaffold!T initScaffold(in size_t numReferenceContigs)
Scaffold!T initScaffold(in size_t numReferenceContigs)

Creates a scaffold with all the default edges. Optionally specify a function that produces the payloads.

isAntiParallel
bool isAntiParallel(in J join)

Returns true iff join is a gap edge and anti-parallel.

isBackExtension
bool isBackExtension(in J join)

Returns true iff join is a back extension edge of the scaffold graph.

isDefault
bool isDefault(in J join)

Returns true iff join is a default edge of the scaffold graph.

isExtension
bool isExtension(in J join)

Returns true iff join is an extension edge of the scaffold graph.

isFrontExtension
bool isFrontExtension(in J join)

Returns true iff join is a front extension edge of the scaffold graph.

isGap
bool isGap(in J join)

Returns true iff join is a gap edge of the scaffold graph.

isParallel
bool isParallel(in J join)

Returns true iff join is a gap edge and parallel.

isUnkown
bool isUnkown(in J join)

Returns true iff join is a unknown edge, ie. an edge for unknown sequence (ns) of the scaffold graph.

isValid
bool isValid(in J join)

Returns true iff join is a valid edge of the scaffold graph.

linearWalk
LinearWalk!T linearWalk(Scaffold!T scaffold, ContigNode startNode, Scaffold!T.IncidentEdgesCache incidentEdgesCache = Scaffold!T.IncidentEdgesCache.init)
LinearWalk!T linearWalk(Scaffold!T scaffold, ContigNode startNode, Join!T firstJoin, Scaffold!T.IncidentEdgesCache incidentEdgesCache = Scaffold!T.IncidentEdgesCache.init)

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, ie. for every node the degree must be at most two. If the component of startNode is cyclic then the walk will in startNode and the isCyclic flag will be set.

mergeExtensionsWithGaps
Scaffold!T mergeExtensionsWithGaps(Scaffold!T scaffold)

Remove extension edges were they coincide with a gap edge combining their payload. This is intended to build pile ups with all reads that contribute to each gap.

normalizeUnkownJoins
Scaffold!T normalizeUnkownJoins(Scaffold!T scaffold)

Normalizes unknown joins such that they join contigs or are removed as applicable.

removeExtensions
Scaffold!T removeExtensions(Scaffold!T scaffold)

Enforce joinPolicy in scaffold.

removeNoneJoins
Scaffold!T removeNoneJoins(Scaffold!T scaffold)

Remove marked edges from the graph. This always keeps the default edges.

scaffoldStarts
auto scaffoldStarts(Scaffold!T scaffold, Scaffold!T.IncidentEdgesCache incidentEdgesCache = Scaffold!T.IncidentEdgesCache.init)

Get a range of ContigNodes where full contig walks should start.

Structs

LinearWalk
struct LinearWalk(T)

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE file.

Authors

Arne Ludwig <arne.ludwig@posteo.de>