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