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

  Implement your client-server system

A detailed discussion of the methodology you used to implement your client-server system and a concise and detailed design for the client-server system

  Returns the object with the largest measure

public static Measurable maximum(Measurable[] objects)that returns the object with the largest measure. Use that method to determine the country with the largest area from an array of

  World data query system - determine users desired continent

CS1110 World Data Query System - alls getContinent to determine user's desired continent. Searches data to find ALL matching countries in that target continent

  Small computer system interface-standard computer disk

How many primary drive partitions are supported on computers that still conform to the standard established by MS-DOS? How many total partitions can a standard computer disk [Intergrated Drive Electronics (IDE)/Serial Advanced Technology Attachment (..

  Create a recursive factorial program

Assignment 1: 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 !. For example, if the input is 4, the output could be:

  Write a short, structured design that accomplishes this task

Identify how you can encapsulate the data and processes you identified into an object oriented design.

  Program-measure running time of different sorting algorithms

Write a JAVA program that measures the running time of different sorting algorithms such as heap sort, in-place quick sort and merge sort for 10,000 randomly generated integer numbers.

  Design the logic and write the rest of the program

Design the logic and write the rest of the program using a nested statement.  They are using JOptionPane.showInputDialog.

  Multiple inheritance and thunks

Then, pa and pc will contain the same value, but pb will contain a different value; it will contain the address of the B part of the C object. The fact that pb and pc do not contain the same value means that in C++, a cast sometimes has a run-time..

  Implement a superclass vehicle and subclass car

Implement a superclass Vehicle and subclass Car and Truck. A vehicle has a position on thescreen. Write a method draw that draw cars and trucks

  What is the range of all primitive data types

What is the range of all primitive data types. Default value (for fields/instance variable ) for any Object type is null. What is the Java API(Application Programming interface)?

  Technical developments at gumby polymer rubber

Missy Knowles is in charge of all technical developments at Gumby Polymer Rubber. She makes all the choices concerning product innovations in the company. She finds that she is overworked and that several of her research chemists seem to be spendi..

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