Difference between revisions of "Applications/Samtools"

From HPC
Jump to: navigation , search
m
m
Line 29: Line 29:
 
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 
<pre style="background-color: #000000; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 
[username@login01 ~]$  samtools view -S -b -t ex1.fa.fai -o ex1.bam ex1.sam.gz
 
[username@login01 ~]$  samtools view -S -b -t ex1.fa.fai -o ex1.bam ex1.sam.gz
 +
</pre>
  
 
Build an index for the BAM file:
 
Build an index for the BAM file:

Revision as of 11:57, 24 March 2017

Application Details

  • Description: The OBITools package is a set of programs specifically designed for analysing NGS data in a DNA meta-barcoding context, taking into account taxonomic information
  • Version: 1.3.1.
  • Module: module samtools/gcc/1.3.1.
  • Licence: BSD License, MIT License

Usage Areas

Samtools is a suite of programs for interacting with high-throughput sequencing data. It consists of three separate repositories:

  • Samtools - Reading/writing/editing/indexing/viewing SAM/BAM/CRAM format
  • BCFtools - Reading/writing BCF2/VCF/gVCF files and calling/filtering/summarising SNP and short indel sequence variants
  • HTSlib - A C library for reading/writing high-throughput sequencing data

Usage Examples

Some usage examples of Samtools are listed below:

Index the reference FASTA.

[username@login01 ~]$  samtools faidx ex1.fa

Convert the (headerless) SAM file to BAM. Note if we had used "samtools view -h" above to create the ex1.sam.gz then we could omit the "-t ex1.fa.fai" option here.

[username@login01 ~]$  samtools view -S -b -t ex1.fa.fai -o ex1.bam ex1.sam.gz

Build an index for the BAM file:

[username@login01 ~]$  samtools index ex1.bam

View a portion of the BAM file:

[username@login01 ~]$  samtools view ex1.bam seq2:450-550

Visually inspect the alignments at the same location:

[username@login01 ~]$  samtools tview -p seq2:450 ex1.bam ex1.fa

View the data in pileup format:

[username@login01 ~]$  samtools mpileup -f ex1.fa ex1.bam

Generate an uncompressed VCF file of variants:

[username@login01 ~]$  samtools mpileup -vu -f ex1.fa ex1.bam > ex1.vcf

Generate a compressed VCF file of variants:

[username@login01 ~]$ samtools mpileup -g -f ex1.fa ex1.bam > ex1.bcf


Module

[username@login01 ~]$ module samtools/gcc/1.3.1.


Further Information

http://www.htslib.org/