源码的安装一般由3个步骤组成:配置(configure)、编译(make)、安装(make install)。
Configure是一个可执行脚本,它有很多选项,在待安装的源码路径下使用命令./configure –help输出详细的选项列表。
## sratoolkit
## Download and install sratoolkit
## http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software
## http://www.ncbi.nlm.nih.gov/books/NBK158900/
mkdir -p ~/biosoft && cd ~/biosoft
mkdir sratoolkit && cd sratoolkit
wget https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/2.10.8/sratoolkit.2.10.8-ubuntu64.tar.gz
tar xzvf sratoolkit.2.10.8-ubuntu64.tar.gz
echo "export PATH=\$PATH:/home/cqs/biosoft/sratookit/sratoolkit.2.10.8-ubuntu64/bin" >> ~/.bashrc
source ~/.bashrc
fastq-dump -h
# 如果有报错如下:
# This sra toolkit installation has not been configured.
# Before continuing, please run: vdb-config --interactive
# For more information, see https://www.ncbi.nlm.nih.gov/sra/docs/sra-cloud/
# 参考报错信息运行代码后,退出即可
vdb-config --interactive
# *************************************************************************************************************************************
# CMake
# CMake是一个跨平台的编译自动配置工具,它能够输出各种各样的makefile或者project文件,能测试编译器所支持的C++特性,类似UNIX下的automake。
# CMake可以编译源代码、制作程式库、产生适配器(wrapper)、还可以用任意的顺序建构执行档,CMake是一个比make更高级的编译配置工具。
mkdir -p ~/biosoft/mybin
echo "export PATH=\$PATH:/home/cqs/biosoft/mybin/bin" >> ~/.bashrc
source ~/.bashrc
cd ~/biosoft
mkdir cmake-3.3.2 && cd cmake-3.3.2
wget http://cmake.org/files/v3.3/cmake-3.3.2.tar.gz
tar xvfz cmake-3.3.2.tar.gz
cd cmake-3.3.2
# 首次使用编译需要配置gcc,g++
sudo apt-get update
# build-essential这个包会安装上g++,libc6-dev,linux-libc-dev,libstdc++-dev等必须的软件和头文件
sudo apt-get install build-essential
# prefix选项是配置安装的路径,如果不配置该选项,安装后可执行文件默认放在/usr/local/bin,库文件默认放在/usr/local/lib,配置文件默认放在/usr/local/etc,其它的资源文件放在/usr/local/share,较为凌乱
./configure --prefix=/home/cqs/biosoft/mybin
make
make install
# *************************************************************************************************************************************
## samtools
## Download and install samtools
## http://samtools.sourceforge.net/
## http://www.htslib.org/doc/samtools.html
cd ~/biosoft
mkdir samtools && cd samtools
wget https://github.com/samtools/samtools/archive/1.10.tar.gz
tar xzvf 1.10.tar.gz
cd samtools-1.10/
./configure --prefix=/home/cqs/biosoft/mybin
# ./configure报错解决
# bedidx.c:33:10: fatal error: zlib.h: No such file or directory
sudo apt-get install zlib1g-dev
# bam_tview_curses.c:41:10: fatal error: curses.h: No such file or directory
sudo apt-get install libncurses5-dev
# cram/cram_io.c:53:10: fatal error: bzlib.h: No such file or directory
sudo apt-get install libboost-all-dev
sudo apt-get install libbz2-dev
# cram/cram_io.c:57:10: fatal error: lzma.h: No such file or directory
sudo apt-get install liblzma-dev
# hfile_libcurl.c:47:10: fatal error: curl/curl.h: No such file or directory
libcurl4-openssl-dev
# 重新指定路径
./configure --prefix=/home/cqs/biosoft/mybin
make
make install
# echo "export PATH=\$PATH:/home/cqs/biosoft/samtools-1.10/samtools-1.10" >> ~/.bashrc
# source ~/.bashrc
samtools
# *************************************************************************************************************************************
## FastQC
## 主页 https://www.bioinformatics.babraham.ac.uk/projects/download.html#fastqc
# 判断系统是否安装java
java -version
# 安装java
sudo apt install default-jre
# 验证
java -version
cd ~/biosoft
mkdir fastqc_v0.11.9 && cd fastqc_v0.11.9
wget https://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.9.zip
unzip fastqc_v0.11.9.zip
cd FastQC/
chmod u+x fastqc
echo "export PATH=\$PATH:/home/cqs/biosoft/fastQC-0.11.9/FastQC" >> ~/.bashrc
source ~/.bashrc
fastqc -h
# *************************************************************************************************************************************
## multiqc
## 方法一
cd ~/biosoft
mkdir multiqc-1.9 && cd multiqc-1.9
wget https://files.pythonhosted.org/packages/c8/2d/f0a6be15f861c5d165726d7afecd823ca158dff530b566379623a0e4534b/multiqc-1.9.tar.gz
tar zxvf multiqc-1.9.tar.gz
cd multiqc-1.9
python setup.py install
# 报错
# Traceback (most recent call last):
# File "setup.py", line 24, in <module>
# from setuptools import setup, find_packages
# ImportError: No module named setuptools
# python2环境下安装setuptools
sudo apt-get install python-setuptools
# python3环境下安装setuptools
sudo apt-get install python3-setuptools
# 再次执行安装
python setup.py install
-------------------------------------------------------------------------------------
## 方法二
# https://www.runoob.com/w3cnote/python-pip-install-usage.html
cd ~/biosoft
mkdir multiqc-1.9 && cd multiqc-1.9
# -t指定当前安装路径,-i指定清华源
pip install -t ./ -i https://pypi.tuna.tsinghua.edu.cn/simple multiqc
# 接下来就是一连串无法解决的报错了,multiqc不能指定位置安装,尴尬
sudo apt-get update
sudo apt-get install python3-pip
# 默认安装,完美解决
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple multiqc
echo "export PATH=\$PATH:/home/cqs/.local/bin" >> ~/.bashrc
source ~/.bashrc
which multiqc
# *************************************************************************************************************************************
## bcftools
## Download and install bcftools
## http://www.htslib.org/download/
cd ~/biosoft
mkdir bcftools-1.10.2 && cd bcftools-1.10.2
wget https://github.com/samtools/bcftools/releases/download/1.10.2/bcftools-1.10.2.tar.bz2
tar jxvf
cd bcftools-1.10.2/
./configure --prefix=/home/cqs/biosoft/mybin
make
make install
# *************************************************************************************************************************************
## tophat2
# Download and install TopHat
# https://ccb.jhu.edu/software/tophat/index.shtml
cd ~/biosoft
mkdir -p tophat-2.1.1 && cd tophat-2.1.1
#### readme: https://ccb.jhu.edu/software/tophat/manual.shtml
wget http://ccb.jhu.edu/software/tophat/downloads/tophat-2.1.1.Linux_x86_64.tar.gz
tar xzvf tophat-2.1.1.Linux_x86_64.tar.gz
ln -s tophat-2.1.1.Linux_x86_64 current
# *************************************************************************************************************************************
## hisat2
## Download and install HISAT
## https://daehwankimlab.github.io/hisat2/
cd ~/biosoft
mkdir hisat2-2.0.4 && cd hisat2-2.0.4
#### readme: https://ccb.jhu.edu/software/hisat2/manual.shtml
wget https://cloud.biohpc.swmed.edu/index.php/s/4pMgDq4oAF9QCfA/download
unzip hisat2-2.0.4-Linux_x86_64.zip
ln -s hisat2-2.0.4 current
## ~/biosoft/HISAT/current/hisat2-build
## ~/biosoft/HISAT/current/hisat2
# *************************************************************************************************************************************
## HTSeq
cd ~/biosoft
mkdir HTSeq && cd HTSeq
wget https://files.pythonhosted.org/packages/c4/04/b9b0c5514dcd09e64481e8ebc242aef162646b6de956ffb44595d1de0f69/HTSeq-0.12.4.tar.gz
chmod u+x HTSeq-0.12.4.tar.gz
tar zxvf HTSeq-0.12.4.tar.gz
ls
cd HTSeq-0.12.4/
python setup.py install
# 如报错如下:
# symlinking folders for python3
# Setup script for HTSeq: Failed to import 'numpy'.
# Please install numpy and then try again to install HTSeq.
# 解决方案:sudo apt-get install build-essential python2.7-dev python-numpy python-matplotlib
# 如果报错
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple Cython pysam matplotlib HTseq
sudo python setup.py install
# 找到htseq-count位置
which htseq-count
# /usr/local/bin/htseq-count
/usr/local/bin/htseq-count --help
echo "export PATH=\$PATH:/usr/local/bin/htseq-count" >> ~/.bashrc
source ~/.bashrc
htseq-count --help
## ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_mouse/release_M1/
## http://hgdownload-test.cse.ucsc.edu/goldenPath/mm10/liftOver/
## GRCm38/mm10 (Dec, 2011)
## ls *bam |while read id;do ( ~/.local/bin/htseq-count -f bam $id genecode/mm9/gencode.vM1.annotation.gtf.gz 1>${id%%.*}.gene.counts ) ;done
## ls *bam |while read id;do ( ~/.local/bin/htseq-count -f bam -i exon_id $id genecode/mm9/gencode.vM1.annotation.gtf.gz 1>${id%%.*}.exon.counts ) ;done
# *************************************************************************************************************************************
# subread安装
mkdir -p ~/biosoft/subread && cd ~/biosoft/subread
wget https://nchc.dl.sourceforge.net/project/subread/subread-2.0.1/subread-2.0.1-source.tar.gz
tar zxvf subread-2.0.1-source.tar.gz
cd subread-2.0.1-source
# 查看说明书
cat ReadMe.txt
cd src
make -f Makefile.Linux
cd ~/biosoft/subread/subread-2.0.1-source/bin
./featureCounts
echo "export PATH=\$PATH:/home/cqs/biosoft/subread/subread-2.0.1-source/bin" >> ~/.bashrc
source ~/.bashrc
featureCounts
网友评论