import collections


def _create_info_string(cnv_row):
    """
        Creates VCF info string from information saved in CNV row files.
    """
    info_dict = collections.OrderedDict() 
    info_dict["SVTYPE"] = cnv_row.variant_type
    info_dict["SVLEN"] = cnv_row.svlen
    info_dict["UNACCOUTED_SEQUENCE"] = cnv_row.unaccounted_for_sequence
    info_dict["BREAKSTART1"] = cnv_row.breakstart1
    info_dict["BREAKSTART2"] = cnv_row.breakstart2
    info_dict["BREAKEND1"] = cnv_row.breakend1
    info_dict["BREAKEND2"] = cnv_row.breakend2
    info_dict["STRANDS"] = cnv_row.strand1 + cnv_row.strand2
    out_string = "" 
    length_of_info = len(info_dict.values())
    for i, item in enumerate(info_dict.items()):
        key = item[0]
        value = str(item[1])
        if (i + 1) != length_of_info:
            out_string += key + "=" + value +";"
        else:
            out_string += key + "=" + value 
    return(out_string)