#NEWLINE# @ transform ( mergeIntervals , regex ( '(\\S+)/intervals/(\\S+).merged.bed' ) , '\\1/intervals/\\2.macs.zinba.bed' ) #NEWLINE# def getZinbaOverlap( infile , outfile ) : #NEWLINE# #INDENT# 'identify intervals overlapping ZINBA intervals for each datasets' #NEWLINE# track = P . snip ( os . path . basename ( infile ) , '.merged.bed' ) #NEWLINE# macsdir = os . path . dirname ( zinbadir ) #NEWLINE# zinba = ( track + '.zinba.bed' ) #NEWLINE# zinbadir = macsdir . replace ( 'macs' , 'zinba' ) #NEWLINE# statement = 'intersectBed -a %(infile)s -b %(zinbadir)s/%(zinba)s -u > %(outfile)s; ' #NEWLINE# P . run ( )