Implement an algorithm that computes an alignment

Assignment Help JAVA Programming
Reference no: EM132475804

Problem 1

Your task is to implement an algorithm for pairwise alignment that computes, for two given protein sequences X and Y, a highest- scoring alignment between X and any substring of Y. The scoring model is given by a substitution matrix s (we use the BLOSUM50 matrix) and linear gap penalties with parameter d (we use d=8). You can use the implementation of the Needleman-Wunsch algorithm provided below as a starting point for your implementation. Your specific tasks are:

Implement an algorithm that computes an alignment of highest score among all alignments between X and any substring of Y, using the substitution matrix BLOSUM50 and linear gap penalties with parameter d.

Modify the program so that, in addition to a highest-scoring alignment between X and any substring of Y, it outputs the number of different such alignments. The program should output "There are x optimal alignments." where x is the number of different optimal alignments between X and a substring of Y.

Submit your solution as a java file called Alignment.java. (You can submit additional files if necessary.) You can combine the solutions to both question parts into a single method that computes an optimal alignment and outputs the additional information required by (b), but you can also write separate methods if you prefer.

As a starting point, you are free to use the following implementation of the Needleman-Wunsch algorithm with linear gap penalties in Java:
• Alignment.java (Needleman-Wunsch algorithm for global alignment)
This file Alignment.java contains a main method and several other useful methods. The main method defines two sequences X and Y. It then creates an Alignment object that stores these two sequences as Strings X and Y. Then it calls the computeAlignment method on this object; the Needleman-Wunsch algorithm is implemented in that method. It stores the computed alignment in the member variables Xa and Ya of the Alignment object. In the end, the main method displays the alignment and outputs its score.
Some auxiliary methods and variables that are implemented in Alignment.java are:
• int s(char x, char y): computes the BLOSUM50 score for aligning x with y. Note that the parameters x and y must be valid characters from the BLOSUM50 matrix (A, R, N, etc.; see slide 39 of part 1 of the slides).
• final static int d = 8; gap penalty parameter for linear gap penalties
• static int gamma(int g): calculate gap penalty for gap of length g (using linear gap penalties with parameter d)
• int scoreAlignment(): scores an alignment using the BLOSUM50 matrix and the gap penalty function gamma

Problem 2 Sorting by Reversals - Unsigned Model

Implement an algorithm for Sorting by Reversals (in the unsigned model of unichromosomal genomes) in a Java program. (If you want to use another programming language, please discuss it with the module convenor.) For any given permutation p of the numbers from 1 to n (where n is an arbitrary positive integer), the program should find a sequence of reversals that sorts p. You can use ideas from the algorithms discussed in the lectures (the greedy algorithm, the 4-approximation algorithm, or the 2-approximation algorithm) or design your own method. Your solution will be mainly marked based on the quality of the solutions produced (i.e. how many reversals does your program need to sort a given permutation), but also based on the general quality of your implementation (e.g. does your program work correctly in all cases, is the time that your program needs to find the solution appropriate for the quality of the solution, and is your implementation well structured and is your code clear and easy to read).

If you implement two or more algorithms, you can submit all of them (and you will receive at least the marks that the best of your algorithms would receive by itself).

Your program should output the original permutation as well as the permutation obtained after each individual reversal step. (This means that if your algorithm uses k steps to sort the permutation, it will output k+1 permutations: the initial permutation, and a further permutation after each of the k steps.) A permutation should be output in a single line, with genes separated by spaces. At the end, the algorithm should output "Finished after x reversals.", where x is to be replaced by the number of reversals used.

Reference no: EM132475804

Questions Cloud

Prepare the journal entries required at july : Determine How would response change if Banff measured the debt using the fair value basis? Assume that the fair value on December 31, 2019/January 1, 2020
What are sexual values : What are sexual values and why are they important?
Medicalizing of cosmetic procedures for females : Are there advantages to medicalizing of Cosmetic Procedures for females? Are they're disadvantages?
Discussion of sex and gender : Has social media become the most power social agent for discussion of these issues? Relate feelings on the role of social media in these issues.
Implement an algorithm that computes an alignment : Implement an algorithm that computes an alignment of highest score among all alignments between X and any substring of Y, using the substitution
Promote certain ideas about group of people : Discuss how they were used to promote certain ideas about this group of people. Indicate also the realities of this group that the stereotypes
Compute the total overhead cost applied to job : Compute the predetermined overhead rates used in the Molding Department and the Painting Department. Compute the total overhead cost applied to Job 205.
What are some of the similarities across cultures : What are some of the similarities across cultures? What effect do technology have on creating similarities?
How is the global expansion of social media : How is the global expansion of social media likely to affect how people pursue social change?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd