samtools

Version:
1.x
Identifier: TL_ec2a8d.0b
Tool

Description


A software package with various utilities for processing alignments in the SAM format, including variant calling and alignment viewing.

Subtools

  • samtools quickcheck

    samtools quickcheck [options] in.sam|in.bam|in.cram [ ... ] Quickly check that input files appear to be intact. Checks that beginning of the file contains a valid header (all formats) containing at least one target sequence and then seeks to the end of the file and checks that an end-of-file (EOF) is present and intact (BAM only). Data in the middle of the file is not read since that would be much

  • samtools view

    samtools view [options] in.sam|in.bam|in.cram [region...] With no options or regions specified, prints all alignments in the specified input alignment file (in SAM, BAM, or CRAM format) to standard output in SAM format (with no header by default). You may specify one or more space-separated region specifications after the input filename to restrict output to only those alignments which overlap the

  • samtools idxstats

    samtools idxstats in.sam|in.bam|in.cram Retrieve and print stats in the index file corresponding to the input file. Before calling idxstats, the input BAM file should be indexed by samtools index. If run on a SAM or CRAM file or an unindexed BAM file, this command will still produce the same summary statistics, but does so by reading through the entire file. This is far slower than using the BAM i

  • samtools cat

    samtools cat [-b list] [-h header.sam] [-o out.bam] in1.bam in2.bam [ ... ] Concatenate BAMs or CRAMs. Although this works on either BAM or CRAM, all input files must be the same format as each other. The sequence dictionary of each input file must be identical, although this command does not check this. This command uses a similar trick to reheader which enables fast BAM concatenation.

  • samtools fastq

    samtools fastq [options] in.bam samtools fasta [options] in.bam Converts a BAM or CRAM into either FASTQ or FASTA format depending on the command invoked. The files will be automatically compressed if the file names have a .gz or .bgzf extension. The input to this program must be collated by name. Use samtools collate or samtools sort -n to ensure this.

  • samtools bedcov

    samtools bedcov [options] region.bed in1.sam|in1.bam|in1.cram[...] Reports the total read base count (i.e. the sum of per base read depths) for each genomic region specified in the supplied BED file. The regions are output as they appear in the BED file and are 0-based. Counts for each alignment file supplied are reported in separate columns.

  • samtools view_filter

    Reads with a mapping quality below min-mapping-quality will be excluded

  • samtools depad

    samtools depad [-SsCu1] [-T ref.fa] [-o output] in.bam Converts a BAM aligned against a padded reference to a BAM aligned against the depadded reference. The padded reference may contain verbatim "*" bases in it, but "*" bases are also counted in the reference numbering. This means that a sequence base-call aligned against a reference "*" is considered to be a cigar match ("M" or "X") operator (if

  • samtools faidx

    samtools faidx <ref.fasta> [region1 [...]] Index reference sequence in the FASTA format or extract subsequence from indexed reference sequence. If no region is specified, faidx will index the file and create <ref.fasta>.fai on the disk. If regions are specified, the subsequences will be retrieved and printed to stdout in the FASTA format. The input file can be compressed in the BGZF format. FASTQ

  • samtools sort

    samtools sort [-l level] [-m maxMem] [-o out.bam] [-O format] [-n] [-t tag] [-T tmpprefix] [-@ threads] [in.sam|in.bam|in.cram] Sort alignments by leftmost coordinates, or by read name when -n is used. An appropriate @HD-SO sort order header tag will be added or an existing one updated if necessary. The sorted output is written to standard output by default, or to the specified file (out.bam) when

  • samtools view_sam2bam

    convert sam to bam using samtools view

  • samtools calmd

    samtools calmd [-Eeubr] [-C capQcoef] aln.bam ref.fasta Generate the MD tag. If the MD tag is already present, this command will give a warning if the MD tag generated is different from the existing tag. Output SAM by default. Calmd can also read and write CRAM files although in most cases it is pointless as CRAM recalculates MD and NM tags on the fly. The one exception to this case is where both

  • samtools flagstat

    samtools flagstat in.sam|in.bam|in.cram Does a full pass through the input file to calculate and print statistics to stdout. Provides counts for each of 13 categories based primarily on bit flags in the FLAG field. Each category in the output is broken down into QC pass and QC fail, which is presented as "#PASS + #FAIL" followed by a description of the category.

  • samtools collate

    samtools collate [options] in.sam|in.bam|in.cram [<prefix>] Shuffles and groups reads together by their names. A faster alternative to a full query name sort, collate ensures that reads of the same name are grouped together in contiguous groups, but doesn't make any guarantees about the order of read names between groups. The output from this command should be suitable for any operation that requi

  • samtools fqidx

    samtools fqidx <ref.fastq> [region1 [...]] Index reference sequence in the FASTQ format or extract subsequence from indexed reference sequence. If no region is specified, fqidx will index the file and create <ref.fastq>.fai on the disk. If regions are specified, the subsequences will be retrieved and printed to stdout in the FASTQ format. The input file can be compressed in the BGZF format. samtoo

  • samtools addreplacerg

    samtools addreplacerg [-r rg-line | -R rg-ID] [-m mode] [-l level] [-o out.bam] in.bam Adds or replaces read group tags in a file.

  • samtools merge

    samtools merge [-nur1f] [-h inh.sam] [-t tag] [-R reg] [-b list] out.bam in1.bam [in2.bam in3.bam ... inN.bam] Merge multiple sorted alignment files, producing a single sorted output file that contains all the input records and maintains the existing sort order. If -h is specified the @SQ headers of input files will be merged into the specified header, otherwise they will be merged into a composit

  • samtools bam2fq_interleaved

    Convert BAM to fastq

  • samtools depth

    samtools depth [options] [in1.sam|in1.bam|in1.cram [in2.sam|in2.bam|in2.cram] [...]] Computes the read depth at each position or region.

  • samtools markdup

    samtools markdup [-l length] [-r] [-s] [-T] [-S] in.algsort.bam out.bam Mark duplicate alignments from a coordinate sorted file that has been run through samtools fixmate with the -m option. This program relies on the MC and ms tags that fixmate provides.

  • samtools targetcut

    This command identifies target regions by examining the continuity of read depth, computes haploid consensus sequences of targets and outputs a SAM with each sequence corresponding to a target.

  • samtools split

    samtools split [options] merged.sam|merged.bam|merged.cram Splits a file by read group, producing one or more output files matching a common prefix (by default based on the input filename) each containing one read-group.

  • samtools dict

    samtools dict ref.fasta|ref.fasta.gz Create a sequence dictionary file from a fasta file.

  • samtools fixmate

    samtools fixmate [-rpcm] [-O format] in.nameSrt.bam out.bam Fill in mate coordinates, ISIZE and mate related flags from a name-sorted alignment.

  • samtools reheader

    samtools reheader [-iP] in.header.sam in.bam Replace the header in in.bam with the header in in.header.sam. This command is much faster than replacing the header with a BAM→SAM→BAM conversion. By default this command outputs the BAM or CRAM file to standard output (stdout), but for CRAM format files it has the option to perform an in-place edit, both reading and writing to the same file. No validi

  • samtools mpileup

    samtools mpileup [-EB] [-C capQcoef] [-r reg] [-f in.fa] [-l list] [-Q minBaseQ] [-q minMapQ] in.bam [in2.bam [...]] Generate textual pileup for one or multiple BAM files. For VCF and BCF output, please use the bcftools mpileup command instead. Alignment records are grouped by sample (SM) identifiers in @RG header lines. If sample identifiers are absent, each input file is regarded as one sample.

  • samtools stats

    samtools stats [options] in.sam|in.bam|in.cram [region...] samtools stats collects statistics from BAM files and outputs in a text format. The output can be visualized graphically using plot-bamstats.

  • samtools fasta

    samtools fastq [options] in.bam samtools fasta [options] in.bam Converts a BAM or CRAM into either FASTQ or FASTA format depending on the command invoked. The files will be automatically compressed if the file names have a .gz or .bgzf extension. The input to this program must be collated by name. Use samtools collate or samtools sort -n to ensure this.

  • samtools flags

    samtools flags INT|STR[,...] Convert between textual and numeric flag representation. FLAGS: 0x1 PAIRED paired-end (or multiple-segment) sequencing technology 0x2 PROPER_PAIR each segment properly aligned according to the aligner 0x4 UNMAP segment unmapped 0x8 MUNMAP next segment in the template unmapped 0x10 REVERSE SEQ is reverse complemented 0x20 MREVERSE SEQ of the next segment in the template

  • samtools index

    samtools index [-bc] [-m INT] aln.bam|aln.cram [out.index] Index a coordinate-sorted BAM or CRAM file for fast random access. (Note that this does not work with SAM files even if they are bgzip compressed — to index such files, use tabix(1) instead.) This index is needed when region arguments are used to limit samtools view and similar commands to particular regions of interest. If an output fi

  • samtools phase

    samtools phase [-AF] [-k len] [-b prefix] [-q minLOD] [-Q minBaseQ] in.bam Call and phase heterozygous SNPs.

  • samtools tview

    samtools tview [-p chr:pos] [-s STR] [-d display] <in.sorted.bam> [ref.fasta] Text alignment viewer (based on the ncurses library). In the viewer, press `?' for help and press `g' to check the alignment start from a region in the format like `chr10:10,000,000' or `=10,000,000' when viewing the same reference sequence.