Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Dioxyribonucleic Acid ( DNA ) and Ribonucliec Acid are long molecules forming the genetics and is copked over the generations. One of the components of

Dioxyribonucleic Acid (DNA) and Ribonucliec Acid
are long molecules forming the genetics and is copked over the generations. One of the components of DNA/RNA is a nucleotide which has nucleobases:
1. Cytosine (C)
2. Guanine (G)
3. Adenine (A)
4. Thymine (T)[Occurs in DNA only instead of Uracil
(UI}
5. Uracil (U)(Occurs in RNA only instead of Thymine
Combination of these nucleobases form a DNA/RNA. Consider this table for solving the problem below: Nucleobase And binary value : C=001, G=010, A=011,T=101,U=110 Additionally, the sequence 000 is used to identify DNA and 111 identifies RNA.
Given a sequence of binary integers of 3-bits each, you are expected to decode it in the readable format and also correct any errors in the input sequence.
Consider an example of an input as: 000001001011101010010110011
Now, the first 3 bits of the input are 000 which depicts that the remaining set of binary digits should be interpreted as DNA sequence. Now, we group the remaining bits into a set of 3-bits which can be represented as 001001011101010
010110011. Upon decoding this, we get the sequence as CCATGGUA. Now, since the letter U is an invalid nucleobase in a DNA, it should be replaced with T. Therefore, after correcting the output, the final output should be:
CCATGGTA
Function Description
Complete the function decodeSequence in the editor below. The function must print the decoded sequence of the DNA/RNA. decodeSequence has the following parameter(s): binarySequence: a string of binary numbers representing the DNA sequence; to be decoded.
Constraints
Only binary digits should be present in the input.
The length of the input string should be a multiple of 3.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions