实验记录 | 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中的区别是什么?感觉很像?

注释:

  • make:make 是 Linux 开发套件里面自动化编译的一个控制程序,他通过借助 Makefile 里面编写的编译规范进行自动化的调用 gcc 、ld 以及运行某些需要的程序进行编译的程序。
  • make install:进行安装的指令,需要root权限(即 sudo make install)。

参考链接: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

至此,安装成功。

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值