-
Notifications
You must be signed in to change notification settings - Fork 0
/
bioinformatics.Rmd
139 lines (95 loc) · 5.89 KB
/
bioinformatics.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# 生物信息 {#bioinfo}
## 微生物组 {#microbiome}
##### 1. Ubuntu 20.04 安装 qiime1 {-}
直接按文档中所说 `conda create -n qiime1 python=2.7 qiime matplotlib=1.4.3 mock
nose -c bioconda` 出现错误 PackagesNotFoundError matplotlib=1.4.3
解决办法是创建新的 conda 环境 `qiime1`, `conda create -n qiime1 python=2.7`, 然后用 pip 手动安装 matplotlib 及其他的 python 模块
```
# 1 安装matplotlib==1.4.3的时候,出现错误 "The following required packages can
# not be built: * freetype", pip 不能安装系统依赖,手动安装系统依赖后然后安装
sudo apt-get install libfreetype6-dev libxft-dev
pip install matplotlib==1.4.3
# 2 qiime中要求biom-format>=2.1.4,<2.2.0,但是目前版本不支持python 2.7
# 手动安装2.1.4版本
pip install biom-format==2.1.4
# 3 最后安装qiime
pip install qiime
# 检测安装是否成功
print_qiime_config.py -t
```
pick otu 或者 嵌合体识别 (chimera) 可用 usearch61 方法, 安装 usearch步骤为
[下载](https://drive5.com/downloads/usearch6.1.544_i86linux32.gz)解压后,
拷贝到 `/usr/local/bin/` 然后赋予执行权限:
```sh
sudo mv usearch* /usr/local/bin/usearch61
# 添加权限
chmod a+x /usr/local/bin/usearch61
```
##### 2. ubuntu 20.04 安装 picrust1 {-}
按照文档中说的`conda create -n picrust1 -c bioconda -c conda-forge picrust`
安装出现错误 `failed with repodata from current_repodata.json`。
只使用 `bioconda`可正常安装, `conda create -n picrust1 -c bioconda picrust`.
##### 3. mac安装 lefse {-}
通过homebrew安装lefse已经[不再维护](https://github.com/biobakery/homebrew-biobakery/issues/37)`brew install biobakery/biobakery/lefse`;采用conda安装(目前biobakery下的软件都用[conda源安装](https://bitbucket.org/biobakery/biobakery/wiki/biobakery_advanced#rst-header-installing-individual-biobakery-tools))
```sh
conda config --add channels biobakery
conda install -c biobakery lefse
```
##### 4. Q: 本地测试qiime1脚本时,安装完依赖后,运行脚本,pycharm 导入 matplotlib.pyplot 出现错误 `from urllib.parse import urlencode ImportError: No module named parse` {-}
pycharm中设置 `Preferences -> Tools -> Python Scientific`取消勾选`Show plots in tool window`,答案见[此](https://stackoverflow.com/questions/57267016/pycharm-import-matplotlib-pyplot-show-error)
##### 5. Q: phyloseq 中 `distance()` 或 `ordinate()` (调用 `distance()`) 基于树计算距离的时候(如 `unifrac`), 出现 `Warning message: In matrix(tree$edge[order(tree$edge[, 1]), ][, 2], byrow = TRUE, : data length [86515] is not a sub-multiple or multiple of the number of rows [43258]`
原因是因为对 OTU 进行质控的时候 (如删除丰度较低的 OTU),原因是
树不是二分树,解决办法是转化为二分树。参考[这里](https://github.com/joey711/phyloseq/issues/936#issuecomment-569000555)
```r
new_tre <- ape::multi2di(phy_tree(ps))
phy_tree(ps) <- new_tre
```
## scRNA-seq
- 安装[velocyto.R](https://github.com/velocyto-team/velocyto.R).
- `clang: error: unsupported option '-fopenmp'`
mac下clang不支持openmp,解决方法参考[此处](https://github.com/BUStools/BUSpaRse),安装支持openmp的[clang](https://cran.r-project.org/bin/macosx/tools/). 然后修改配置文件,在`~/.R/Makevars`(配置compliers和library),添加
```
CC=/usr/local/clang7/bin/clang
SHLIB_CXXLD=/usr/local/clang7/bin/clang++
CXX= /usr/local/clang7/bin/clang++ -Wall
CXX1X= /usr/local/clang7/bin/clang++
CXX98= /usr/local/clang7/bin/clang++
CXX11= /usr/local/clang7/bin/clang++
CXX14= /usr/local/clang7/bin/clang++
CXX17= /usr/local/clang7/bin/clang++
LDFLAGS=-L/usr/local/clang7/lib
```
- `library not found for -lboost_filesystem`
安装 boost `brew install boost`
- `library not found for -lgfortran`
gfortran包含在gcc中,但是电脑中gcc是通过homebrew安装,原始配置文件`/Library/Frameworks/R.framework/Resources/etc/Makeconf`中并没有更新库的地址,在`~/.R/Makevars`中手动添加即可
```
# 通过homebrew安装的gcc地址
FLIBS = -L/usr/local/lib/gcc/8/gcc/x86_64-apple-darwin17.5.0/8.1.0 -L/usr/local/lib/gcc/8 -lgfortran -lquadmath -lm
# Library/Frameworks/R.framework/Resources/etc/Makeconf中的原始配置
# FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
```
- 安装[`velocyto.py`](https://github.com/velocyto-team/velocyto.py)
mac 在 pip 安装的时候gcc编译出现错误,建议使用conda安装`conda install velocyto.py`
## RNA structure
本节记录在 RNA 结构生物信息学分析中的一些问题,如 RNA 二级结构预测。
### 软件安装
#### 二级结构预测 {-}
- [CONTRAfold](http://contra.stanford.edu/contrafold/download.html), 按照帮助
手册`make`的时候出现错误
```
LBFGS.ipp:110:33: error: ‘DoLineSearch’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Real step = DoLineSearch(x[k%2], f[k%2], g[k%2], d,
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
x[(k+1)%2], f[(k+1)%2], g[(k+1)%2],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Real(0), std::min(Real(10), MAX_STEP_NORM / std::max(Real(1), Norm(d))));
```
解决办法(见[这里](https://github.com/zavolanlab/snoRNAHybridSearchPipeline/blob/master/doics/installation.rst)):
1. Makefile中添加 `-fpermissive` 选项至 `CSXXFLAGS`:
```
CXXFLAGS = -O3 -DNDEBUG -W -pipe -Wundef -Winline --param large-function-growth=100000 -Wall -fpermissive
# 替换
CXXFLAGS = -O3 -DNDEBUG -W -pipe -Wundef -Winline --param large-function-growth=100000 -Wall
```
2. `Utilities.hpp`中添加`#include <limits.h>`