Skip to content

Construct the de Bruijn Graph of a String #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hamidgasmi opened this issue May 31, 2020 · 0 comments
Closed

Construct the de Bruijn Graph of a String #186

hamidgasmi opened this issue May 31, 2020 · 0 comments
Assignees

Comments

@hamidgasmi
Copy link
Owner

Construct the de Bruijn graph of a string.

Input: An integer k and a string Text.

Output: DeBruijnk(Text), in the form of an adjacency list.

Given a genome Text, PathGraphk(Text) is the path consisting of |Text|-k+1 edges, where the i-th edge of this path is labeled by the i-th k-mer in Text and the i-th node of the path is labeled by the i-th (k-1)-mer in Text. The de Bruijn graph DeBruijnk(Text) is formed by gluing identically labeled nodes in PathGraphk(Text).

Input Format.
The 1st. line of the input contains an integer k.
The 2nd. line of the input contains a string Text

*Output Format.
DeBruijnk(Text) in the form of an adjacency list.
Specifically, each line of the output represents a single edge (u,v) in the format “u->v” (no quotes), where u and v are both (k-1)-mers.
The following would be an example of an edge corresponding to a 4-mer ACGT: ACG -> CGT.
If a given node u has multiple edges leaving it (e.g. v and w), the destination nodes are comma-separated in any order.
E.g, if there exist nodes ACG, CGT, and CGG, the resulting line of the adjacency list would be: ACG -> CGT,CGG

Constraints. 50 ≤ k ≤ 100; |Text| ≤ 1,000

@hamidgasmi hamidgasmi self-assigned this May 31, 2020
hamidgasmi pushed a commit that referenced this issue May 31, 2020
hamidgasmi pushed a commit that referenced this issue May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant