Sam/Bam Manipulation

bamtools
Function: filters BAM file(s)
Usage: bamtools filter -in <BAM file> -out <BAM file> -length 100
java -jar picard.jar
Function: Reverts SAM or BAM files to a previous state. This tool removes or restores certain properties of the SAM records, including alignment information, which can be used to produce an unmapped BAM (uBAM) from a previously aligned BAM. It is also capable of restoring the original quality scores of a BAM file that has already undergone base quality score recalibration (BQSR) if theoriginal qualities were retained.
Usage: java -jar picard.jar RevertSam I=input.bamO=reverted.bam
java -jar picard.jar
Function: Classify PF-Failing reads in a HiSeqX Illumina Basecalling directory into various categories.
Usage: java -jar picard.jar CollectHiSeqXPfFailMetrics BASECALLS_DIR=/BaseCalls/ OUTPUT=/metrics/ LANE=001
java -jar picard.jar
Function: Asserts the validity for specified Illumina basecalling data.
Usage: java -jar picard.jar CheckIlluminaDirectory BASECALLS_DIR=/BaseCalls/ READ_STRUCTURE=25T8B25T LANES=1 DATA_TYPES=BaseCalls
java -jar picard.jar
Function: Collect metrics to quantify single-base sequencing artifacts.
Usage: java -jar picard.jar CollectSequencingArtifactMetrics I=input.bamO=artifact_metrics.txtR=reference_sequence.fasta
java -jar picard.jar
Function: Collect metrics about coverage and performance of whole genome sequencing (WGS) experiments.
Usage: java -jar picard.jar CollectWgsMetrics I=input.bam O=collect_wgs_metrics.txt R=reference_sequence.fasta
java -jar picard.jar
Function: Converts a VCF or BCF file to a Picard Interval List.
Usage: java -jar picard.jar VcfToIntervalList
java -jar picard.jar
Function: Replace read groups in a BAM file.This tool enables the user to replace all read groups in the INPUT file with a single new read group and assign all reads to this read group in the OUTPUT BAM file.For more information about read groups, see the GATK Dictionary entry. This tool accepts INPUT BAM and SAM files or URLs from the Global Alliance for Genomics and Health (GA4GH) (see http://ga4gh.org/#/documentation).
Usage: java -jar picard.jar AddOrReplaceReadGroups I=input.bam O=output.bam RGID=4 RGLB=lib1 RGPL=illumina RGPU=unit1 RGSM=20
bamtools
Function: Merge multiple BAM files into one
Usage: bamtools merge -in input_alignments_1.bam -in input_alignments_2.bam -in input_alignments_3.bam -out output_alignments_merged.bam
bamtools
Function: The command bamtools sort sorts a BAM file according to a given option. Output_alignments_sorted.bam is the resulting file, where the alignments are sorted by name.
Usage: bamtools sort -in input_alignments.bam -out output_alignments_sorted.bam -byname
samtools depth
Function: Computes the depth at each position or region.
Usage: samtools depth [options] [in1.sam|in1.bam|in1.cram [in2.sam|in2.bam|in2.cram] [...]]
bamtools
Function: prints number of alignments in BAM file(s)
Usage: bamtools count -in <BAM file>
java -jar picard.jar
Function: Chart the nucleotide distribution per cycle in a SAM or BAM fileThis tool produces a chart of the nucleotide distribution per cycle in a SAM or BAM file in order to enable assessment of systematic errors at specific positions in the reads.
Usage: java -jar picard.jar CollectBaseDistributionByCycle CHART=collect_base_dist_by_cycle.pdf I=input.bam O=output.txt
java -jar picard.jar
Function: Collect metrics about reads that pass quality thresholds and Illumina-specific filters. This tool evaluates the overall quality of reads within a bam file containing one read group. The output indicates the total numbers of bases within a read group that pass a minimum base quality score threshold and (in the case of Illumina data) pass Illumina quality filters as described in the GATK Dictionary entry.
Usage: java -jar picard.jar CollectQualityYieldMetrics I=input.bam O=quality_yield_metrics.txt \
java -jar picard.jar
Function: Converts VCF to BCF or BCF to VCF. This tool converts files between the plain-text VCF format and its binary compressed equivalent, BCF. Input and output formats are determined by file extensions specified in the file names. For best results, it is recommended to ensure that an index file is present and set the REQUIRE_INDEX option to true.
Usage: java -jar picard.jar VcfFormatConverter I=input.vcf O=output.bcf REQUIRE_INDEX=true