Question
Using c++ create an analysis program for a text file of DNA strings. The program will accept a text file as a command line argument
Using c++ create an analysis program for a text file of DNA strings.
The program will accept a text file as a command line argument ( int main(argc, char* argv)) of DNA strings. There will be one string per line of the file with varying capitalization of characters and lengths of the strings.
Compute the sum, mean, variance, and standard deviation of the lengths of the strings. Compute the frequency of each nucleotide (A,C,T,G) and the frequency of each pair(AA,AC,AT,AG,CA, etc.)
Output the labeled results to a text file.
After outputting the results generate 1000 DNA strings with lengths following a Gaussian distribution with the same mean and variance previously calculated. The frequency of the nucleotides will follow the statistics calculated as well.
Append the strings to the same outputted text file.
Ask the user if they want to process another file, if yes ask for the name of the next file, process it, and output the results and more generated strings to the output file. If not end the program. NO DATA STRUCTURES MAY BE USED, only primitive data types and std strings. No arrays, lists, vectors etc.
For the length from a Gaussian distribution with mean x and variance y^2 the rand function can be uses to generate numbers a and b [0,1). Then compute C s.t. C = sqrt(-2ln(a)) * cos(2pib). C is the standard gaussian with mean 0 and variance 1. You can convert it to a random variable D with mean x and variance y^2 with D = yC + x.
Sorry for the lengthy assignment but I submitted what i had using data structures as i could not figure out how to do so without them. I assume you would have count vars for all nucleotides and their bigrams (a lot of variables lol but i guess thats the point) then while looping count each nucleotide and its bigram for the stats. And as for the user input if another file is requested a bool var that would be true if the user entered yes to loop the while again through their inputted file? Thanks.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started