\section*{Availability and requirements}

\subsection*{\textbf{Pipelines and tutorials}}
\textbf{Project name:} Sewing machine pipeline

\textbf{Project home page:} The Sewing machine script and tutorial are available at \url{https://github.com/i5K-KINBRE-script-share/Irys-scaffolding/blob/master/KSU\_bioinfo\_lab/stitch/sewing\_machine\_LAB.md}. 

\textbf{Operating system(s):} Linux (tested on CentOS 7, Gentoo and Ubuntu).

\textbf{Programming language:} Perl, Rscript, Bash

\textbf{License}: Pipeline script and tutorial are available free of charge to academic and non-profit institutions.

\textbf{Any restrictions to use by non-academics:} Please contact authors for commercial use.

\textbf{Dependencies:} Sewing machine requires BioPerl and BNGCompare. RefAligner is also required between iterations and can be provided by request by Bionano Genomics \url{http://www.bionanogenomics.com/}.

\textbf{Project name:} “Raw data-to-finished assembly and assembly analysis” pipeline
\textbf{Project home page:} The pipeline script and tutorial are available at \url{https://github.com/i5K-KINBRE-script-share/Irys-scaffolding/blob/master/KSU\_bioinfo\_lab/assemble\_XeonPhi/assemble\_XeonPhi\_LAB.md}.

\textbf{Operating system(s):} Xeon Phi server with 1488 threads (6x60x4 Xeon Phi co-processor threads + 24x2 Xeon host threads) and 256GB of host RAM + 6 x 8GB Xeon Phi Ram, and Linux CentOS 7.

\textbf{Programming language:} Perl, Rscript, Bash

\textbf{License}: Pipeline script and tutorial are available free of charge to academic and non-profit institutions.

\textbf{Any restrictions to use by non-academics:} Please contact authors for commercial use.

\textbf{Dependencies:} AssembleIrysXeonPhi.pl and AssembleIrysCluster.pl requires DRMAA job submission libraries. RefAligner and Assembler are also required and can be provided by request by Bionano Genomics \url{http://www.bionanogenomics.com/}.

\textbf{Project name:} “Raw data-to-finished de novo assembly and assembly analysis” pipeline
\textbf{Project home page:} The pipeline script and tutorial are available at \url{https://github.com/i5K-KINBRE-script-share/Irys-scaffolding/blob/master/KSU\_bioinfo\_lab/assemble\_XeonPhi/assemble\_XeonPhi\_de\_novo\_LAB.md}.

\textbf{Operating system(s):} Xeon Phi server with 1488 threads (6x60x4 Xeon Phi co-processor threads + 24x2 Xeon host threads) and 256GB of host RAM + 6 x 8GB Xeon Phi Ram, and Linux CentOS 7.

\textbf{Programming language:} Perl, Rscript, Bash

\textbf{License}: Pipeline script and tutorial are available free of charge to academic and non-profit institutions.

\textbf{Any restrictions to use by non-academics:} Please contact authors for commercial use.

\textbf{Dependencies:} AssembleIrysXeonPhi.pl and AssembleIrysCluster.pl requires DRMAA job submission libraries. RefAligner and Assembler are also required and can be provided by request by Bionano Genomics \url{http://www.bionanogenomics.com/}.

%%%%%%%%%%%%%%%%%%

\subsection*{\textbf{Assembly scripts}}
\textbf{Project name:} AssembleIrysXeonPhi.pl / AssembleIrysCluster.pl

\textbf{Project home page:} AssembleIrysXeonPhi scripts are available at \url{https://github.com/i5K-KINBRE-script-share/Irys-scaffolding/blob/master/KSU\_bioinfo\_lab/assemble\_XeonPhi/AssembleIrysXeonPhi.pl}. The currently unsupported AssembleIrysCluster scripts are available on Github at \url{https://github.com/i5K-KINBRE-script-share/Irys-scaffolding/tree/master/KSU\_bioinfo\_lab/assemble\_SGE\_cluster}

\textbf{Operating system(s):} Xeon Phi server with 1488 threads (6x60x4 Xeon Phi co-processor threads + 24x2 Xeon host threads) and 256GB of host RAM + 6 x 8GB Xeon Phi Ram, and Linux CentOS 7 and SGE Linux (tested on a Gentoo) cluster respectively

\textbf{Programming language:} Perl, Rscript, Bash

\textbf{License}: AssembleIrysXeonPhi and AssembleIrysCluster.pl is available free of charge to academic and non-profit institutions.

\textbf{Any restrictions to use by non-academics:} Please contact authors for commercial use.

\textbf{Dependencies:} AssembleIrysXeonPhi.pl and AssembleIrysCluster.pl requires DRMAA job submission libraries. RefAligner and Assembler are also required and can be provided by request by Bionano Genomics \url{http://www.bionanogenomics.com/}.

\subsection*{\textbf{Super scaffolding scripts}}

\textbf{Project name:} stitch.pl

\textbf{Project home page:} Stitch scripts are available on Github at \url{https://github.com/i5K-KINBRE-script-share/Irys-scaffolding/tree/master/KSU\_bioinfo\_lab/stitch}

\textbf{Operating system(s):} MAC and LINUX (tested on Gentoo and Ubuntu)

\textbf{Programming language:} Perl, Rscript, Bash

\textbf{License}: stitch.pl is available free of charge to academic and non-profit institutions.

\textbf{Any restrictions to use by non-academics:} Please contact authors for commercial use.

\textbf{Dependencies:} stitch.pl requires BioPerl. RefAligner and Assembler are also required between iterations and can be provided by request by Bionano Genomics \url{http://www.bionanogenomics.com/}.

\subsection*{\textbf{Map summary scripts}}

\textbf{Project name:} BNGCompare.pl, bnx\_stats.pl, cmap\_stats.pl and xmap\_stats.pl

\textbf{Project home page:} all scripts are available on Github at \url{https://github.com/i5K-KINBRE-script-share/Irys-scaffolding/tree/master/KSU\_bioinfo\_lab/map\_tools} and \url{https://github.com/i5K-KINBRE-script-share/BNGCompare}

\textbf{Operating system(s):} MAC and LINUX (tested on Gentoo and Ubuntu)

\textbf{Programming language:} Perl, Rscript, Bash

\textbf{License}: bnx\_stats.pl, cmap\_stats.pl and xmap\_stats.pl are available free of charge to academic and non-profit institutions.

\textbf{Any restrictions to use by non-academics:} Please contact authors for commercial use.

\textbf{Dependencies:} bnx\_stats.pl, cmap\_stats.pl and xmap\_stats.pl have no dependencies.

\begin{backmatter}

\section*{Competing interests}
  The JMS, MCC, NH, NL, and SJB declare that they have no competing interests. ETL, PS and TA are employees at BioNano Genomics and hold stock options. 


\section*{Author's contributions}
MCC isolated the high molecular weight DNA and generated the image files on the Irys. ETL and JMS developed the assembly workflow. JMS wrote most of the code in the IrysScaffolding Github Repo (Stitch, AssembleIrysXeonPhi, AssembleIrysCluster, etc.). NH assisted with initial code review of analyze\_irys\_output (precursor to Stitch) and prepared Tcas5.0. JMS and NL manually edited Tcas5.1. JMS performed the data analyses. TA contributed to sections discussing BioNano RefAligner and Assembler. PS contributed to interpretation of results. JMS and SJB did most of the writing with contributions from all authors. All authors read and approved the final manuscript.

\section*{Acknowledgements}

This project was supported by an Institutional Development Award (IDeA) from the National Institute of General Medical Sciences of the National Institutes of Health under grant number P20 GM103418. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institute of General Medical Sciences or the National Institutes of Health.

Data for Additional file 1 and Additional file 6 was kindly made available by P.A. Larsen, J. Rogers, A.D. Yoder and the Duke Lemur Center.

The \textit{Tribolium castaneum} genome project is part of the i5k Genome Sequencing Initiative for Insects and Other Arthropods.

Matthias Weissensteiner & Jochen Wolf, Uppsala University. Stephen Schaeffer from The Pennsylvania State University and Stephen Richards from the Baylor College of Medicine Human Genome Sequencing Center for the use of the \textit{D. pseudoobscura} data. Mike Kanost from Kansas State University. Jeff Maughan from Brigham Young University for the use of the \textit{Amaranth} data. The Udall Lab from Brigham Young University and Cotton Inc. for the use of the cotton data. Grant (NSF 1237993) for use of the \textit{Medicago} data. Christopher Cunningham, University of Georgia for the use of Nicrophorus data. Catherine Peichel from the Fred Hutchinson Cancer Research Center and Michael White from the University of Georgia for the \textit{Gasterosteus} data. Mirkó Palla, Ph.D., Wyss Institute Postdoctoral Fellow, Church; Laboratory - Department of Genetics, Harvard Medical School and George Church, Ph.D., Wyss Institute Core Faculty Member, Robert Winthrop Professor of Genetics at Harvard Medical School, Professor of Health Sciences and Technology at Harvard and MIT, and Senior Associate Member at the Broad Institute of Harvard and MIT for the \textit{Escherichia coli} data.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                  The Bibliography                       %%
%%                                                         %%
%%  Bmc_mathpys.bst  will be used to                       %%
%%  create a .BBL file for submission.                     %%
%%  After submission of the .TEX file,                     %%
%%  you will be prompted to submit your .BBL file.         %%
%%                                                         %%
%%                                                         %%
%%  Note that the displayed Bibliography will not          %%
%%  necessarily be rendered by Latex exactly as specified  %%
%%  in the online Instructions for Authors.                %%
%%                                                         %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% if your bibliography is in bibtex format, use those commands:
\bibliographystyle{bmc-mathphys} % Style BST file
\bibliography{bmc_article}      % Bibliography file (usually '*.bib' )

% or include bibliography directly:
% \begin{thebibliography}
% \bibitem{b1}
% \end{thebibliography}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                               %%
%% Figures                       %%
%%                               %%
%% NB: this is for captions and  %%
%% Titles. All graphics must be  %%
%% submitted separately and NOT  %%
%% included in the Tex document  %%
%%                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%
%% Do not use \listoffigures as most will included as separate files

%\section*{Figures}
%  \begin{figure}[h!]
%  	\caption{\csentence{Data analysis steps.}
%  		(1) Autodetect analyzes TIFF images of molecules and (2) outputs BNX text files. (3) Sequence scaffolds are digested \textit{in silico} with fa2cmap\_multi producing (4) \textit{in silico} maps. (5) AssembleIryscluster uses \textit{in silico} maps, BNX files and estimated genome size to (6) normalize molecule stretch and set assembly parameters. (7) Assembler produces (8) a consensus genome map. (9) RefAligner aligns the consensus genome maps to the \textit{in silico} maps producing (10) an XMAP alignment file. (11) XMAP, of \textit{in silico} maps and consensus genome maps (see arrows with dashed lines) are used by stitch to produce (12) super scaffolded (stitched) sequence scaffolds. (13) Until no more super scaffolds are created the stitched sequence scaffolds are digested \textit{in silico} with fa2cmap\_multi producing (14) a CMAP that is aligned to (9) the consensus genome maps and steps 10-15 are iterated. Arrows with dotted rather than dashed lines are used to as input during iterations.}
%  \end{figure}
%  \begin{figure}[h!]
%  	\caption{\csentence{Assembly workflow for assemble\_SGE\_cluster.pl.}
%  		(A) The Irys instrument produces tiff files that are converted into BNX text files. (B) One BNX file is produced for each flowcell on a IrysChip. (C) BNX files are split by scan and aligned to the sequence reference. Stretch (bases per pixel) is recalculated for each scan from the alignment. (D) Quality check graphs are created for each pre-adjusted flowcell BNX. (E) Adjusted flowcell BNXs are merged. (F) The first assemblies are run with a variety of p-value thresholds. (G) The best first assembly (red oval) is chosen and a version of this assembly is produced with a variety of minimum molecule length filters.}
%  \end{figure}
%  \begin{figure}[h!]
%  \caption{\csentence{Steps of the stitch.pl algorithm.}
%      Consensus genome maps (blue) are shown aligned to \textit{in silico} maps (green). Alignments are indicated with grey lines. CMAP orientation for \textit{in silico} maps is indicated with a "+" or "-" for positive or negative orientation respectively. (A) The \textit{in silico} maps are used as the reference. (B) The alignment is inverted and used as input for stitch.pl. (C) The alignments are filtered based on alignment length (purple) relative to total possible alignment length (black) and confidence. Here assuming all alignments have high confidence scores and the minimum percent aligned is 30\% two alignments fail for aligning over less than 30\% of the potential alignment length for that alignment. (D) Filtering produces an XMAP of high quality alignments with short (local) alignments removed. (E) High quality scaffolding alignments are filtered for longest and highest confidence alignment for each \textit{in silico} map. The third alignment (unshaded) is filtered because the second alignment is the longest alignment for \textit{in silico} map 2. (F) Passing alignments are used to super scaffold (captured gaps indicated in dark green). (G) Stitch is iterated and additional super scaffolding alignments are found using second best scaffolding alignments. (H) Iteration takes advantage of cases where \textit{in silico} maps scaffold consensus genome maps as \textit{in silico} map 2 does. Stitch is run iteratively until all super scaffolding alignments are found.}
%      \end{figure} 
%\begin{figure}[h!]
%	\caption{\csentence{Cumulative length per BNX file for \textit{T. castaneum} data generated over time.}
% Cumulative length of single molecule maps $>$ 150 kb are plotted on the y-axis (purple X), the upgrade to the V2 IrysChip (grey dashed line) is plotted and date is indicated on the x-axis. Data was generated from 03-2013 to 01-2014. Aborted runs (cumulative length = 0) excluded. }
%\end{figure}
%\begin{figure}[h!]
%	\caption{\csentence{Comparison of assemblies from the \textit{T. castaneum} single molecule maps using five sets of parameters.}
% Relaxed, default and strict "-T" parameters were set to 5e-08, 5e-09 and 5e-10. Relaxed, default and strict minimum molecule length were set to 100, 150 and 180 kb.}
%\end{figure}     
%\begin{figure}[h!]
%	\caption{\csentence{Histogram of gap lengths in Tcas5.1.}
% Positive and negative gaps lengths for Tcas5.1 added to the automated output of stitch.pl based on filtered scaffolding alignments. The majority of gap lengths added by stitch.pl, 66, were positive (red). The remaining 26 gaps had negative lengths (purple).}
%      \end{figure}                      
%\begin{figure}[h!]
%	\caption{\csentence{Extremely small negative gap length for \textit{in silico} map of scaffold 81.}
% Two XMAP alignments for \textit{in silico} map of sequence scaffold 81 are shown. Consensus genome maps (blue with molecule map coverage shown in dark blue) align to the \textit{in silico} maps of scaffolds (green with contigs overlaid as translucent colored squares). Sequence scaffolds 79-83 were placed within ChLG 5 and sequence scaffolds 99-103 were placed with ChLG 7 by the \textit{T. castaneum} genetic map. (A) Half of the \textit{in silico} map of sequence scaffold 81 aligns with its assigned ChLG (black arrow). (B) The other half aligns with ChLG 7 (red arrow) producing a negative gap length smaller than -20 kb. The alignment that places sequence scaffold 81 with ChLG 7 disagrees with the genetic map and was manually rejected for Tcas5.2.}
%      \end{figure} 
%
%\begin{figure}[h!]
%	\caption{\csentence{ChLGX before and after super scaffolding with Stitch and Hybrid Map creation by Hybrid Scaffold.}
% (A) Alignment of Tcas5.2 \textit{in silico} maps to consensus genome maps for ChLGX. (B) Alignment of Tcas5.0 \textit{in silico} maps to consensus genome maps for ChLGX. (c) Alignment of Hybrid genome maps to consensus genome maps for ChLGX. Consensus genome maps are blue with molecule map coverage shown in dark blue). The \textit{in silico} maps are green with contigs overlaid as translucent colored squares. Only \textit{in silico} maps that align are displayed in IrysView. The single hybrid scaffold created for ChLGX is shown (yellow). Only new "hybridized" maps are shown in IrysView. Labels and alignments of labels are indicated with grey lines. }
%      \end{figure}  
%\begin{figure}[h!]
%	\caption{\csentence{Putative haplotypes assembled as consensus genome maps.}
% (A) Two consensus genome maps (blue with molecule map coverage shown in dark blue) align to the \textit{in silico} map of scaffold 131 (green with contigs overlaid as translucent colored squares). (B and C) Both consensus genome maps are shown (blue) with single molecule pileups (yellow). Both consensus genome maps have similar label patterns except within the lower coverage region indicated with a black square.}
%\end{figure}            
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                               %%
%% Tables                        %%
%%                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Use of \listoftables is discouraged.
%%

\section*{Tables}

\begin{table}[h!]
\caption{Single molecule maps from \textit{T. castaneum} filtered by minimum length. Molecule map N50, cumulative length and number of maps are listed for all three molecule length filters for the \textit{T. castaneum} genome data.}
      \begin{tabular}{cccc}
        \hline
         Minimum molecule map length (kb) & Molecule map N50 (kb) & Cumulative length (Mb) & Number of molecule maps\\ \hline
        100 & 165.35 & 82,738.71 & 503,414 \\
        150 & 202.64 & 50,579.12 & 239,558 \\ 
        180 & 232.57 & 34,287.15 & 139,949 \\ \hline  
      \end{tabular}
\end{table}

\begin{table}[h!]
	\caption{\textit{T. castaneum} assembly summary. Assembly metrics for Tcas5.0 (the starting sequence scaffolds), the Tcas5.0  \textit{in silico} maps, the consensus genome map of assembled molecule maps, the automated output of Stitch (Tcas5.1), the manually curated sequence assembly (Tcas5.2) and the sequence assembly produced by the BioNano Hybrid Scaffold software for the \textit{T. castaneum} genome.}
	\begin{tabular}{cccc}
		\hline
		& N50 (Mb)  & Number & Cumulative Length (Mb)\\ \hline
		Tcas5.0 sequence scaffolds & 1.16 & 2240 & 160.74\\
		Tcas5.0 \textit{in silico} maps & 1.20 &  223 & 152.53\\
		Consensus genome maps & 1.35 &  216 & 200.47\\
		Tcas5.1 sequence scaffolds & 3.85 & 2148 & 165.72\\
		Tcas5.2 sequence scaffolds & 4.46 & 2150 & 165.92\\ 
		Tcas BioNano hybrid scaffolds & 1.83 & 2210 &175.54 \\ \hline
	\end{tabular}
\end{table}
\begin{table}[h!]
\caption{Alignment of \textit{T. castaneum} consensus genome maps to the \textit{in silico} maps of Tcas5.0. Breadth of alignment coverage (non-redundant alignment), length of total alignment (including redundant alignments) and percent of CMAP covered (non-redundantly) were calculated for the \textit{in silico} maps and the consensus genome maps of the \textit{T. castaneum} genome the using xmap\_stats.pl.}
      \begin{tabular}{cccc}
        \hline
           & Breadth of alignment coverage (Mb) & Length of total alignment (Mb) & Percent of CMAP aligned \\ \hline
        Tcas5.0 \textit{in silico} maps & 124.04 & 132.40 & 81 \\
        Consensus genome maps & 131.64 & 132.34 & 67 \\ \hline
      \end{tabular}
\end{table}
\begin{table}[h!]
	\caption{Each \textit{T. castaneum} chromosome linkage group (ChLG) before and after super scaffolding. The number of sequence scaffolds in the ordered Tcas5.0 ChLG bins and the number of sequence super scaffolds and scaffolds in the Tcas5.2 ChLG bins. The number of sequence scaffolds that were unplaced in Tcas5.0 and placed with a ChLG in Tcas5.2 is also listed. }
	\begin{tabular}{cccc}
		\hline
		ChLG & Tcas5.0 scaffolds & Unplaced scaffolds added in Tcas5.2 & Tcas5.2 super scaffolds \\ \hline
		X & 13 & +2 & 2\\
		2 & 18 & +1 & 10\\
		3 & 29 & +4 & 20\\
		4 & 6 & +2 & 2\\
		5 & 17 & +1 & 4\\
		6 & 12 & +6 & 6\\
		7 & 15 & - & 6\\
		8 & 14 & +1 & 8\\
		9 & 21 & - & 9\\
		10 & 12 & +2 & 10\\ \hline
		Total & 157 & 19 & 77\\ \hline
	\end{tabular}
\end{table}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                               %%
%% Additional Files              %%
%%                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section*{Additional Files}

\subsection*{Additional file 1 --- Single molecule map stretch per scan in recent flowcells.} Bases per pixel (bpp) is plotted for scans 1..$n$ for each flowcell of mouse lemur molecules (purple). The first scan of each flowcell is indicated with a grey dashed line. The pre-adjusted molecule map stretch was determined by aligning molecule maps to the \textit{in silico} maps. Data made available by P.A. Larsen, J. Rogers, A.D. Yoder and the Duke Lemur Center.

\subsection*{Additional file 2 --- Cumulative length and number of single molecule maps per BNX file for \textit{T. castaneum} data generated over time}
    Detailed metrics for molecule maps per BNX file (cumulative length and number of maps). Columns include cumulative length of molecule maps  $>$ 150 kb, number of molecule maps $>$ 150 kb and date that BNX file was generated.

  \subsection*{Additional file 3 --- Single molecule map metrics and histograms from \textit{T. castaneum} DNA}
    Detailed metrics for molecule maps including map N50, cumulative length and number of maps. Figures show histograms of per molecule map quality metrics including length, molecule map SNR and intensity, label count, label SNR and label intensity. Molecule maps are filter for minimum molecule lengths of 100, 150 or 180 kb.

  \subsection*{Additional file 4 --- Assembly of \textit{T. castaneum} consensus genome maps with range of parameters}
    Detailed assembly metrics for assembled consensus genome maps using strict, default and relaxed "-T" parameter, p-value threshold are named Relaxed-T, Default-T and Strict-T respectively. The best "-T" parameter was used for two additional assemblies with either relaxed minimum molecule map length (relaxed-minlen) of 100 kb, rather than the 150 kb default, or a strict minimum molecule map length (strict-minlen) of 180 kb. 

  \subsection*{Additional file 5 --- ChLGs before and after super scaffolding }
    Alignments of Tcas5.0 and Tcas5.2 \textit{in silico} maps to consensus genome maps for all ChLGs. Consensus genome maps (blue with molecule coverage shown in dark blue) aligned to the \textit{in silico} maps (green with contigs overlaid as translucent colored squares). Alignment to both Tcas5.2 super scaffolds (top alignment) and Tcas5.0 scaffolds (bottom alignment) are shown.
    
    \subsection*{Additional file 6 --- Assembly and super scaffolding with multiple genera. }
    We examined experiments from 16 different genera to determine if the results seen for the \textit{Tribolium castaneum} genome are typical for other genomes as well.



\end{backmatter}
