def calc_gc(sequence):
    """
    Calculates GC percentage from DNA sequence
    Does not consider IUPAC ambiguity codes
    :param sequence:
    :return: float
    """
    if len(sequence) == 0:
        raise ValueError("Sequence must have minimum length 1")
    gc = 0
    for char in sequence:
        if char.upper() == 'G' or char == 'C':
            gc += 1
    return float(gc)/len(sequence) * 100.0