@merge( (exportUCSCEncodeTracks, 
         exportReferenceAsBed, 
         ["%s.bed" % x for x in TRACKS_REFERENCE ],
         combineConditions,
         combineUnstim,
         combineReplicates ),
        "ucsc.overlap" )
def buildUCSCOverlap( infiles, outfile ):
    '''compute overlap between intervals and the ucsc tracks.
    '''

    if os.path.exists(outfile): 
        os.rename( outfile, outfile + ".orig" )
        options = "--update=%s.orig" % outfile
    else:
        options = ""

    to_cluster = True

    infiles = " ".join(IOTools.flatten(infiles))
    statement = '''
        python %(scriptsdir)s/diff_bed.py 
               --tracks 
               --log=%(outfile)s.log
               %(options)s 
               %(infiles)s 
        > %(outfile)s
        '''

    P.run()

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