def _mk_cache_fn(vcf_fn, array_type, region=None, cachedir=None):
    if cachedir is None:
        # use the VCF file name as the base for a directory name
        cachedir = vcf_fn + config.CACHEDIR_SUFFIX
    if not os.path.exists(cachedir):
        # ensure cache dir exists
        os.makedirs(cachedir)
    else:
        assert os.path.isdir(cachedir), \
            'unexpected error, cache directory is not a directory: %r' \
            % cachedir
    if region is None:
        # loading the whole genome (i.e., all variants)
        cache_fn = os.path.join(cachedir, '%s.npy' % array_type)
    else:
        # loading a specific region
        region = region.replace(':', '_').replace('-', '_')
        cache_fn = os.path.join(cachedir, '%s.%s.npy' % (array_type, region))
    return cache_fn
Utility function to construct a filename for a cache file, given a VCF
dataset/ETHPy150Open alimanfoo/vcfnp/vcfnp/array.py/_mk_cache_fn