@follows( normaliseBAMs )
@files( [( [ "bam/%s.norm.bam" % y for y in EXPERIMENTS[x]], 
           "merged_bams/%s.shift.merge.bw" % str(x).replace("-agg","")) for x in EXPERIMENTS ] )
def getMergedBigWigPeakShift( infiles, outfile ):
    expt = P.snip( os.path.basename( outfile ), ".merge.bw").replace("-agg","")
    in_list = " --bamfile=".join(infiles)
    
    offsets = []
    for t in infiles:
        track = P.snip(os.path.basename(t), ".norm.bam")
        fn = "macs/with_input/%s.macs" % track
        if os.path.exists( fn ):
            offsets.append( str(PIntervals.getPeakShiftFromMacs( fn )) )

    shifts = " --shift=".join(offsets)
    statement = '''python %(scriptsdir)s/bam2wiggle.py 
                      --output-format=bigwig
                      %(in_list)s
                      %(shifts)s > %(outfile)s'''
    P.run()

############################################################
Gets the container id of the scalyr-agent container
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj012_chipseq.py/getMergedBigWigPeakShift--crossover with--dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/builtin_monitors/docker_monitor.py/DockerMonitor.__get_scalyr_container_id