@follows( buildGeneRegions )
@files( [ ( ( x % "%s.bed", TARGET_TRANSCRIPTS_TSS), "%s.distance" % x ) for x in TRACKS_ANNOTATE ] )
def annotateTSSIntervalDistance( infiles, outfile ):
    '''annotate the associations between a tss and of a transcript.
    Only the closest distance is recorded in either direction.'''

    infile_bed, infile_tss = infiles

    to_cluster = True

    statement = """
	python %(scriptsdir)s/gtf2table.py \
		--counter=distance \
		--log=%(outfile)s.log \
                --reporter=transcripts \
		--filename-gff=<( python %(scriptsdir)s/bed2gff.py --as-gtf < %(infile_bed)s) \
                --filename-format=gtf \
		--genome-file=%(genome)s \
	< %(infile_tss)s > %(outfile)s"""

    P.run( **dict( locals().items() + PARAMS.items() ) )

############################################################
############################################################
############################################################
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_vitaminD.py/annotateTSSIntervalDistance/swapped operands of `%`