def prod_gc_skew(genes_dictionary, positions, window_size, sequence_length,
    sequence):
    """
    Produces a list of gc-skew and ta-skew values.

    :param genes_dictionary:    Dictionary with all genes from Prodigal
    :param positions:           Dictionary for positions in whole genome, in all_genes and in third_pos
    :param window_size:         Size of window for calculation
    :param sequence_length:     Length of chromosome
    :param sequence:            FASTA sequence of chromosome
    :return:                    Lists with gc- and ta-skews
    """
    ev_third = ['u'] * sequence_length
    rev = list(sequence.seq)
    gc_skew_list = [0.0] * sequence_length
    ta_skew_list = [0.0] * sequence_length
    for key in genes_dictionary:
        """If plus strand gene -- save every third nt to list"""
        if positions[key][3] == 1:
            for i in range(positions[key][0] + 2, positions[key][1], 3):
                ev_third[i] = sequence.seq[i - 1]
        """If minus strand gene -- reverse list and save every third nt"""
        if positions[key][3] == -1:
            rev[positions[key][0]:positions[key][1] + 1] = list(
                genes_dictionary[key].seq)
            for i in range(positions[key][0] + 2, positions[key][1], 3):
                ev_third[i] = rev[i]
        """Calculate the number of each nt per window for every 10th nt in the list"""
        for i in range(positions[key][0], positions[key][1] + 1, 10):
            if i - window_size // 2 < 0:
                rest = abs(i - window_size // 2)
                a = ev_third[sequence_length - 1 - rest:i + window_size // 2
                    ].count('A') + ev_third[sequence_length - 1 - rest:i + 
                    window_size // 2].count('a') + ev_third[0:i + 
                    window_size // 2].count('A') + ev_third[0:i + 
                    window_size // 2].count('a')
                c = ev_third[sequence_length - 1 - rest:i + window_size // 2
                    ].count('C') + ev_third[sequence_length - 1 - rest:i + 
                    window_size // 2].count('c') + ev_third[0:i + 
                    window_size // 2].count('C') + ev_third[0:i + 
                    window_size // 2].count('c')
                g = ev_third[sequence_length - 1 - rest:i + window_size // 2
                    ].count('G') + ev_third[sequence_length - 1 - rest:i + 
                    window_size // 2].count('g') + ev_third[0:i + 
                    window_size // 2].count('G') + ev_third[0:i + 
                    window_size // 2].count('g')
                t = ev_third[sequence_length - 1 - rest:i + window_size // 2
                    ].count('T') + ev_third[sequence_length - 1 - rest:i + 
                    window_size // 2].count('t') + ev_third[0:i + 
                    window_size // 2].count('T') + ev_third[0:i + 
                    window_size // 2].count('t')
            elif i + window_size // 2 > sequence_length - 1:
                rest = abs(sequence_length - window_size // 2)
                a = ev_third[i - window_size // 2:sequence_length - 1].count(
                    'A') + ev_third[i - window_size // 2:sequence_length - 1
                    ].count('a') + ev_third[0:rest].count('A') + ev_third[0
                    :rest].count('a')
                c = ev_third[i - window_size // 2:sequence_length - 1].count(
                    'C') + ev_third[i - window_size // 2:sequence_length - 1
                    ].count('c') + ev_third[0:rest].count('C') + ev_third[0
                    :rest].count('c')
                g = ev_third[i - window_size // 2:sequence_length - 1].count(
                    'G') + ev_third[i - window_size // 2:sequence_length - 1
                    ].count('g') + ev_third[0:rest].count('G') + ev_third[0
                    :rest].count('g')
                t = ev_third[i - window_size // 2:sequence_length - 1].count(
                    'T') + ev_third[i - window_size // 2:sequence_length - 1
                    ].count('t') + ev_third[0:rest].count('T') + ev_third[0
                    :rest].count('t')
            else:
                a = ev_third[i - window_size // 2:i + window_size // 2].count(
                    'A') + ev_third[i - window_size // 2:i + window_size // 2
                    ].count('a')
                c = ev_third[i - window_size // 2:i + window_size // 2].count(
                    'C') + ev_third[i - window_size // 2:i + window_size // 2
                    ].count('c')
                g = ev_third[i - window_size // 2:i + window_size // 2].count(
                    'G') + ev_third[i - window_size // 2:i + window_size // 2
                    ].count('g')
                t = ev_third[i - window_size // 2:i + window_size // 2].count(
                    'T') + ev_third[i - window_size // 2:i + window_size // 2
                    ].count('t')
            """If not division with zero -- calculate gc- and ta-skew and save to lists"""
            if g + c != 0.0:
                gc_skew_list[i] = positions[key][3] * ((g - c) / (g + c))
            if t + a != 0.0:
                ta_skew_list[i] = positions[key][3] * ((t - a) / (t + a))
    return gc_skew_list, ta_skew_list
