def getSeqLens(fastaf):
    """Return a table with length in kilobases for each seq in fastaf."""
    lenout = {}
    curRec, curLen = None, 0
    with open(fastaf) as ff:
        for line in ff:
            line = line.strip()
            if len(line) == 0:
                continue
            if line[0] == '>':
                if curRec is not None:
                    lenout[curRec] = curLen / 1000
                curRec = line.split()[0][1:]
                curLen = 0
            else:
                curLen += len(line)
    lenout[curRec] = curLen / 1000
    return lenout