Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You just got a position as a research assistant in Professor Threon's lab. Your first task is to write a program that finds locations of

You just got a position as a research assistant in Professor Threon's lab. Your first task is to write a program that finds locations of all the genes encoding Threonine.

To complete this task, you will need a DNA codon table. Your program needs to analyze the DNA strand and determine the locations of the triples that encode Threonine. Those triples are ACT, ACC, ACA, ACG.

Example:

Input DNA sequence: ATGACACGGAGTACGTAA

The locations of the triples encoding Threonine are: 3 (ACA) and 12 (ACG). Notice that the location 5 is not an answer, since every triple has to start on a multiple of three index (otherwise triples would overlap).

Error handling and output:

If the program is given an invalid strand (i.e., one that contains characters other that A, T, C, and G), it should print -1 and terminate.

If the program is given a valid strand that does not contain even one triple, the program should print -2 and terminate.

If the program is given a valid strand that contains one or more triples, it should print the indexes of the first character of the triple, one per line. In the above example, the output should be: 3 12

Note: You should assume that the input sequence is all in uppercase. You can treat any lowercase letters as invalid characters. The maximum length of the sequence that your program needs to handle is 9,999.

HINT: You might find the functions provided by the string library useful for solving this problem. You can learn more about them by reading the man page for string.h header file:

man string.h

Please use C to solve this

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

Step: 3

blur-text-image

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

what is a peer Group? Importance?

Answered: 1 week ago