def countNucFreq(dna_seq):
    """
    Counts the frequency of each nucleotide in the sequence.
    """
    tmpseq = dna_seq.upper();
    freq = {'A':0, 'C':0, 'G':0, 'T':0}
    for nucleotide in tmpseq:
        freq[nucleotide] += 1
    return freq