def parse_info_frags(info_frags):
    """Import an info_frags.txt file and return a dictionary where each key
    is a newly formed scaffold and each value is the list of bins and their
    origin on the initial scaffolding.
    """
    new_scaffolds = {}
    with open(info_frags, 'r') as info_frags_handle:
        current_new_contig = None
        for line in info_frags_handle:
            if line.startswith('>'):
                current_new_contig = str(line[1:-1])
                new_scaffolds[current_new_contig] = []
            elif line.startswith('init_contig'):
                pass
            else:
                init_contig, id_frag, orientation, pos_start, pos_end = str(
                    line[:-1]).split('\t')
                start = int(pos_start)
                end = int(pos_end)
                ori = int(orientation)
                fragid = int(id_frag)
                assert start < end
                assert ori in {-1, 1}
                new_scaffolds[current_new_contig].append([init_contig,
                    fragid, start, end, ori])
    return new_scaffolds
