# Package picard.sam

- Interface Summary
  Interface | Description
  --- | ---
  PrimaryAlignmentSelectionStrategy | Given a set of alignments for a read or read pair, mark one alignment as primary, according to whatever strategy is appropriate.

- Class Summary
  Class | Description
  --- | ---
  AbstractAlignmentMerger | Abstract class that coordinates the general task of taking in a set of alignment information, possibly in SAM format, possibly in other formats, and merging that with the set of all reads for which alignment was attempted, stored in an unmapped SAM file.
  AddCommentsToBam | A tool to add comments to a BAM file header.
  AddOrReplaceReadGroups | Replaces read groups in a BAM file
  BamIndexStats | Command line program to print statistics from BAM index (.bai) file Statistics include count of aligned and unaligned reads for each reference sequence and a count of all records with no start coordinate.
  BestEndMapqPrimaryAlignmentStrategy | For an aligner that aligns each end independently, select the alignment for each end with the best MAPQ, and make that the primary.
  BestMapqPrimaryAlignmentSelectionStrategy | This strategy was designed for TopHat output, but could be of general utility.
  BuildBamIndex | Command line program to generate a BAM index (.bai) file from a BAM (.bam) file
  CalculateReadGroupChecksum |
  CheckTerminatorBlock | Simple class to check the terminator block of a SAM file.
  CleanSam |
  CompareSAMs | Rudimentary SAM comparer.
  CreateSequenceDictionary | Create a SAM/BAM file from a fasta containing reference sequence.
  DownsampleSam | Class to randomly downsample a BAM file while respecting that we should either retain or discard all of the reads for a template - i.e.
  DuplicationMetrics | Metrics that are calculated during the process of marking duplicates within a stream of SAMRecords.
  EarliestFragmentPrimaryAlignmentSelectionStrategy | When it is necessary to pick a primary alignment from a group of alignments for a read, pick the one that maps the earliest base in the read.
  FastqToSam | Converts a fastq file to an unaligned BAM/SAM format.
  FilterSamReads | From a SAM or BAM file, produce a new SAM or BAM by filtering aligned reads or a list of read names provided in a file (one readname per line) $Id$
  FixMateInformation | Class to fix mate pair information for all reads in a SAM file.
  GatherBamFiles | Program to perform a rapid "gather" operation on BAM files after a scatter operations where the same process has been performed on different regions of a BAM file creating many smaller BAM files that now need to be concatenated back together.
  MergeBamAlignment | A command-line tool to merge BAM/SAM alignment info from a third-party aligner with the data in an unmapped BAM file, producing a third BAM file that has alignment data and all the additional data from the unmapped BAM
  MergeSamFiles | Reads a SAM or BAM file and combines the output to one file
  MostDistantPrimaryAlignmentSelectionStrategy | For a paired-end aligner that aligns each end independently, select the pair of alignments that result in the largest insert size.
  PositionBasedDownsampleSam | Class to downsample a BAM file while respecting that we should either get rid of both ends of a pair or neither end of the pair.
  ReorderSam | Reorders a SAM/BAM input file according to the order of contigs in a second reference sequence
  ReplaceSamHeader |
  RevertOriginalBaseQualitiesAndAddMateCigar | This tool reverts the original base qualities (if specified) and adds the mate cigar tag to mapped BAMs.
  RevertSam | Reverts a SAM file by optionally restoring original quality scores and by removing all alignment information.
  SamAlignmentMerger | Class that takes in a set of alignment information in SAM format and merges it with the set of all reads for which alignment was attempted, stored in an unmapped SAM file.
  SamFormatConverter | Converts a BAM file to human-readable SAM output or vice versa
  SamToFastq | Extracts read sequences and qualities from the input SAM/BAM file and writes them into the output file in Sanger fastq format.
  SetNmAndUqTags | Deprecated
  SetNmMdAndUqTags |
  SortSam |
  SplitSamByLibrary | Command-line program to split a SAM or BAM file into separate files based on library name.
  ValidateSamFile | Command line program wrapping SamFileValidator.
  ViewSam | Very simple command that just reads a SAM or BAM file and writes out the header and each records to standard out.

- Enum Summary
  Enum | Description
  --- | ---
  FilterSamReads.Filter |
  RevertOriginalBaseQualitiesAndAddMateCigar.CanSkipSamFile | Used as a return for the canSkipSAMFile function.
  RevertSam.FileType |
  ValidateSamFile.Mode |
  ViewSam.AlignmentStatus |
  ViewSam.PfStatus |