BAM-files must be sorted before an index can be created.
During this routine, some content of the source file
is copied into the working memory, sorted and written
into temporary files. Finally, the sorted files are
merged into a single target. The name of the target
is [prefix].bam.
Number and size of temporary files depend on source
file size and used working memory (maxmem). Small
maxmem values result in large numbers of temporary
files.
The minimum maxmem value is 100000000. Smaller maxmem
values cause an error.