Sam/Bam Manipulation

java -jar picard.jar
Function: Verify mate-pair information between mates and fix if needed.This tool ensures that all mate-pair information is in sync between each read and its mate pair. If no OUTPUT file is supplied then the output is written to a temporary file and then copied over the INPUT file. Reads marked with the secondary alignment flag are written to the output file unchanged.
Usage: java -jar picard.jar FixMateInformation I=input.bam O=fixed_mate.bam
java -jar picard.jar
Function: Evaluate genotype concordance between callsets.This tool evaluates the concordance between genotype calls for samples in different callsets where one is being considered as the truth (aka standard, or reference) and the other as the call that is being evaluated for accuracy.
Usage: java -jar picard.jar GenotypeConcordance CALL_VCF=input.vcf CALL_SAMPLE=sample_name O=gc_concordance.vcf TRUTH_VCF=truth_set.vcf TRUTH_SAMPLE=truth_sample#
java -jar picard.jar
Function: Produces a summary of alignment metrics from a SAM or BAM file. This tool takes a SAM/BAM file input and produces metrics detailing the quality of the read alignments as well as the proportion of the reads that passed machine signal-to-noise threshold quality filters. Note that these quality filters are specific to Illumina data; for additional information, please see the corresponding GATK Dictionary entry.
Usage: java -jar picard.jar CollectAlignmentSummaryMetrics R=reference_sequence.fasta I=input.bam O=output.txt
java -jar picard.jar
Function: Generate FASTQ file(s) from Illumina basecall read data.
Usage: java -jar picard.jar IlluminaBasecallsToFastq READ_STRUCTURE=25T8B25T BASECALLS_DIR=basecallDirectory LANE=001 OUTPUT_PREFIX=noBarcode.1 RUN_BARCODE=run15 FLOWCELL_BARCODE=abcdeACXX
java -jar picard.jar
Function: Compare two input ".sam" or ".bam" files. This tool initially compares the headers of SAM or BAM files. If the file headers are comparable, the tool will examine and compare readUnmapped flag, reference name, start position and strand between the SAMRecords. The tool summarizes information on the number of read pairs that match or mismatch, and of reads that are missing or unmapped (stratified by direction: forward or reverse).
Usage: java -jar picard.jar CompareSAMs file_1.bam file_2.bam
java -jar picard.jar
Function: Extract OxoG metrics from generalized artifacts metrics.
Usage: java -jar picard.jar ConvertSequencingArtifactToOxoG I=artifact_metricsR=reference.fasta
divide_bam.py
Function: Equally divide BAM file (m alignments) into n parts. Each part contains roughly m/n alignments that are randomly sampled from total alignments.
Usage: divide_bam.py -n 3 -i SingleEnd_StrandSpecific_50mer_Human_hg19.bam -o output
infer_experiment.py
Function: “guess” how RNA-seq sequencing were configured, particulary how reads were stranded for strand-specific RNA-seq data
Usage: infer_experiment.py -r gene_annotation.bed -i input.bam [options]
java -jar picard.jar
Function: Creates a sequence dictionary for a reference sequence. This tool creates a sequence dictionary file (with ".dict" extension) from a reference sequence provided in FASTA format, which is required by many processing and analysis tools. The output file contains a header but no SAMRecords, and the header contains only sequence records.The reference sequence can be gzipped (both .fasta and .fasta.gz are supported).
Usage: java -jar picard.jar CreateSequenceDictionary R=reference.fasta O=reference.dict
samtools split
Function: This tool will generate multiple output datasets for each redagroup from the input dataset.
Usage: samtools split [options] merged.sam|merged.bam|merged.cram
java -jar picard.jar
Function: Identifies duplicate reads, accounting for mate CIGAR. This tool locates and tags duplicate reads (both PCR and optical) in a BAM or SAM file, where duplicate reads are defined as originating from the same original fragment of DNA, taking into account the CIGAR string of read mates. It is intended as an improvement upon the original MarkDuplicates algorithm, from which it differs in several ways, includingdifferences in how it breaks ties. It may be the most effective duplicate marking program available, as it handles all cases including clipped and gapped alignments and locates duplicate molecules using mate cigar information. However, please note that it is not yet used in the Broad's production pipeline, so use it at your own risk. Note also that this tool will not work with alignments that have large gaps or deletions, such as those from RNA-seq data. This is due to the need to buffer small genomic windows to ensure integrity of the duplicate marking, while large skips (ex. skipping introns) in the alignment records would force making that window very large, thus exhausting memory.
Usage: java -jar picard.jar MarkDuplicatesWithMateCigar I=input.bam O=mark_dups_w_mate_cig.bam M=mark_dups_w_mate_cig_metrics.txt
java -jar picard.jar
Function: Gathers multiple VCF files from a scatter operation into a single VCF file. Input files must be supplied in genomic order and must not have events at overlapping positions.
Usage: java -jar picard.jar GatherVcfs
samtools view
Function: Converts SAM dataset into its sorted binary BAM (samtools > 1.3), or just sort the original bam file (samtools < 1.3).
Usage: samtools view -b -h -o -T [REFERENCE GENOME] [OUTPUT BAM] sorted_input.bam
java -jar picard.jar
Function: Sorts one or more VCF files. This tool sorts the records in VCF files according to the order of the contigs in the header/sequence dictionary and then by coordinate. It can accept an external sequence dictionary. If no external dictionary is supplied, the VCF file headers of multiple inputs must have the same sequence dictionaries.If running on multiple inputs (originating from e.g. some scatter-gather runs), the input files must contain the same sample names in the same column order.
Usage: java -jar picard.jar SortVcf I=vcf_1.vcf I=vcf_2.vcf O=sorted.vcf
java -jar picard.jar
Function: Identifies duplicate reads.
Usage: java -jar picard.jar MarkDuplicates I=input.bam O=marked_duplicates.bam M=marked_dup_metrics.txt