Software Usage Function
java -jar picard.jar java -jar picard.jar SplitSamByLibrary Takes a SAM or BAM file and separates all the reads into one SAM or BAM file per library name. Reads that do not have a read group specified or whose read group does not have a library name are written to a file called 'unknown.' The format (SAM or BAM) of the output files matches that of the input file.
java -jar picard.jar java -jar picard.jar CollectVariantCallingMetrics Collects per-sample and aggregate (spanning all samples) metrics from the provided VCF file.
java -jar picard.jar java -jar picard.jar RevertOriginalBaseQualitiesAndAddMateCigar Reverts the original base qualities and adds the mate cigar tag to read-group BAMs.
samtools flagstat samtools flagstat in.sam|in.bam|in.cram Uses samtools flagstat command to print descriptive information for a BAM dataset.
bamtools bamtools convert -format json -in myData.bam -out myData.json converts BAM to a number of other formats
java -jar picard.jar java -jar picard.jar CollectOxoGMetrics I=input.bam O=oxoG_metrics.txt R=reference_sequence.fasta Collect metrics to assess oxidative artifacts.This tool collects metrics quantifying the error rate resulting from oxidative artifacts. For a brief primer on oxidative artifacts, see the GATK Dictionary.This tool calculates the Phred-scaled probability that an alternate base call results from an oxidation artifact. This probability score is based on base context, sequencing read orientation, and the characteristic low allelic frequency. Please see the following reference for an in-depth discussion of the OxoG error rate.
java -jar picard.jar java -jar picard.jar CollectGcBiasMetrics I=input.bam O=gc_bias_metrics.txt CHART=gc_bias_metrics.pdf S=summary_metrics.txt R=reference_sequence.fasta Collect metrics regarding GC bias. This tool collects information about the relative proportions of guanine (G) and cytosine (C) nucleotides in a sample. Regions of high and low G + C content have been shown to interfere with mapping/aligning, ultimately leading to fragmented genome assemblies and poor coverage in a phenomenon known as 'GC bias'. Detailed information on the effects of GC bias on the collection and analysis of sequencing data can be found at DOI: 10.1371/journal.pone.0062856/.
bamtools bamtools revert -in input_alignments.bam -out output_alignments_reverted.bam The command bamtools revert removes duplicate marks and restores original base qualities.
java -jar picard.jar java -jar picard.jar BaitDesigner TARGET=targets.interval_list DESIGN_NAME=new_baits R=reference_sequence.fasta Designs oligonucleotide baits for hybrid selection reactions.
java -jar picard.jar java -jar picard.jar BuildBamIndex I=input.bam 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.
bamtools bamtools index -i <BAM FILE> Create index for BAM file
bamtools bamtools header -in input_alignments.bam -out output_alignments_header.txt Print header from BAM file(s)
java -jar picard.jar java -jar picard.jar SamToFastq I=input.bam FASTQ=output.fastq Converts a SAM or BAM file to FASTQ. This tool extracts read sequences and base quality scores from the input SAM/BAM file and outputs them in FASTQ format. This can be used by way of a pipe to run BWA MEM on unmapped BAM (uBAM) files efficiently.
bam2fq.py bam2fq.py -i test_PairedEnd_StrandSpecific_hg19.sam -o bam2fq_out1 Convert alignments in BAM or SAM format into fastq format.
samtools reheader samtools reheader [-iP] in.header.sam in.bam Copies header from source dataset into target dataset using samtools reheader command.
java -jar picard.jar java -jar picard.jar CleanSam Cleans the provided SAM/BAM, soft-clipping beyond-end-of-reference alignments and setting MAPQ to 0 for unmapped reads
java -jar picard.jar java -jar picard.jar CollectIlluminaBasecallingMetrics BASECALLS_DIR=/BaseCalls/ LANE=001 READ_STRUCTURE=25T8B25T INPUT=barcode_list.txt Collects Illumina Basecalling metrics for a sequencing run.
samtools fixmate samtools fixmate [-rpc] [-O format] in.nameSrt.bam out.bam Fill in mate coordinates, ISIZE and mate related flags from a name-sorted alignment.
java -jar picard.jar java -jar picard.jar BamToBfq I=input.bam ANALYSIS_DIR=analysis_dir OUTPUT_FILE_PREFIX=output_file_1 PAIRED_RUN=false 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.
bamtools bamtools split -in input_alignments.bam -mapped 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>.