#NEWLINE# def _mk_cache_fn( vcf_fn , array_type , region = None , cachedir = None ) : #NEWLINE# #INDENT# 'Utility function to construct a filename for a cache file, given a VCF\n    file name (where the original data came from) and other parameters.' #NEWLINE# if ( cachedir is None ) : #NEWLINE# #INDENT# cachedir = ( vcf_fn + config . CACHEDIR_SUFFIX ) #NEWLINE# #UNINDENT# if ( not os . path . exists ( cachedir ) ) : #NEWLINE# #INDENT# os . makedirs ( cachedir ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert os . path . isdir ( cachedir ) , ( 'unexpected error, cache directory is not a directory: %r' % cachedir ) #NEWLINE# #UNINDENT# if ( region is None ) : #NEWLINE# #INDENT# cache_fn = os . path . join ( cachedir , ( '%s.npy' % array_type ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# region = region . replace ( ':' , '_' ) . replace ( '-' , '_' ) #NEWLINE# cache_fn = os . path . join ( cachedir , ( '%s.%s.npy' % ( array_type , region ) ) ) #NEWLINE# #UNINDENT# return cachedir