SAM (Sequence Alignment/Map) format is a generic format for storing large nucleotide sequence alignments. BAM format is the compressed binary version of SAM format. Further information about these formats can be found in the SAM format specifications document.
The Flux Capacitor needs the SAM input file to be indexed. The index is needed to access every locus indipendently, without the need to sequentially read the whole file. For this reason only BAM files are supported.
The BAM file must be sorted by the reference ID and then the leftmost coordinate before indexing (see SAM format specification above). The index file has to be placed in the same folder as the BAM file.
The BAM file cannot contain multiple alignments per entry/line ("compact format" NOT allowed).
The following example shows a valid mapped read-pair in SAM format:
The Flux Capacitor supports input files in SAM format containing multiple mappings. These alignments should be represented in an extended format, that is each line contains a single alignment and flag 256 have to be used to specify that the alignment is secondary. The usage of optional fields for representing multiple alignments on a single line is currently not supported.
The following example shows the required representation for multiple alignments:
SAM Tools provide various utilities for manipulating alignments in the SAM format, including sorting, merging, indexing and generating alignments in a per-position format. Please see more here. These tools can be used to prepare a BAM file which can be used as the input file for the Flux Capacitor.
to create the index, the BAM file has to be sorted by genomic position. Then you could run: