def readSampleTable(sampleTable):
    """
    Read a sample table into a dict (keys are barcodes).
    Return the resulting dict and the barcode length.
    """
    f = open(sampleTable)
    d = dict()
    bcLen = 0
    for line in f:
        _ = line.strip().split("\t")
        if _[0] not in d:
            d[_[0]] = dict()
        d[_[0]][_[1]] = _[2]
        if _[1] != 'default' and len(_[1]) > bcLen:
            bcLen = len(_[1])
    f.close()

    return (d, bcLen)