Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / C++ object oriented programming the sequence that maximizes the sum of distances to all other sequences

C++ object oriented programming the sequence that maximizes the sum of distances to all other sequences

Computer Science

C++ object oriented programming

the sequence that maximizes the sum of distances to all other sequences. Once you identified the sequence of interest, output its header over the cout stream. In case there are multiple sequences with the same sum of distances, output only the header that appears first in the file.

Sample command:

./task3 sample_input.txt sample_output.txt 5 man Sample input:

> minimal_effort

A

> no_effort

AAAAA

> no_effort 2

AAAAAAG

Sample output (shortened to the first 4 numbers):

>minimal_effort 0 0 0 0 ....

>no_effort 1 0 0 0 ....

>no_effort2 2 0 1 0 ....

Terminal:

> no_effort 2

Task 4 (17 (8+9) P.): (

+

)

 

Write a program that takes one RNA sequence as argument and outputs the score of the best secondary structure it could form (i.e. the maximum number of base pairs for this sequence). Secondary structures should be output in dot-bracket notation. To obtain all the points, output after the best score all best secondary structures. If there are multiple best secondary structures report them all, in any order, and separate them by an empty line (trailing empty lines are allowed). Use the Nussinov algorithm to solve the folding problem. Information on the algorithm can be found here and appropriate examples of the dynamic programming matrix, traceback and output can be found on the web or in the computer science literature.

Use the following recursion formula for a sequence S, dynamic programming matrix D and positions i and j:

?

?D(i,j −1)           if Sj is unpaired

D(i,jk) = max

?maxik<(jl) D(i,k −1)+ D(k +1,j −1)+1 if Sk,Sj are compl.

The minimal loop length l ensured by your algorithm should be 2 and base pairings between A - U, C - G and G - U should be allowed.

3

Sample program argument:

GUCCACU

Sample output:

2

((..).) ((..)).

Task 5 (25 P.): 

Implement a class Dataframe that can manage a dynamic number of columns ( of identical length), where each column has its own value type. Internally, the data should be stored in a std::list<vector<ColType>>, named data. Make sure that ColType is capable of encapsulating any valid C++ type, as dataframes are typically used to represent tables of heterogeneous data types. For example, if the first column is of type int, only integers can be stored in that column, while a second column of type std::string can only store strings along the rows. In addition, a dataframe can identify rows and columns not only by their position (aka index) but also through an optional set of names for both rows and cols (duplicates are not allowed). To add value beyond the simple storage of heterogeneous data, your Dataframe class must implement the following member-functions and operations:

  1. Dataframe(), default initialized.
  2. Copy constructor and copy assignment operator (generation by the compiler is allowed).
  3. Move constructor and move assignment operator (generation by the compiler is allowed).
  4. Member functions nrows and ncols providing the number of rows and columns.
  5. Member function get<T>(i,j) to access and/or modify the element of type T stored at row i and column j. The data access is 0-indexed. This should return a reference to the original element (ensure const-correctness!).
  6. Member function get<T>(r,c) to access and/or modify the element stored at row named r and column named c. This should return a reference to the original element (ensure const-correctness!).
  7. Member functions set_colnames and set_rownames to set the column names and row names.
  8. Member functions clear_colnames and clear_rownames to remove column and row names.

4

Option 1

Low Cost Option
Download this past answer in few clicks

70 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE