@transform( sortByPosition,
            regex( r"(\S+).nh.srt.bam"),
            r"\1.dedup.bam")
def dedup(infiles, outfile):
        to_cluster = USECLUSTER
        track = P.snip( outfile, ".bam" )
        statement = '''MarkDuplicates INPUT=%(infiles)s  ASSUME_SORTED=true OUTPUT=%(outfile)s METRICS_FILE=%(track)s.dupstats VALIDATION_STRINGENCY=SILENT; ''' % locals()
        statement += '''samtools index %(outfile)s; ''' % locals()
        #print statement
        P.run()

#########################################################################
Called when a connection has been established.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/mapping_titration.py/dedup--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/masterd/instance.py/_TransferInstSourceCb.ReportConnected