@transform( buildBAM, suffix(".bam"), ".readstats" )
def buildBAMStats( infile, outfile ):
    to_cluster = USECLUSTER
    scriptsdir = PARAMS["general_scriptsdir"]
    statement = '''python %(scriptsdir)s/bam2stats.py --force 
                   --output-filename-pattern=%(outfile)s.%%s < %(infile)s > %(outfile)s'''
    P.run()

#########################################################################
Count number of reads mapped, duplicates, etc. using bam2stats.py
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_proj012_chipseq.py/buildBAMStats