[2022-9-18]iCLIP-seq Analysis 配置分析环境

最近为了RNA-seq和iCLIP-seq的分析任务,靠朋友关系找了一个私有服务器,只能开个普通账号,系统是CentOS 8,一切都要苦逼的重新配置。

以下记录我配置环境的全过程

1. 打开服务器上的linux系统,登陆非根用户账号,默认进入"home/username/"目录下;

2. 安装miniconda:

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh
bash Miniconda3-py39_4.12.0-Linux-x86_64.sh         

在此选择最新的Linux版本自行更换下载链接

3. 配置conda虚拟环境并配置:

conda create -n iclipseq python=3.6
conda info --envs #查看是否安装成功
conda config --set auto_activate_base false #不要每次打开终端默认进入conda的base环境

重新打开终端,激活虚拟环境

conda activate iclipseq

4. Install FastQC 用于数据质量控制

conda install -c bioconda fastqc

5. Install Fastx-toolkit 用于文件格式转换

官网地址可复制最新的下载链接,自行更换即可

wget http://hannonlab.cshl.edu/fastx_toolkit/fastx_toolkit_0.0.13_binaries_Linux_2.6_amd64.tar.bz2

6. 安装 seqtk

Seqtk is a fast and lightweight tool for processing sequences in the FASTA or FASTQ format. It seamlessly parses both FASTA and FASTQ files which can also be optionally compressed by gzip.
需要使用git工具下载安装seqtk,点此处进入git官网下载页

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz

然后下载的二进制源码需要自行编译并安装
以Centos的操作为例:tar xvzf filename解压

tar xvzf git-2.9.5.tar.gz

PS:如果是filename.tar.bz2格式的,应该是tar jxvf filename.tar.bz2来解压。
然后进入解压文件目录进行编译安装:

cd git-2.9.5.tar.gz
./configure  #检查编译环境是否可用并执行编译,不加参数默认安装到=/usr/local/apache ,指定安装位置./configure --prefix=/flodername/git 

然后执行安装并清理临时文件

make check
make install

执行时报错

install: cannot change permissions of ‘/usr/local/share/qemu’: No such file or directory

意思是需要root权限来执行make代码,

sudo make install

但是当前用户是普通用户(大多数情况下用学校或别人的服务器都是这样,不会默认给你root权限),因此需要用root账户或者联系服务器管理员给当前账户授权。
授权方法:
登陆root账户后,找到etc/sudoers文件,使用vim打开,找到:

## Allow root to run any commands anywhere
root   ALL=(ALL)     ALL
username       ALL=(ALL)       ALL #用你自己的用户名添加这一行

退出时出现’readonly’ option is set (add ! to override)的问题,直接 :wq! 强制保存退出。
完成后使用被授权的账户重新登陆并重新进入解压文件目录,执行

sudo make install
make clean   #删除临时文件
make distclean    #删除临时文件
# 将git安装路径加入环境变量
$ PATH=$PATH:/usr/libexec/git-core

然后就可以用git来安装seqtk了

git clone https://github.com/lh3/seqtk.git;
cd seqtk; make

执行时若报错,

# git clone: fatal: Unable to find remote helper for 'https'
# 临时用git代替https试一下,解决了
git clone git://github.com/lh3/seqtk.git;
cd seqtk; make

其实这个问题是由于PATH中没有添加git-core的绝对路径,
检查一下,没有则加上:

echo $PATH
export PATH=$PATH:/home/kainsl/git/libexec/git-core #换成自己的路径

PS:这仅仅是临时添加,终端重启后会失效,要实现永久修改需要编辑etc/profile文件后source一下使其生效。

[kainsl@iZ2ze4izsljt019aqczr6pZ seqtk]$
#出现这个,安装成功

7.安装Flexbar

flexible barcode and adapter removal

---The program Flexbar preprocesses high-throughput sequencing data efficiently.
---It demultiplexes barcoded runs and removes adapter sequences.
release page获取linux下的源码文件,注意要下载Source code源码文件

安装说明

Make sure that cmake is available, as well as development and runtime files of the TBB library 4.0 or later (Intel Threading Building Blocks). For example on Debian systems, install the packages libtbb-dev and libtbb2. Furthermore, the SeqAn library and a compiler that supports C++14 is required.

首先需要安装依赖的cmake、tbb、SeqAn等库

7.1. 要求预先安装cmake

CMake is an open-source, cross-platform family of tools designed to build, test and package software.

这里直接下载其安装包的shell脚本文件并执行

wget https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2-linux-x86_64.sh
bash cmake-3.24.2-linux-x86_64.sh
#一路y确认

需要配置一下环境变量
vim ~/.bash_profile 修改文件中 最后添加一行,PATH=$PATH:/usr/local/cmake_version/bin
保存文件并退出,执行 source ~/.bash_profile 使其生效,这种方法只对当前登陆用户生效。

7.2. 接下来从其github发布页面复制clone的url,使用git来安装TBB,配置说明参考github上官方说明

git clone https://github.com/oneapi-src/oneTBB.git
cd oneTBB
# Create binary directory for out-of-source build
mkdir build && cd build
# Configure: customize CMAKE_INSTALL_PREFIX and disable TBB_TEST to avoid tests build
cmake -DCMAKE_INSTALL_PREFIX=/tmp/my_installed_onetbb -DTBB_TEST=OFF ..
# Build
cmake --build .
# Install
cmake --install .
# Well done! Your installed oneTBB is in /tmp/my_installed_onetbb

7.3 接下来下载安装flexbar,下载地址

git clone https://github.com/seqan/flexbar
cd flexbar-3.5.0
cmake .
make. #这一步报错,估计是依赖包版本不兼容

conda install -c bioconda flexbar # 使用conda的安装也提示冲突

暂时还没找到解决办法,先这样吧

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容