@follows(buildGATWorkspace)
@merge( copyCapseqReplicatedBedFiles, "gat/genomic_features_gat.tsv" )
def runGenomicFeaturesGAT(infiles, outfile):
    to_cluster = True
    
    # Segment files
    segfiles = ""
    for x in infiles:
        track = P.snip(os.path.basename(x), ".replicated.bed")
        statement = """cat %(x)s | awk 'OFS="\\t" {print $1,$2,$3,"%(track)s"}' > gat/%(track)s.bed; """
        P.run()
        segfiles += " --segment-file=gat/%s.bed " % track
        
    # Annotation files
    annofiles = ""
    anno_list = P.asList(PARAMS["geneset_feature_list"])
    anno_dir = PARAMS["geneset_dir"]
    for y in anno_list:
        annotrack = P.snip(os.path.basename(y), ".gtf")
        statement = """cat %(anno_dir)s/%(y)s | python %(scriptsdir)s/gff2bed.py --name='feature' --is-gtf | sed s/exon/%(annotrack)s/g > gat/%(annotrack)s.bed; """
        P.run()
        annofiles += " --annotation-file=gat/%s.bed " % annotrack
    # Run GAT
    statement = """gatrun.py %(segfiles)s %(annofiles)s --workspace=gat/%(genome)s.bed.gz --num-samples=1000 --force --nbuckets=120000 > %(outfile)s"""
    P.run()

############################################################
Registers the listener for the GenericDialog.confirm_dialog event.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj007.py/runGenomicFeaturesGAT--crossover with--dataset/ETHPy150Open dddomodossola/remi/remi/gui.py/GenericDialog.set_on_confirm_dialog_listener