Generating random DNA sequences with a specified frequency in C++

Chargaff rule states that "a double-stranded DNA molecule globally has percentage base pair equality: %A = %T and %G = %C."

However, %A and %G varies with organisms. For instance, humans have, approximately, 29% A and 21% C.

 

Write a C++ program that generates random genomic sequences with percentages of A, T, C, given above. The program takes the requested sequence length from the user, generates the random sequence, and display on the screen. The program should calculate the percentages of base pairs for randomly generated sequence and report to user.

 

Example:

1.Chicken

2.E.coli

..

10.Yeast

 

Please enter organism type: 4

Human is selected.

Please enter the sequence length: 200

Here is the output: ATACA...

 

Analysis result: 29% A, 30% T, 20% C, 21% G.

Need a custom answer at your budget?

This assignment has been answered 6 times in private sessions.

© 2024 Codify Tutor. All rights reserved