Sam/Bam Manipulation

CNVnator
Function: Extracting read mapping from bam/sam files by using CNVnator
Usage: cnvnator [-genome name] -root out.root [-chrom name1 ...] -tree [file1.bam ...]
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
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: 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 fixmate
Function: Fill in information (insert size, cigar, mapq) about paired end reads onto the corresponding other read. It also has options to remove secondary/unmapped alignments and recalculate whether reads are proper pairs.
Usage: samtools fixmate [-rpc] [-O format] in.nameSrt.bam out.bam
Supported input format: BAM
samtools sort
Function: This tool uses samtools sort command to sort BAM datasets in coordinate or read name order.
Usage: samtools sort [-l level] [-m maxMem] [-o out.bam] [-O format] [-n] [-T tmpprefix] [-@ threads] [in.sam|in.bam|in.cram]
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: 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
java -jar picard.jar
Function: Tool determines the barcode for each read in an Illumina lane.
Usage: java -jar picard.jar ExtractIlluminaBarcodes BASECALLS_DIR=/BaseCalls/ LANE=1 READ_STRUCTURE=25T8B25T BARCODE_FILE=barcodes.txt METRICS_FILE=metrics_output.txt
read_distribution.py
Function: Provided a BAM/SAM file and reference gene model, this module will calculate how mapped reads were distributed over genome feature (like CDS exon, 5’UTR exon, 3’ UTR exon, Intron, Intergenic regions). When genome features are overlapped (e.g. a region could be annotated as both exon and intron by two different transcripts) , they are prioritize as: CDS exons > UTR exons > Introns > Intergenic regions, for example, if a read was mapped to both CDS exon and intron, it will be assigned to CDS exons.
Usage: read_distribution.py -i Pairend_StrandSpecific_51mer_Human_hg19.bam -r hg19.refseq.bed12
java -jar picard.jar
Function: Collect whole genome sequencing-related metrics. This tool computes metrics that are useful for evaluating coverage and performance of whole genome sequencing experiments. These metrics include the percentages of reads that pass minimal base- and mapping- quality filters as well as coverage (read-depth) levels. The histogram output is optional and for a given run, displays two separate outputs on the y-axis while using a single set of values for the x-axis. Specifically, the first column in the histogram table (x-axis) is labeled 'coverage' and represents different possible coverage depths. However, it also represents the range of values for the base quality scores and thus should probably be labeled 'sequence depth and base quality scores'. The second and third columns (y-axes) correspond to the numbers of bases at a specific sequence depth 'count' and the numbers of bases at a particular base quality score 'baseq_count' respectively.Although similar to the CollectWgsMetrics tool, the default thresholds for CollectRawWgsMetrics are less stringent. For example, the CollectRawWgsMetrics have base and mapping quality score thresholds set to '3' and '0' respectively, while the CollectWgsMetrics tool has the default threshold values set to '20' (at time of writing). Nevertheless, both tools enable the user to input specific threshold values.
Usage: java -jar picard.jar CollectRawWgsMetrics I=input.bam O=raw_wgs_metrics.txt R=reference_sequence.fasta INCLUDE_BQ_HISTOGRAM=true
samtools addreplacerg
Function: Adds or replaces read group tags in a file.
Usage: samtools addreplacerg [-r rg line | -R rg ID] [-m mode] [-l level] [-o out.bam] <input.bam>
Supported input format: BAM
java -jar picard.jar
Function: Concatenate one or more BAM files as efficiently as possibleThis tool performs a rapid "gather" operation on BAM files after 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 (reassembled) back together.Assumes that the list of BAM files provided as INPUT are in the order that they should be concatenated and simply concatenates the bodies of the BAM files while retaining the header from the first file. Operates via copying of the gzip blocks directly for speed but also supports generation of an MD5 on the output and indexing of the output BAM file. Only supports BAM files, does not support SAM files.
Usage: java -jar picard.jar GatherBamFiles I=input1.bam I=input2.bam O=gathered_files.bam
samtools flagstat
Function: Uses samtools flagstat command to print descriptive information for a BAM dataset.
Usage: samtools flagstat in.sam|in.bam|in.cram
java -jar picard.jar
Function: Renames a sample within a VCF or BCF. This tool enables the user to rename a sample in either a VCF or BCF file. It is intended to change the name of a sample in a VCF prior to merging with VCF files in which one or more samples have similar names. Note that the input VCF file must be single-sample VCF and that the NEW_SAMPLE_NAME is required.
Usage: java -jar picard.jar RenameSampleInVcf I=input.vcf O=renamed.vcf NEW_SAMPLE_NAME=sample123