This repository contains a high-performance implementation of the Needleman-Wunsch algorithm for global sequence alignment. Using MPI (Message Passing Interface), the system parallelizes the comparison of multiple genetic sequences, specifically focusing on the COX1 (Cytochrome c oxidase subunit I) gene across different species.
- Parallel Computing with MPI: Distributes alignment tasks across multiple CPU cores using
mpi4py, significantly reducing the time complexity for large-scale comparisons. - Global Alignment Algorithm: A robust dynamic programming implementation of the Needleman-Wunsch algorithm for optimal similarity scoring.
- Bioinformatics Integration: Seamlessly parses FASTA records using
Biopythonfor systematic genomic analysis. - Scalable Architecture: Designed to scale linearly with the number of available processors.
- Programming Language: Python
- Parallelism:
mpi4py(MPI for Python) - Library Support:
Biopython(SeqIO),NumPy - Dataset: 16 distinct COX1 gene sequences retrieved from GenBank (FASTA format).
- Master Node (Rank 0): Loads 16 COX1 sequence files from the
/datadirectory. - Broadcast: Distributes sequence data to all worker nodes via
comm.bcast. - Parallel Tasking: Worker nodes independently calculate alignment scores for assigned pairs.
- Gather: Rank 0 collects all scores and outputs the final evolutionary distance matrix/summary.
parallel_alignment.py: Core parallelized Python script./data: Contains 16 sample.fastafiles for immediate testing.requirements.txt: Project dependencies.
Ensure you have an MPI implementation (like MS-MPI or MPICH) installed on your system.
pip install mpi4py biopython numpy