生物信息學/samtools

使用SAMTOOLS操作SAM文件 編輯

Samtools簡介 編輯

Samtools (http://www.htslib.org/)是一個用於操作sam和bam文件的工具合集。新 版本(>=1.0版本)主要包含Samtools、BCFtools和HTSlib三個部分。新版的samtools 將Samtools和BCFtool分離開,成為2個獨立的軟件包。這2個都運用了 HTSlib, 並且其軟件包中都包含了 HTSlib。這三部分的的功能分別為:

Samtools:
	对SAM/BAM/CRAM格式文件进行读、写、索引和查看操作。
BCFtools:
	对 SNP 和 short indel 进行calling/filtering/sunimarising,对BCF2/VCF/gVCF 格式文件进行读 写操作。
HTSlib:
	用于高通量数据读写操作的C library。

Samtools的下載和安裝 編輯

Samtools是Linux下進行SAM文件操作的工具。它還有很多其它有版本:比如C++ 版本的 BamTools; Java 版本的 Picard;Perl 版本的 Bio-SamTools; Python 版本的 Pysam等。

Samtools的安裝如下:

wget https://github.com/samtools/samtools/releases/download/1.2/samtools-1.2.tar.bz2 -P ~/software/
tar jxf ~/software/samtools-1.2.tar.bz2 -C /opt/biosoft/
cd /opt/biosoft/samtools-1.2/
./configure --prefix=/opt/biosoft/samtools-1.2/
make
echo 'PATH=$PATH:/opt/biosoft/samtools-1.2/bin/' >> ~/.bashrc
source ~/.bashrc

# installing samtools and bcftools
#wget https://github.com/samtools/bcftools/releases/download/1.3.1/bcftools-1.3.1.tar.bz2 -P ~/software/
tar jxf ~/software/bcftools-1.3.1.tar.bz2 -C /opt/biosoft/
cd /opt/biosoft/bcftools-1.3.1
make -j 4
echo 'PATH=$PATH:/opt/biosoft/bcftools-1.3.1/' >> ~/.bashrc
source ~/.bashrc