def load_mapping(path):
    """Load barcode-to-sample mapping

    Expects a tab-delimited file: the first column is the barcode sequence, the
    second column is the sample name.  No header line.
    """
    bc2sample = {}
    with open(path, "r") as ip:
        for line in ip:
            (bc, sample) = [field.strip() for field in line.split("\t")]
            bc2sample[bc] = sample
    return bc2sample