subread依赖zlib,应先配置编译环境,安装相关依赖包。
(https://www.huaweicloud.com/kunpeng/software/Subread.html)
yum install -y zlib-devel
wget -c https://sourceforge.net/projects/subread/files/subread-2.0.0/subread-2.0.0-Linux-x86_64.tar.gz
tar zxvf subread-2.0.0-Linux-x86_64.tar.gz
还需要下载 [subread-2.0.0-source.tar.gz](https://sourceforge.net/projects/subread/files/subread-2.0.0/subread-2.0.0-source.tar.gz/download)
wget -c https://sourceforge.net/projects/subread/files/subread-2.0.0/subread-2.0.0-source.tar.gz/download
进入 [subread-2.0.0-source.tar.gz](https://sourceforge.net/projects/subread/files/subread-2.0.0/subread-2.0.0-source.tar.gz/download)的src文件夹
make -f Makefile.Linux
PS: 如果编译失败, 如下:
(base) lchen@Vostro-5460:~/biosoft/subread-2.0.0-source/src$ make -f Makefile.Linux
gcc -mtune=core2 -O3 -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\""2.0.0"\" -D_FILE_OFFSET_BITS=64 -fmessage-length=0 -ggdb -c -o core.o core.c
In file included from core.c:45:0:
subread.h:26:10: fatal error: zlib.h: 没有那个文件或目录
#include
^~~~~~~~
compilation terminated.
<内置>: recipe for target 'core.o' failed
make: *** [core.o] Error 1
可能是zlib没下载好,Ubuntu用户可用下句来修复
参考: rico-yang
sudo apt-get install zlib1g-dev
继续完成编译
make -f Makefile.Linux
××ubuntu or debian:
安装zlib包并不是apt-get install zlib
而是用
apt-get install zlib1g-dev
此提示为缺少库文件,安装即可××,ubuntu下安装方法:
sudo apt-get install zlib1g-dev libssl-dev
![image.png](https://upload-images.jianshu.io/upload_images/19998777-a341a3c9237a1ca4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
设置环境变量:
将“export PATH=/mnt/d/workplace/biosoft/subread-2.0.1-source/bin:$PATH”写入“/etc/profile”文件最后一行。
nano /etc/profile
export PATH=/mnt/d/workplace/biosoft/subread-2.0.1-source/bin:$PATH
source /etc/profile
运行和验证
查看Subread版本:
subread-align -v
回显如下信息则表示Subread安装成功:
Subread-align v2.0.1
使用
reads比对到参考基因组
第一步:构建索引
subread要求参考基因组的fasta必须要构建索引
subread-buildindex -o hg38 hg38.fa
实例
subread-buildindex -o ~/reference/subread_index/hg38 ~/reference/index/hg38.fa