def metafetcher(bamfile, metacontig2contig, metatag):
    """ return reads in order of metacontigs"""
    for metacontig in metacontig2contig:
        for contig in metacontig2contig[metacontig]:
            for read in bamfile.fetch(contig):
                read.set_tag(metatag, metacontig)
                yield read
