Counting genetic mutations in dictionary using python
问题 I have data in this format: >abc12 ATCGACAG >def34 ACCGACG etc. I have stored each gene into a dictionary with the lines beginning with > as values. So the dictionary is something like {'abc12':'ATCGACAG', etc.} Now I want to be able to compare each gene, so that it counts the number of A's, T's, C's, or G's at each site. The only thing I can come up with is to break the dictionary into lists for each nucleotide site and using zip() with a counter. Is this the best way, and if so, how do I