@follows( buildGeneRegions )
@files( [ ( ( "%s.bed" % x, TARGET_TRANSCRIPTS_TSS), "%s.assoc" % x ) for x in TRACKS_ANNOTATE ] )
def annotateTSSIntervalAssociations( infiles, outfile ):
    '''annotate the associations between tss and of a transcript.
    All distances within *proximal_distance* are recorded.'''

    infile_bed, infile_tss = infiles

    to_cluster = True

    statement = """
	python %(scriptsdir)s/gtf2table.py \
		--counter=neighbours \
		--log=%(outfile)s.log \
                --reporter=transcripts \
                --proximal-distance=%(proximal_distance)i \
		--filename-gff=<( python %(scriptsdir)s/bed2gff.py --as-gtf < %(infile_bed)s) \
		--genome-file=%(genome)s \
	< %(infile_tss)s |\
        python %(toolsdir)s/table2graph.py \
                --headers=transcript_id,id \
    > %(outfile)s"""

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

############################################################
############################################################
############################################################
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_vitaminD.py/annotateTSSIntervalAssociations/original