@merge( "external_bed/*.bed", "external_interval_sets.stats" )
def getExternalBedStats(infiles, outfile):
    chromatin = P.asList(PARAMS["bed_chromatin"])
    capseq = P.asList(PARAMS["bed_capseq"])
    chipseq = P.asList(PARAMS["bed_chipseq"])
    CGI = P.asList(PARAMS["bed_cgi"])
    extBed = chromatin + capseq + chipseq + CGI

    if os.path.exists(outfile):
        statement = '''rm %(outfile)s'''
        P.run()

    for f in extBed:
        if len(f) > 0:
            track = P.snip( os.path.basename(f),".bed" )
            statement = """echo '%(track)s' >> %(outfile)s; cat %(f)s | wc -l >> %(outfile)s; """
            P.run()
    statement = '''sed -i '{N;s/\\n/\\t/}' %(outfile)s; '''
    P.run()

############################################################
Generate an ACL.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj007.py/getExternalBedStats--crossover with--dataset/ETHPy150Open ramses-tech/ramses/ramses/acl.py/generate_acl