\documentclass[aspectratio=169]{beamer} \usepackage{fancyvrb} \usepackage{tgcursor} \usepackage{microtype} \usepackage{tikz} \usetikzlibrary{fit} \usepackage[style=verbose-ibid,url=false,natbib=true]{biblatex} \addbibresource{references.bib} \renewcommand*{\footnotesize}{\Tiny} \setlength{\footnotesep}{3pt} \definecolor{bngreen}{HTML}{3c8e64} \definecolor{bnorange}{HTML}{e08919} %\setbeamercolor*{structure}{bg=white,fg=bngreen} \usecolortheme[named=bngreen]{structure} \setbeamertemplate{navigation symbols}{} \setbeamertemplate{headline}{\hfill\includegraphics[width=.7cm]{logo-running}\hspace{0.1cm}\vspace{-.7cm}} \author{Justin Bed\H{o}\\WEHI} \title{\includegraphics[width=.7\linewidth]{logo}\\functional, reproducible bioinformatics workflows} \date{December 8th, 2020} \begin{document} { \setbeamertemplate{headline}{} \begin{frame} \maketitle \end{frame} } \begin{frame} \frametitle{Workflow management is needed} \begin{enumerate} \item Bioinformatics workflows tend to be long running and error prone \item Resume after resolving errors \item parallelism and distributed execution \item More complex than a straight chain \end{enumerate} \begin{center} $\Rightarrow$ tooling needed for reproducibility\footnote{generate bit-identical output from an analysis specification on any machine with sufficient resources} \end{center} \end{frame} \begin{frame} \frametitle{Core problems} \begin{enumerate} \item \emph{Managing software versions and dependencies}. \begin{itemize} \item Conda \item BioConda~\autocite{Grning2018} \item Debian DPKG/apt-get \end{itemize} \item \emph{Managing computational environments}. \begin{itemize} \item Docker \item Singularity \item \emph{virtual machines} \end{itemize} \item \emph{Managing workflows}. \begin{itemize} \item Toil~\autocite{toil} \item SnakeMake~\autocite{Koster2012} \item NextFlow~\autocite{di_tommaso_nextflow_2017} \end{itemize} \end{enumerate} \end{frame} \begin{frame}[label=dag] \begin{center} \begin{tikzpicture}[->,>=stealth,shorten >=1pt,auto,node distance=2cm,thick] \node (a) {align}; \node (s) [below of=a] {sort}; \node (c) [below of=s] {calling}; \path (a) edge node {} (s); \path (s) edge node {} (c); \pause \node (input) [above of=a] {reads}; \path (input) edge node {} (a); \node (ref) [right of=a] {reference}; \path (ref) edge node {} (a); \node (db) [right of=c] {dbNSFP}; \path (db) edge node {} (c); \pause \node (bwa) [left of=a] {BWA}; \path (bwa) edge node {} (a); \node (samtools) [left of=s] {samtools}; \path (samtools) edge node {} (s); \node (platypus) [left of=c] {platypus}; \path (platypus) edge node {} (c); \pause \node (glib) [left of=samtools] {glibc,$\cdots$}; \node (python) [left of=platypus] {python}; \path (glib) edge node {} (bwa); \path (glib) edge node {} (samtools); \path (python) edge node {} (platypus); \path (glib) edge node {} (python); \pause \node[draw=bngreen, fit=(bwa) (samtools) (platypus) (glib) (python),label=containers](cont){}; \node[draw=bngreen, fit=(ref) (db),label=tarball](tar){}; \node[draw=bnorange, fit=(a) (s) (c),label=below:workflow manager](workflow){}; \end{tikzpicture} \end{center} \end{frame} \againframe<4>{dag} \begin{frame} \frametitle{BioNix contributions} \begin{enumerate} \item Builds on Nix, a robust functional package manager \item Manages software, data, and workflows within the one system \item Implicitly specifies its entire computational environment \item Purely functional domain-specific language, simplifying specifying workflows to function composition \item Typing to reduce errors~\autocite{Bed2019} \end{enumerate} \end{frame} \begin{frame} \frametitle{What is Nix?} \begin{enumerate} \item Simple configuration language (like JSON + functions + modules) \item Build engine that \emph{realises} \emph{derivations} \begin{itemize} \item resumption \item error handling \item logging \item parallelisation \end{itemize} \item Derivations are complete descriptions for producing build products: all inputs and a build recipe \item Controlled \emph{side effects}\footnote{stuff not captured by the derivation}: none allowed during a build \item Output location unique and determined by hashing the derivation: i.e., hash based version management \end{enumerate} \end{frame} \begin{frame} \frametitle{What is BioNix?} \begin{enumerate} \item Thin wrapper on Nix \item Models \emph{stages}\footnote{the execution of one or more executables on one or more input files, producing one or more output files.} as functions (\Verb|config → inputs → drv|) \item Library of bioinformatics tools (BWA, samtools, etc) organised into a tree, e.g., \begin{itemize} \item \Verb|bionix.bwa.align|, \Verb|bionix.minimap2.align| \item \Verb|bionix.samtools.sort| \end{itemize} \item Functions for HPC execution \end{enumerate} \end{frame} \begin{frame} \frametitle{Example} \begin{minipage}{.4\textwidth} \includegraphics[width=.8\linewidth]{graph} \end{minipage} \begin{minipage}{.55\textwidth} \begin{overprint} \onslide<1>\includegraphics[width=\linewidth]{pipeline} \end{overprint} \end{minipage} \end{frame} \begin{frame} \frametitle{Demo} \pause \includegraphics[width=\linewidth]{demo-graph} \end{frame} \begin{frame} \frametitle{Stafford Fox Rare Cancer Project} \begin{enumerate} \item $\geq100$ WGS/WES samples totalling 20 TiB of primary data \item Clinical \& research driven \item Timely reporting to requesting clinicians \item Flexibility required to respond to research questions \item Cohort requires consistent processing \item Reproducibility throughout time \end{enumerate} \end{frame} \begin{frame} \frametitle{Stafford Fox Rare Cancer Project} \begin{enumerate} \item Reproducible workflow via BioNix, with version control provided by git \item SNV calling, neoantigen prediction, structural variants, copy number, mutational signatures, and report generation with embedded revision hash \item Handles WES, WGS, comprehensive cancer panel, PDX \item Continuous integration ensures reports are always up to date and consistent across the cohort \item Processed at Pawsey (Slurm) and WEHI (PBS \& Slurm) \item Almost completely automated handling of new data \end{enumerate} \end{frame} \begin{frame} \frametitle{Example report} \end{frame} \begin{frame} \frametitle{Stafford Fox Rare Cancer Workflow} \includegraphics[width=\linewidth]{sfrc01042} \end{frame} \begin{frame} \frametitle{Stafford Fox Rare Cancer Workflow} \includegraphics[width=\linewidth]{sfrc01042-gridss} \end{frame} \begin{frame} \frametitle{Generating expressions for new data} \includegraphics[width=.9\linewidth]{autogen} \end{frame} \begin{frame} \frametitle{Integrating RedCap information reproducibly} \begin{minipage}{.3\textwidth} \includegraphics[width=\linewidth]{redcap} \end{minipage} \begin{minipage}{.68\textwidth} \begin{enumerate} \item Difficult, live database without a release schedule \item Solution: store the relevant annotations in the expressions \item Git version control then also applies to the DB content \item Sync script to update annotations \end{enumerate} \end{minipage} \end{frame} \begin{frame} \frametitle{Benefits from using BioNix} \begin{enumerate} \item Guarantees a high degree of reproducibility and portability \item Easy to modify workflow and add components \item Small continuous integration implementation \item Inbuilt consistency checking via hash verification \end{enumerate} \end{frame} \begin{frame} \frametitle{Issues with BioNix} \begin{enumerate} \item Steep learning curve \begin{enumerate} \item Nix the language \item BioNix/nixpkgs abstractions \item Stafford Fox workflow particulars \end{enumerate} \item Low discoverability \item Modest collection of bioinformatics software in nixpkgs \item Nix evaluation isn't hermetic (fixed with flakes) \end{enumerate} \end{frame} \begin{frame} \frametitle{Alternative configuration structure} \includegraphics[width=\linewidth]{config} \end{frame} \begin{frame} \frametitle{Conclusions} \begin{enumerate} \item BioNix provides a high degree of reproducibility \item Obviates the need for multiple technologies (i.e., package managers and containers) \item Workflows as function composition, simplifying specification \item BioNix~\autocite{Bed2020} available at \url{https://github.com/PapenfussLab/BioNix} \end{enumerate} \end{frame} \begin{frame} \frametitle{Acknowledgements} \begin{minipage}{0.28\linewidth} \begin{itemize} \item Leon Di Stefano \item Tony Papenfuss \end{itemize} \end{minipage} \begin{minipage}{0.30\linewidth} \begin{block}{Papenfuss Lab} \begin{itemize} \item Alan Rubin \item Jocelyn Penington \item Ramyar Molania \end{itemize} \end{block} \end{minipage} \begin{minipage}{0.4\linewidth} \begin{block}{Stafford Fox Rare Cancer Team} \end{block} \begin{block}{Stafford Fox Medical Research Foundation} \end{block} \end{minipage} \vspace{1cm} \begin{center} \includegraphics[height=1cm]{wehi} \end{center} \end{frame} \end{document}