其他分享
首页 > 其他分享> > 实验记录 | samtools的安装

实验记录 | samtools的安装

作者:互联网

由于canda直接安装samtools执行失败,本次选择手动编译安装最新版的samtools。

1。下载samtools安装包。

官网下载链接:https://github.com/samtools/samtools/releases/tag/1.12
点击蓝色字体链接,下载tar.bz2格式的文件,源文件并不是很全。
下载完成之后,将其保存在指定目录下,打开目录。
解压缩文件夹。
tar -jxvf samtools-1.12.tar.bz2
cd samtools-1.12/

执行configure这一步的时候报错。
./configure

configure: error: ./configure failed for htslib-1.12

缺少hislib-1.12这个文件,需要事先安装。

2。 安装hislib。

git clone https://github.com/samtools/htslib.git
autoheader
autoconf
./configure

执行到编译的那一步的时候,又是报错。

liblzma development files not found

于是,现在着手安装liblzma。

找到链接:https://www.cnblogs.com/liujiaxin2018/p/13691805.html
但是,在ubuntu系统上yim指令是没啥用的,没啥用。

现在尝试apt-get安装。
参考链接:https://www.liangzl.com/get-article-detail-188600.html

sudo apt-get install liblzma-dev
这一步运行成功,没有报错。
make
sudo make install

不知道现在算不算是把hislib安装完成。

3。编译samtools。

安装好上述的hislib文件之后,回到samtools的文件夹下,继续编译。
依次运行以下指令,没有报错。
./configure
make
sudo make install

make/make install 指令在linux中的区别是什么?感觉很像?

注释:

参考链接:https://github.com/samtools/samtools/blob/develop/INSTALL

在任意路径下输入指令,查看是否出现samtools的指令。
samtools

屏幕显示如下:

Program: samtools (Tools for alignments in the SAM format)
Version: 1.12 (using htslib 1.12)

Usage: samtools [options]

Commands:
– Indexing
dict create a sequence dictionary file
faidx index/extract FASTA
fqidx index/extract FASTQ
index index alignment

– Editing
calmd recalculate MD/NM tags and ‘=’ bases
fixmate fix mate information
reheader replace BAM header
targetcut cut fosmid regions (for fosmid pool only)
addreplacerg adds or replaces RG tags
markdup mark duplicates
ampliconclip clip oligos from the end of reads

– File operations
collate shuffle and group alignments by name
cat concatenate BAMs
merge merge sorted alignments
mpileup multi-way pileup
sort sort alignment file
split splits a file by read group
quickcheck quickly check if SAM/BAM/CRAM file appears intact
fastq converts a BAM to a FASTQ
fasta converts a BAM to a FASTA

– Statistics
bedcov read depth per BED region
coverage alignment depth and percent coverage
depth compute the depth
flagstat simple stats
idxstats BAM index stats
phase phase heterozygotes
stats generate stats (former bamcheck)
ampliconstats generate amplicon specific stats

– Viewing
flags explain BAM flags
tview text alignment viewer
view SAM<->BAM<->CRAM conversion
depad convert padded BAM to unpadded BAM

– Misc
help [cmd] display this help message or help for [cmd]
version detailed version information

至此,安装成功。

标签:samtools,1.12,configure,记录,make,BAM,安装
来源: https://blog.csdn.net/weixin_40640700/article/details/116462615