Shuffles and groups reads together by their names. A faster alternative to a full query name sort, collate ensures that reads of the same name are grouped together in contiguous groups, but doesn't make any guarantees about the order of read names between groups. The output from this command should be suitable for any operation that requires all reads from the same template to be grouped together.
samtools collate [options] in.sam|in.bam|in.cram [out.prefix]
Options:
-O
Output to stdout rather than to files starting with out.prefix
-u
Write uncompressed BAM output
-l INT
Compression level. [1]
-n INT
Number of temporary files to use. [64]