May 2022
This repository contains C++ implementations of two popular sequence alignment algorithms: Needleman-Wunsch and Hirschberg. These algorithms are widely used in bioinformatics and computational biology for aligning sequences such as DNA, RNA, or proteins 🧬.
The Needleman-Wunsch algorithm is a dynamic programming approach for global sequence alignment. It computes the optimal alignment score and traceback to determine the aligned sequences. This implementation provides a clear and concise example of how to use the algorithm in C++.
Just compile NeedlemanWunsch.cpp
and run the code , providing input sequences as required in the head. The output will include the optimal alignment score and the aligned sequences.
The Hirschberg algorithm is an improvement over Needleman-Wunsch in terms of space complexity. It uses a divide-and-conquer strategy to achieve linear space complexity, making it more memory-efficient. This implementation demonstrates the application of the Hirschberg algorithm in C++.
Compile Hirschberg.cpp
and run the code, providing input sequences as required. The output will include the aligned sequences.
Both implementations can be compiled using a standard C++ compiler, such as g++.
This code is provided as-is, without any warranty. Use it at your own risk. It is intended for academic and educational purposes only. Feel free to explore, modify, and contribute to this repository. If you have any questions or suggestions, please open an issue or submit a pull request.
Happy coding! 🚀 </>