Sam/Bam Manipulation

java -jar picard.jar
Function: DEPRECATED: Use CollectHsMetrics instead. Calculates a set of Hybrid Selection specific metrics from an aligned SAMor BAM file. If a reference sequence is provided, AT/GC dropout metrics will be calculated, and the PER_TARGET_COVERAGE option can be used to output GC and mean coverage information for every target.
Usage: java -jar picard.jar CalculateHsMetrics
java -jar picard.jar
Function: Merge alignment data from a SAM or BAM with data in an unmapped BAM file. This tool produces a new SAM or BAM file that includes all aligned and unaligned reads and also carries forward additional read attributes from the unmapped BAM (attributes that are otherwise lost in the process of alignment). The purpose of this tool is to use information from the unmapped BAM to fix up aligner output. The resulting file will be valid for use by other Picard tools. For simple BAM file merges, use MergeSamFiles. Note that MergeBamAlignment expects to find a sequence dictionary in the same directory as REFERENCE_SEQUENCE and expects it to have the same base name as the reference FASTA except with the extension ".dict". If the output sort order is not coordinate, then reads that are clipped due to adapters or overlapping will not contain the NM, MD, or UQ tags.
Usage: java -jar picard.jar MergeBamAlignment ALIGNED=aligned.bam UNMAPPED=unmapped.bam O=merge_alignments.bam R=reference_sequence.fasta
samtools reheader
Function: Copies header from source dataset into target dataset using samtools reheader command.
Usage: samtools reheader [-iP] in.header.sam in.bam
samtools view
Function: Converts BAM dataset to SAM
Usage: samtools view -o [OUTPUT SAM] [-h|-H] [INPUT BAM]
bamtools
Function: Print header from BAM file(s)
Usage: bamtools header -in input_alignments.bam -out output_alignments_header.txt
java -jar picard.jar
Function: Collects per-sample and aggregate (spanning all samples) metrics from the provided VCF file.
Usage: java -jar picard.jar CollectVariantCallingMetrics
java -jar picard.jar
Function: Create BFQ files from a BAM file for use by the maq aligner. BFQ is a binary version of the FASTQ file format. This tool creates bfq files from a BAM file for use by the maq aligner.
Usage: java -jar picard.jar BamToBfq I=input.bam ANALYSIS_DIR=analysis_dir OUTPUT_FILE_PREFIX=output_file_1 PAIRED_RUN=false
bamtools
Function: The command bamtools revert removes duplicate marks and restores original base qualities.
Usage: bamtools revert -in input_alignments.bam -out output_alignments_reverted.bam
java -jar picard.jar
Function: Transforms raw Illumina sequencing data into an unmapped SAM or BAM file.
Usage: java -jar picard.jar IlluminaBasecallsToSam BASECALLS_DIR=/BaseCalls/ LANE=001 READ_STRUCTURE=25T8B25T RUN_BARCODE=run15 IGNORE_UNEXPECTED_BARCODES=true LIBRARY_PARAMS=library.params
java -jar picard.jar
Function: Not to be confused with SortSam which sorts a SAM or BAM file with a valid sequence dictionary, ReorderSam reorders reads in a SAM/BAM file to match the contig ordering in a provided reference file, as determined by exact name matching of contigs. Reads mapped to contigs absent in the new reference are dropped. Runs substantially faster if the input is an indexed BAM file.
Usage: java -jar picard.jar ReorderSam
java -jar picard.jar
Function: Generates a BAM index ".bai" file. This tool creates an index file for the input BAM that allows fast look-up of data in a BAM file, lke an index on a database. Note that this tool cannot be run on SAM files, and that the input BAM file must be sorted in coordinate order.
Usage: java -jar picard.jar BuildBamIndex I=input.bam
java -jar picard.jar
Function: Designs oligonucleotide baits for hybrid selection reactions.
Usage: java -jar picard.jar BaitDesigner TARGET=targets.interval_list DESIGN_NAME=new_baits R=reference_sequence.fasta
java -jar picard.jar
Function: Cleans the provided SAM/BAM, soft-clipping beyond-end-of-reference alignments and setting MAPQ to 0 for unmapped reads
Usage: java -jar picard.jar CleanSam
java -jar picard.jar
Function: Collects metrics from reduced representation bisulfite sequencing (Rrbs) data.
Usage: java -jar picard.jar CollectRrbsMetrics R=reference_sequence.fasta I=input.bam M=basename_for_metrics_files
java -jar picard.jar
Function: Sorts a SAM or BAM file. This tool sorts the input SAM or BAM file by coordinate, queryname (QNAME), or some other property of the SAM record. The SortOrder of a SAM/BAM file is found in the SAM file header tag @HD in the field labeled SO.
Usage: java -jar picard.jar SortSam I=input.bam O=sorted.bam SORT_ORDER=coordinate