Picard

Picard is a set of Java tools that provides a set of command-line scripts for manipulating data and High Performance Sequence (HTS) formats.
It includes Java-based utilities that manipulate SAM files, and a Java API for creating new programs that read and write SAM files. Both the SAM text format and the SAM binary format (BAM) are supported.
It also works with next-generation sequences (NGS).