Question: You are tasked with implementing a multiple sequence aligner using python based upon the Feng-Doolittle algorithm. This algorithm will make use of Needleman-Wunsch global alignment

You are tasked with implementing a multiple sequence aligner using python based upon the Feng-Doolittle algorithm. This algorithm will make use of Needleman-Wunsch global alignment algorithm.Your solution should read through a FASTA file containing N sequences taken as input (-i), calculate a distance matrix, utilize the Fitch-Margoliash algorithm to determine a guide tree, then utilize the Feng-Doolittle algorithm to select and merge sequences until all sequences have been merged into the MSA. The resulting aligned sequences will then be written to an output file as given by the output argument (-o). The output file should contain the following changes: 1) The sequence header for each sequence will have a semicolon ; appended to the end of it as well as a score=S where S represents the alignment score. The sequence will now be the aligned sequence containing any gaps being represented by hyphens -.Example: i. Input >Input Sequence 1 ACGTAGCTAGCTAGG ii. Output >Input Sequence 1; score=13 ACGTAG-CTAG--CTAGG. Your program must be compatible with Python 3.11.3.Your program must be capable of accepting command line arguments as described below: -i o Purpose: This option retrieves the file path to the starting FASTA file. o Input Type: String o Validation: Entire file path must exist, otherwise error. o Required: Yes -o o Purpose: This option retrieves the file path for the output FASTA file. o Input Type: String o Validation: The directories in the file path must exist, otherwise error. o Required: Yes -s o Purpose: This option retrieves the file path for the scoring matrix. o Input Type: String o Validation: Entire file path must exist, otherwise error. o Required: Yes. Example execution: python3 Amruth_Poodipeddi_R123456_Preparation_4.py -i in.fna -o out.fna -s BLOSUM50.mtx o Instructs python to run Amruth_Poodipeddi_R123456_Preparation_4.py o Sets the input file option to in.fna o Sets the output file option to out.fna o Sets the score matrix file option to BLOSUM50.mtx. The scoring matrix file contains the nucleotide or amino acid scores for each possible pair of bases. Program Output : Your program may print as much information as you wish to stdout / stderr during execution. The first line of output printed to stdout during execution must be Task 4 :: R123456 That is the only required item it must print. Your program correctness will be determined by the output found in the file specified by the -o argument. Some hints: I would suggest to start with implementing the Needleman-Wunsch global alignment algorithm, a foundational algorithm in bioinformatics for sequence alignment. This code should run perfectly against 9 tests. Three nucleotide tests,Three protein tests against BLOSUM50 and Three protein tests against BLOSUM62.The following are tested: 1.fna with nucleotide.mtx 2.fna with nucleotide.mtx 3.fna with nucleotide.mtx 4.fna with BLOSUM50.mtx 5.fna with BLOSUM62.mtx 6.fna with BLOSUM50.mtx 7.fna with BLOSUM62.mtx 8.fna with BLOSUM50.mtx 9.fna with BLOSUM62.mtx Now the most important task is : To a fully fuctioning above Needleman-Wunsch global alignment algorithm,add the following critical functions: a. A function that converts an alignment score to a distance score. i. Normalize the score (Deck 06 Slide 20). ii. Convert to distance (Deck 06 Slide 21). b. A function to compute the sum of pairs. (Deck 06 Slide 15) Basic Algorithm (my main() function): a. Read in the sequence file. seqs getSequences(<-i seqFile>) b. Read in the score matrix. subM getScoreMatrix(<-s scoreFile>) c. Generate distance matrix. D buildDistanceMatrix(seqs, subM) d. Construct Guide Tree. T constructGuideTree(seqs, subM, D) e. Perform MSA MSA getMSA(seqs, subM, T) f. Get final score. score sumOfPairs(MSA, subM) g. Write to output FASTA file. writeToFasta(seqs, <-o output file>)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!