Sam/Bam Manipulation

bamCoverage
Function: This tool generates a bigWig or bedGraph file of fragment or read coverages.
Usage: bamCoverage [options] -b reads.bam -o coverage.bw
Supported input format: BAM
bamToBed
Function: bedtools bamtobed is a conversion utility that converts sequence alignments in BAM format into BED, BED12, and/or BEDPE records.
Usage: bamToBed [OPTIONS] -i <BAM>
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]
samtools view
Function: View, convert format, or filter (with different criteria) alignments.
Usage: samtools view [options] in.sam|in.bam|in.cram [region...]
Supported input format: BAM, CRAM, SAM
samtools merge
Function: Merge multiple sorted alignment files, producing a single sorted output file that contains all the input records and maintains the existing sort order.
Usage: samtools merge [options] out.bam in1.bam ... inN.bam
Supported input format: BAM
bam2wig.py
Function: Convert BAM file into wig/bigWig format.
Usage: bam2wig.py -s chrom.sizes -i sample.bam -o out [options]
java -jar picard.jar
Function: Validates a SAM or BAM file.
Usage: java -jar picard.jar ValidateSamFile I=input.bam MODE=SUMMARY
bedtools bamtofastq
Function: Extract FASTQ records from sequence alignments in BAM format.
Usage: bedtools bamtofastq [OPTIONS] -i <BAM> -fq <FASTQ>
Supported input format: BAM
bedtools bamtobed
Function: Convert sequence alignments in BAM format into BED, BED12, and/or BEDPE records
Usage: bedtools bamtobed [OPTIONS] -i <BAM>
Supported input format: BAM
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
samtools stats
Function: samtools stats collects statistics from BAM files and outputs in a text format. The output can be visualized graphically using plot-bamstats.
Usage: samtools stats [options] in.sam|in.bam|in.cram [region...]
Supported input format: BAM, CRAM, SAM
bamtools
Function: 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>.
Usage: bamtools split -in input_alignments.bam -mapped
samtools sort
Function: Converts SAM dataset into its binary, BAM.
Usage: samtools sort -O bam -o sorted_input.bam [INPUT SAM]
java -jar picard.jar
Function: Provides a large, configurable, FIFO buffer that can be used to buffer input and output streams between programs with a buffer size that is larger than that offered by native unix FIFOs (usually 64k).
Usage: java -jar picard.jar FifoBuffer
java -jar picard.jar
Function: Applies one or more hard filters to a VCF file to filter out genotypes and variants.
Usage: java -jar picard.jar FilterVcf