Skip to content

A program that computes the alignment of two DNA sequences with the Needleman-Wunsch algorithm

Notifications You must be signed in to change notification settings

danielbaud/nwalign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sequence Aligner

Generation

Dependencies

There are no dependencies The project is made with c++17 with STL data types

Compilation

There are two ways to produce the nwalign binary. To produce the binary with the first implementation (ignoring o), do:

$ make nwalign_simple

To produce the binary with the second implementation (that is a bit slower but takes o into account), do:

$ make nwalign

By default, the second version is made doing

$ make

The second version being the most complete, it will be the one used in the usage and example parts. We just made possible to compile a faster version, since it is possible to prefer it to the second one in a realistic context.

Since the substitution matrices are stored in files in the project (in matrices/), the project folder must not be moved after compiling, since the absolute path of the matrices folder is given at compile time. However, the nwalign binary can be executed from anywhere.

To remove the produced files, just do:

$ make clean

Usage

To compute the alignment score of two sequences, do:

$ ./nwalign score <seq1> <seq2>

To get the alignment of two sequences, do:

$ ./nwalign align <seq1> <seq2>

You can also set the values $e$ and $o$ of $\gamma(x) = ex + o$ To do so, do:

./nwalign --gamma=<e>,<o> <cmd> <seq1> <seq2>

Examples

Here are some example of usage:

$ ./nwalign score TTAATCGGATCGGATC GAAATCGCTAA
-2.0
$ ./nwalign align TTAATCGGATCGGATC GAAATCGCTAA
TTAATCGGATCGGATC
GAAATC-G--C-TA-A
$ ./nwalign score HDGDYSCDKSLZIKZDYHQNNS FEZFKEILPMMSCGTDTGZ
8.0
$ ./nwalign align HDGDYSCDKSLZIKZDYHQNNS FEZFKEILPMMSCGTDTGZ
HDGDYSCDKS-L-ZIK--ZDYHQNNS
FE-ZF---KEILPMMSCGTD---TGZ
$ ./nwalign --gamma=-2,-2 score GCTDHFYEHDYZHDTCGZTDFZDTLM DZGDYGCCZPIKZASKDDY
-3.0
$ ./nwalign --gamma=-2,-2 align GCTDHFYEHDYZHDTCGZTDFZDTLM DZGDYGCCZPIKZASKDDY
GCTDHFYEHDYZHDTC---GZTDFZDTLM
---D---ZGDY--GCCZPIKZAS-KDD-Y

About

A program that computes the alignment of two DNA sequences with the Needleman-Wunsch algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published