Question: Write a bash script named codoncount that expects a file name on the command line. The file is a DNA file, that only contains DNA

Write a bash script named codoncount that expects a file name on the command line. The file is a DNA file, that only contains DNA string with no newline characters or white space characters. The DNA is a sequences of a, c, g and t of length 3n for some n. The bash script must count the number of occurrences of every codon in file, first codon starts at position 1^2, and it must output the number of times each codon appears, sorted in order of decreasing frequency (if there is a tie in frequency it should be broken by sorting in alphabetical order). If it cannot read the file, it must exit with a message "cannot open file".

Ex: DNA string in file DNAfile: aacgtttgtaaccagaactgt, then command

./codoncount DNAfile

Produces this output

3 aac

2 tgt

1 cag

1 gtt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!