Coder Social home page Coder Social logo

dynamicdbg's Introduction

Dynamic de Bruijn Graph implementation

Copyright Alan Kuhnle, Victoria Crawford

Compact data structures for the representation of de Bruijn graphs are important for genome sequence assembly. A fully dynamic data structure supporting efficient and exact membership queries for de Bruijn graphs was recently proposed in [1]. This software is an implementation of the data structure in [1] with dynamic edges (and not dynamic nodes).

[1]: Belazzougui, D., Gagie, T., Maekinen, V., and Previtali, M. (2016). Fully Dynamic de Bruijn Graphs. In String Processing and Information Retrieval, pages 145โ€“152.

Dependencies

This implementation depends on the Boost C++ library: http://www.boost.org/doc/libs/1_59_0/more/getting_started/unix-variants.html

Installing Boost on a Debian-based system should require only the following command:

sudo apt-get install libboost-all-dev

We use the BBhash implementation of a minimal perfect hash function, which is included in our source code. The implementation is available here: https://github.com/rizkg/BBHash/

Dynamic de Bruijn Graph

The dynamic De Bruijn graph is implemented in the class FDBG in cpp-src/FDBG.cpp.

We provide a program cpp-src/BuildDataStructure.cpp that takes in a fasta file and a k-mer length. A Makefile to compile this file is provided in cpp-src, which may need to be edited to include the Boost location on your system.

Example dataset

In the cpp-src directory, a file yeast.fasta is present. This is the reference genome for yeast strain S288C in fasta format; it can be used to test our data structure with the BuildDataStructure.cpp example program.

Instructions to run BuildDataStructure.cpp

  • Install the Boost dependency (see dependencies above).
  • Go to ./cpp-src
  • Compile using the included Makefile, editing it if necessary.
    make
    
  • After compilation, the executable bds should have been produced. This program requires two arguments. The first argument is any fasta file, for example the included yeast.fasta file. The second argument is the desired value of k for de Bruijn graph, must be between 1 and 31. Example:
    ./bds yeast.fasta 20
    

Description of output for BuildDataStructure

During execution, bds will print detailed logs to the screen. These logs indicate when each step of the construction of the data structure begins. In order, these steps are the following

  • Parses fasta file
  • Writes binary files for the k-mers found so that on future runs, these files are loaded instead
  • Begins construction of De Bruijn graph
    • Construction of Karp-Rabin hash function
    • Injectivity test
    • Construction of minimal perfect hash function
    • Computation of r inverse modulo P
    • Construction of IN, OUT matrices
    • Forest construction
  • Once construction is complete, the data structure is saved in binary format to a file.
  • Tree height tests are conducted on the forest
  • Edges are dynamically removed from the data structure, and then added back in; the forest is updated after each change.

dynamicdbg's People

Contributors

vcrawford avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.