The command bamtools split splits BAM file on user-specified property and creates a new BAM output file for each value found. In the given example, an output file input_alignments.MAPPED.bam is produced after -mapped split option is specified. Beside mapped, the split option can be: -paired, -reference, or -tag <tag_name>.
bamtools split -in input_alignments.bam -mapped
None