def vcfFile2chromPosNameIndex(vcfFile):
    """Produces a dictionary linking (chrom, pos, name) tuples to'
    vcffile lines."""

    chromPosName2vcfLine = {}
    for line in vcfFile.readlines():
        if len(line.strip()) > 0 and line[0] != "#":
            elems = line.strip().split()
            chromPosName2vcfLine[(elems[0], int(elems[1]), elems[2])] = " ".join(elems[:5])

    return chromPosName2vcfLine