Lab 11: Recursion
Lab 12: Bioinformatics
DNA (deoxyribonucleic acid) is the basis of life. It consists of 4 characters: A, C, T, G (which each stand for different nucleotides).
In this lab, you will determine the relative percentages of each nucleotide given a string of DNA.
The DNA string is given below:
AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGCAGGGCCCTTATCGATTTACGA
Copy this string into a file - name it DNA.txt. In your lab11.py file, read in the contents of DNA.txt and determine the percentage of A's, C's, T's, and G's.
For example, given the string "AAAATCCCGG", the percentage of A's = 0.4, C's = 0.3, G's = 0.2, and T's = 0.1.
Write the percentages (with descriptive labels) to another file, named "results.txt".
The contents of this file, using the long DNA string given above, should look as follows:
% of A's: 0.2717391304347826
% of C's: 0.18478260869565216
% of G's: 0.2391304347826087
% of T's: 0.29347826086956524
If you would like more practice with File I/O or with Bioinformatics coding, go to rosalind.info.
|