%# document for DNase QC report
%# Qin Qian
%# Time-stamp: < modified by qinqianhappy :2013-08-01 21:32:22 >

%- if section_name == "begin"
\documentclass[12pt,a4paper]{article}
\usepackage{tabularx}
\usepackage[english]{babel}
\usepackage{array}
\usepackage{graphicx}
\usepackage{color}
\usepackage[usenames,dvipsnames]{xcolor}
\DeclareGraphicsExtensions{.eps,.png,.pdf,.ps}

%# font
%# \renewcommand{\familydefault}{\sfdefault}
\fontencoding{T1}
\fontfamily{garamond}
\fontseries{m}
\fontshape{it}

\usepackage{multirow}
\setlength{\columnseprule}{0pt}

\usepackage{booktabs}
\newlength{\verticalcompensationlength}
\setlength{\verticalcompensationlength}{\aboverulesep}
\addtolength{\verticalcompensationlength}{\belowrulesep}
\newcounter{verticalcompensationrows}
\newcommand{\verticalcompensation}[1]{%
\setcounter{verticalcompensationrows}{#1}%
\addtocounter{verticalcompensationrows}{-1}%
\vspace*{-\value{verticalcompensationrows}\verticalcompensationlength}%
}
\newcommand{\multirowbt}[3]{%
\multirow{#1}{#2}{\verticalcompensation{#1}#3}%
}

\usepackage[paperwidth=13in, paperheight=15in]{geometry}

\begin{document}
\title{DNase-Seq Quality Control Summary for Dataset  \color{ProcessBlue} \VAR{dataset_id} }
\author{ENCODE DNase Working Group}

\date{\small\today}
\vspace{-5cm}
\maketitle

%- endif

%- if section_name == "header"

\begin{table}[hbtp]\centering
  \caption{Summary Table}
  \begin{tabular}{llccc}
    \toprule

%- if reps >= 2
    \textbf{QC Function} & \textbf{Cutoff} & \BLOCK{for i in range(1,
      reps+1) } \textbf{rep\VAR{i}} & \BLOCK{endfor} \textbf{Combo}\\
%- else
  \textbf{QC Function} & \textbf{Cutoff} & \textbf{Rep1}  \\
%- endif
%- endif

%- if section_name == "raw_reads"
  \midrule
%- if reps >= 2
  Raw Reads(All) & Reads number & \VAR{reads | join(' & ')} & \VAR{combo} \\
%- else
  Raw Reads(All) & Reads number & \VAR{reads | join(' & ')} \\
%- endif
%- endif

%- if section_name == "reads_length"
  \midrule
%- if reps >= 2
  Seq Length(All) & & \VAR{reads_len | join(' & ')} & \VAR{combo} \\
%- else
  Seq Length(All) & & \VAR{reads_len | join(' & ')} \\
%- endif
%- endif

%- if section_name == "sequence_quality"  
  \midrule
%- if reps >= 2
  Seq Quality(100K) & fastqStatsAndSubsample$>25$ & \VAR{seq_quality | join(' & ')} & \\
%- else
  Seq Quality(100K) & fastqStatsAndSubsample$>25$ & \VAR{seq_quality | join(' & ')} \\
%- endif
%- endif

%- if section_name == "mapping"
  \midrule
%- if reps >= 2
  Autosome Uniquely Mapped (All) & \VAR{tool}$>$50\%  & \VAR{map | join(' & ')} & \VAR{combo} \\
%- else
  Autosome Uniquely Mapped (All) & \VAR{tool}$>$50\%  & \VAR{map | join(' & ')} , \VAR{combo}  \\
%- endif
%- endif

%- if section_name == "redundancy"
  \midrule
%- if reps >= 2
  Redundancy(5M) & $<$30\% & \VAR{redun | join(' & ')} & \\
%- else
  Redundancy(5M) & $<$30\% & \VAR{redun | join(' & ')} \\
%- endif
%- endif

%- if section_name == "RSC"
  \midrule
%- if reps >= 2
  RSC(5M) & $>1$ & \VAR{RSC | join(' & ')} & \\
%- else
  RSC (5M) & $>1$ & \VAR{RSC | join(' & ')} \\
%- endif
%- endif

%- if section_name == "NSC"
  \midrule
%- if reps >= 2
  NSC(5M) & $>1$ & \VAR{NSC | join(' & ')} & \\
%- else
  NSC (5M) & $>1$ & \VAR{NSC | join(' & ')} \\
%- endif
%- endif

%- if section_name == "fragment"
  \midrule
%- if reps >= 2
  Fragment size & 50-300bp  & \VAR{frag | join(' & ')} & \\
%- else
  Fragment size & 50-300bp  & \VAR{frag | join(' & ')}  \\
%- endif
%- endif

%- if section_name == "peaks_calling"
  \midrule
%- if reps >= 2
  Peak Calls Sample(5M) & \VAR{tool} & \VAR{spot_5M | join(' & ')} & \\
%- else
  Peak Calls Sample(5M) & \VAR{tool} & \VAR{spot_5M | join(' & ')}  \\
%- endif

 \midrule
%- if reps >= 2
 Peak Calls Combo(All) & \VAR{tool} Peaks FDR 1\% & \VAR{peaks_all | join(' & ')} & \VAR{combo}\\
%- else
 Peak Calls Combo(All) & \VAR{tool} Peaks FDR 1\% & \VAR{peaks_all | join(' & ')}  \\
%- endif
%- endif

%- if section_name == "spot"
  \midrule
%- if reps >= 2
  Signal / Noise (5M) & SPOT$>$40\% & \VAR{spot | join(' & ')} & \\
%- else
  Signal / Noise (5M) & SPOT$>$40\% & \VAR{spot | join(' & ')} \\
%- endif
%- endif

%- if section_name == "replicates"
%#  \midrule
%#   Replicates Overlap (5M) & I/U $>$ 50\% & \multicolumn{3}{c}{\VAR{overlap | join(' ; ')}} \\
% # 
   \midrule
   Rep Wig Corr in Union Peaks (5M) & $>$0.75 & \multicolumn{3}{c}{\VAR{cor | join(' ; ')}} \\
%- endif

%# no promotor evaluation in ENCODE 3 DNase QC, to uncomment if needed
%# %- if section_name == "promotor"
%#  \midrule
%# %- if reps >= 2
%#  Promotor \%(5M)  & $<$20\% (genome: \VAR{genome}) & \VAR{promotor | join(' & ')} & \\
%# %- else
%#  Promotor \%(5M)  & $<$20\% (genome: \VAR{genome}) & \VAR{promotor | join(' & ')} \\
%# %- endif
%# %- endif

%# no conservation evaluation in ENCODE 3 DNase QC, to uncomment if needed
%# %- if section_name == "conservation"
%#  \midrule
%# %- if reps >= 2
%#  Evolutionary Conservation (5M) & $>$0.2 &  \VAR{conservation | join(' & ')} & \\
%# %- else
%#  Evolutionary Conservation (5M) & $>$0.2 &  \VAR{conservation | join(' & ')} \\
%# %- endif
%# %- endif

%- if section_name == "DHS"
  \midrule
%- if reps >= 2
  Union DHS Overlap (5M) & $>$0.7 & \VAR{DHS | join(' & ')} & \\
%- else
  Union DHS Overlap (5M) & $>$0.7 & \VAR{DHS | join(' & ')}  \\
%- endif
%- endif

%- if section_name == "table_end"
  \bottomrule
\end{tabular}
\end{table}
%- endif

%- if section_name == "end"
\end{document}
%- endif
