anchor.diff:    bedgraph = bamcoverage( bam: dedup_sorted_bam, bai: dedup_sorted_bai );
   }
   
  -deftask bedtools-getfasta( bed_fa( File ) : fa( File ) bed( File ) )in bash *{
  +deftask bedtools-getfasta( bed_fa( File ) : fa( File ) fai( File ) bed( File ) )in bash *{
     bed_fa=$bed.fa
  +  ln -sf $fai $fa.fai
     bedtools getfasta -fi $fa -bed $bed -fo $bed_fa
   }*
   
  -deftask restrict-peaks( restricted_bed( File ) : bed( File ) )in bash *{
  +deftask extend-peaks( restricted_bed( File ) : bed( File ) )in bash *{
     restricted_bed=$bed.100.bed
  -  perl -lane '$start=$F[1]-100 ; $end = $F[2]+100 ; print "$F[0]\t$start\t$end"' \
  +  perl -lane '$start=$F[1] > 100 ? $F[1]-100 : 0; $end = $F[2]+100 ; print "$F[0]\t$start\t$end"' \
       $bed > $restricted_bed
   }*
  +
   
   %% =========================================================
   %% INPUT DATA
  
positive.code:   samtools index $bam $bai
  }*
  
  deftask bamcoverage( bedgraph( File ) : bam( File ) bai( File ) )in bash *{
    bedgraph=$bam.bedgraph
    ln -sf $bai $bam.bai
  
negative.code: % quality control
  qc = fastqc( fq: tag_fq ctl_fq );
  
  fai = samtools-faidx( fa: fa );
  
  % read mapping
  idx     = bowtie-build( fa: fa );
  tag_sam = bowtie-align( idx: idx, fq: tag_fq );
  