一、环境
linux-ubuntu
anaconda3/miniconda
二、实操演示
1.conda是安装QIIME2的首选工具,但是很多国内的朋友苦于无法链接网络问题导致无法安装。
该教程的精髓放在开头:conda安装qiime2出问题,国内网友的普遍问题是.yml文件中的镜像源没修改对,目前网上的大部分教程只修改了conda-forge和bioconda的镜像源,却没有更换qiime2镜像源,这里给大家介绍一下,qiime2也是存在镜像源的,它便是来自清华的镜像源,只要将他们的镜像源都进行更换,则可以轻松解决conda安装qiime2的问题。
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/qiime2
网上的教程各种各样,但真正有效的几乎没有,像删除q2后续再单独下载的方法无法解决环境依赖的问题,也十分繁琐,令人生厌。这里我将以最新版的qiime2-2021.11为例子来向大家演示如何使用conda成功对qiime2-2021.11进行安装。(步骤与QIIME2官网教程类似,但结合国内无法翻墙下载的普遍情况)
1.1 运行如下代码下载.yml文件
wget https://data.qiime2.org/distro/core/qiime2-2021.11-py38-linux-conda.yml
很多人这一步就进行不下去,显示与下图类似的网络报错问题,那么继续往下看,相信你的问题一定会得到解决。
如果你的问题是可以下载.yml文档但是仍无法用conda安装qiime2,请转至1.5部分,相信你的问题一定会得到解决。
为了辅助大家理解,这里我说一下,上面的这条wget命令本质上只是从QIIME2官网下载.yml格式的一个安装包的目录,以方便我们下一条conda命令去下载安装.yml文件中罗列的包,大部分我们运行这条命令报错的原因都是无法访问外网,链接无效,你们可以把网址复制到浏览器验证一下,大概率是打不开页面的。这时候我们其实也不需要翻墙去科学上网,只需要手动下载这个.yml文件然后把它放到我们Ubuntu系统对应的工作目录中即可。这里我把最新版的.yml放在文末附录部分,大家可以粘贴到文本文档然后把.txt后缀改为.yml放到你的Ubuntu系统对应的目录中即可接着往下进行。
1.2 .yml文件放置到对应位置后,执行下面的命令开始安装QIIME2环境。
友情提醒:请先保证自己有足够的内存和良好的网络,安装所需要的时间由电脑配置与网速共同决定
conda env create -n qiime2-2021.11 --file qiime2-2021.11-py38-linux-conda.yml
输入命令后,出现如下图所示信息,则恭喜你,等待安装成功即可
1.3最后运行代码,删了这个.yml文件即可
rm qiime2-2021.11-py38-linux-conda.yml
1.4 激活qiime2并查看帮助文档以验证是否安装成功
conda activate qiime2-2021.11
qiime --help
1.5 修改你下载好的.yml文件的镜像源
具体操作如下
将.yml文件打开后修改channels部分
原内容
channels:
- qiime2/label/r2021.11
- conda-forge
- bioconda
- defaults
修改为:
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/qiime2
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
- defaults
再次运行如下命令即可
conda env create -n qiime2-2021.11 --file qiime2-2021.11-py38-linux-conda.yml
如果大家觉得有用,欢迎大家点赞并关注我,我是R语言_茶味先生,后续我会更新更多关于qiime2的心得体会,欢迎大家交流讨论。原创不易,引用请注明出处,谢谢!
三、附录
2021.11版本的.yml 文件内容
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/qiime2
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
- defaults
dependencies:
- _libgcc_mutex=0.1
- _openmp_mutex=4.5
- _r-mutex=1.0.1
- alsa-lib=1.2.3
- argcomplete=1.12.3
- argon2-cffi=21.1.0
- async_generator=1.10
- attrs=21.2.0
- backcall=0.2.0
- backports=1.0
- backports.functools_lru_cache=1.6.4
- bibtexparser=1.1.0
- binutils_impl_linux-64=2.36.1
- binutils_linux-64=2.36
- bioconductor-biobase=2.50.0
- bioconductor-biocgenerics=0.36.0
- bioconductor-biocparallel=1.24.1
- bioconductor-biostrings=2.58.0
- bioconductor-dada2=1.18.0
- bioconductor-delayedarray=0.16.3
- bioconductor-genomeinfodb=1.26.4
- bioconductor-genomeinfodbdata=1.2.4
- bioconductor-genomicalignments=1.26.0
- bioconductor-genomicranges=1.42.0
- bioconductor-iranges=2.24.1
- bioconductor-matrixgenerics=1.2.1
- bioconductor-rhtslib=1.22.0
- bioconductor-rsamtools=2.6.0
- bioconductor-s4vectors=0.28.1
- bioconductor-shortread=1.48.0
- bioconductor-summarizedexperiment=1.20.0
- bioconductor-xvector=0.30.0
- bioconductor-zlibbioc=1.36.0
- biom-format=2.1.10
- blast=2.12.0
- bleach=4.1.0
- bokeh=2.4.2
- bowtie2=2.4.2
- brotli=1.0.9
- brotli-bin=1.0.9
- brotlipy=0.7.0
- bwidget=1.9.14
- bzip2=1.0.8
- c-ares=1.18.1
- ca-certificates=2021.10.8
- cachecontrol=0.12.10
- cached-property=1.5.2
- cached_property=1.5.2
- cairo=1.16.0
- certifi=2021.10.8
- cffi=1.15.0
- chardet=4.0.0
- click=7.1.2
- colorama=0.4.4
- cryptography=35.0.0
- curl=7.80.0
- cutadapt=3.5
- cycler=0.11.0
- cython=0.29.24
- dbus=1.13.6
- deblur=1.1.0
- debugpy=1.5.1
- decorator=4.4.2
- defusedxml=0.7.1
- dendropy=4.5.2
- dill=0.3.4
- dnaio=0.6.0
- emperor=1.0.3
- entrez-direct=16.2
- entrypoints=0.3
- expat=2.4.1
- fastcluster=1.1.26
- fasttree=2.1.10
- font-ttf-dejavu-sans-mono=2.37
- font-ttf-inconsolata=3.000
- font-ttf-source-code-pro=2.038
- font-ttf-ubuntu=0.83
- fontconfig=2.13.1
- fonts-conda-ecosystem=1
- fonts-conda-forge=1
- fonttools=4.28.1
- freetype=2.10.4
- fribidi=1.0.10
- future=0.18.2
- gcc_impl_linux-64=9.4.0
- gcc_linux-64=9.4.0
- gettext=0.19.8.1
- gfortran_impl_linux-64=9.4.0
- gfortran_linux-64=9.4.0
- glib=2.70.1
- glib-tools=2.70.1
- gneiss=0.4.6
- graphite2=1.3.13
- gsl=2.7
- gst-plugins-base=1.18.5
- gstreamer=1.18.5
- gxx_impl_linux-64=9.4.0
- gxx_linux-64=9.4.0
- h5py=3.3.0
- harfbuzz=3.1.1
- hdf5=1.10.6
- hdmedians=0.14.2
- hmmer=3.1b2
- htslib=1.14
- icu=68.2
- idna=2.10
- ijson=3.1.3
- importlib-metadata=4.8.2
- importlib_metadata=4.8.2
- importlib_resources=5.4.0
- iniconfig=1.1.1
- ipykernel=6.5.0
- ipython=7.29.0
- ipython_genutils=0.2.0
- ipywidgets=7.6.5
- iqtree=2.1.4_beta
- isa-l=2.30.0
- jbig=2.1
- jedi=0.18.1
- jinja2=3.0.3
- joblib=1.1.0
- jpeg=9d
- jq=1.6
- jsonschema=4.2.1
- jupyter_client=7.1.0
- jupyter_core=4.9.1
- jupyterlab_pygments=0.1.2
- jupyterlab_widgets=1.0.2
- kernel-headers_linux-64=2.6.32
- kiwisolver=1.3.2
- krb5=1.19.2
- lcms2=2.12
- ld_impl_linux-64=2.36.1
- lerc=2.2.1
- libblas=3.9.0
- libbrotlicommon=1.0.9
- libbrotlidec=1.0.9
- libbrotlienc=1.0.9
- libcblas=3.9.0
- libclang=11.1.0
- libcurl=7.80.0
- libdeflate=1.7
- libedit=3.1.20191231
- libev=4.33
- libevent=2.1.10
- libffi=3.4.2
- libgcc=7.2.0
- libgcc-devel_linux-64=9.4.0
- libgcc-ng=11.2.0
- libgfortran-ng=11.2.0
- libgfortran5=11.2.0
- libglib=2.70.1
- libgomp=11.2.0
- libiconv=1.16
- liblapack=3.9.0
- libllvm10=10.0.1
- libllvm11=11.1.0
- libnghttp2=1.43.0
- libnsl=2.0.0
- libogg=1.3.4
- libopenblas=0.3.18
- libopus=1.3.1
- libpng=1.6.37
- libpq=13.5
- libsanitizer=9.4.0
- libsodium=1.0.18
- libssh2=1.10.0
- libstdcxx-devel_linux-64=9.4.0
- libstdcxx-ng=11.2.0
- libtiff=4.3.0
- libuuid=2.32.1
- libuv=1.42.0
- libvorbis=1.3.7
- libwebp-base=1.2.1
- libxcb=1.13
- libxkbcommon=1.0.3
- libxml2=2.9.12
- libxslt=1.1.33
- libzlib=1.2.11
- llvmlite=0.36.0
- lockfile=0.12.2
- lxml=4.6.4
- lz4=3.1.3
- lz4-c=1.9.3
- mafft=7.490
- make=4.3
- markupsafe=2.0.1
- matplotlib=3.5.0
- matplotlib-base=3.5.0
- matplotlib-inline=0.1.3
- mistune=0.8.4
- more-itertools=8.11.0
- msgpack-python=1.0.2
- munkres=1.1.4
- mysql-common=8.0.27
- mysql-libs=8.0.27
- natsort=8.0.0
- nbclient=0.5.9
- nbconvert=6.3.0
- nbformat=5.1.3
- ncurses=6.2
- nest-asyncio=1.5.1
- networkx=2.6.3
- nodejs=16.12.0
- nose=1.3.7
- notebook=6.4.6
- nspr=4.32
- nss=3.72
- numba=0.53.1
- numpy=1.21.4
- olefile=0.46
- oniguruma=6.9.7.1
- openjdk=11.0.1
- openjpeg=2.4.0
- openssl=1.1.1l
- packaging=21.3
- pandas=1.2.5
- pandoc=2.16.2
- pandocfilters=1.5.0
- pango=1.48.10
- parso=0.8.2
- patsy=0.5.2
- pbzip2=1.1.13
- pcre=8.45
- pcre2=10.37
- perl=5.26.2
- perl-archive-tar=2.18
- perl-carp=1.38
- perl-common-sense=3.74
- perl-compress-raw-bzip2=2.087
- perl-compress-raw-zlib=2.087
- perl-exporter=5.72
- perl-exporter-tiny=1.002001
- perl-extutils-makemaker=7.36
- perl-io-compress=2.087
- perl-io-zlib=1.10
- perl-json=4.02
- perl-json-xs=2.34
- perl-list-moreutils=0.413
- perl-pathtools=3.75
- perl-scalar-list-utils=1.52
- perl-threaded=5.26.0
- perl-types-serialiser=1.0
- pexpect=4.8.0
- pickleshare=0.7.5
- pigz=2.6
- pillow=8.4.0
- pip=21.3.1
- pixman=0.40.0
- pluggy=1.0.0
- prometheus_client=0.12.0
- prompt-toolkit=3.0.22
- psutil=5.8.0
- pthread-stubs=0.4
- ptyprocess=0.7.0
- py=1.11.0
- pycparser=2.21
- pygments=2.10.0
- pynndescent=0.5.5
- pyopenssl=21.0.0
- pyparsing=3.0.6
- pyqt=5.12.3
- pyqt-impl=5.12.3
- pyqt5-sip=4.19.18
- pyqtchart=5.12
- pyqtwebengine=5.12.1
- pyrsistent=0.18.0
- pysocks=1.7.1
- pytest=6.2.5
- python=3.8.12
- python-dateutil=2.8.2
- python-isal=0.11.1
- python_abi=3.8
- pytz=2021.3
- pyyaml=6.0
- pyzmq=22.3.0
- q2-alignment=2021.11.0
- q2-composition=2021.11.0
- q2-cutadapt=2021.11.0
- q2-dada2=2021.11.0
- q2-deblur=2021.11.0
- q2-demux=2021.11.0
- q2-diversity=2021.11.0
- q2-diversity-lib=2021.11.0
- q2-emperor=2021.11.0
- q2-feature-classifier=2021.11.0
- q2-feature-table=2021.11.0
- q2-fragment-insertion=2021.11.0
- q2-gneiss=2021.11.0
- q2-longitudinal=2021.11.0
- q2-metadata=2021.11.0
- q2-mystery-stew=2021.11.0
- q2-phylogeny=2021.11.0
- q2-quality-control=2021.11.0
- q2-quality-filter=2021.11.0
- q2-sample-classifier=2021.11.0
- q2-taxa=2021.11.0
- q2-types=2021.11.0
- q2-vsearch=2021.11.0
- q2cli=2021.11.0
- q2galaxy=2021.11.0
- q2templates=2021.11.0
- qiime2=2021.11.0
- qt=5.12.9
- r-assertthat=0.2.1
- r-backports=1.3.0
- r-base=4.0.5
- r-bh=1.75.0_0
- r-bitops=1.0_7
- r-brio=1.1.2
- r-callr=3.7.0
- r-cli=3.1.0
- r-cluster=2.1.2
- r-colorspace=2.0_2
- r-crayon=1.4.2
- r-desc=1.4.0
- r-diffobj=0.3.5
- r-digest=0.6.28
- r-ellipsis=0.3.2
- r-evaluate=0.14
- r-fansi=0.5.0
- r-farver=2.1.0
- r-formatr=1.11
- r-futile.logger=1.4.3
- r-futile.options=1.0.1
- r-ggplot2=3.3.5
- r-glue=1.5.0
- r-gtable=0.3.0
- r-hwriter=1.3.2
- r-isoband=0.2.5
- r-jpeg=0.1_9
- r-jsonlite=1.7.2
- r-labeling=0.4.2
- r-lambda.r=1.2.4
- r-lattice=0.20_45
- r-latticeextra=0.6_29
- r-lifecycle=1.0.1
- r-magrittr=2.0.1
- r-mass=7.3_54
- r-matrix=1.3_2
- r-matrixstats=0.61.0
- r-mgcv=1.8_38
- r-munsell=0.5.0
- r-nlme=3.1_153
- r-permute=0.9_5
- r-pillar=1.6.4
- r-pkgconfig=2.0.3
- r-pkgload=1.2.3
- r-plyr=1.8.6
- r-png=0.1_7
- r-praise=1.0.0
- r-processx=3.5.2
- r-ps=1.6.0
- r-r6=2.5.1
- r-rcolorbrewer=1.1_2
- r-rcpp=1.0.7
- r-rcppparallel=5.1.4
- r-rcurl=1.98_1.5
- r-rematch2=2.1.2
- r-reshape2=1.4.4
- r-rlang=0.4.12
- r-rprojroot=2.0.2
- r-rstudioapi=0.13
- r-scales=1.1.1
- r-snow=0.4_4
- r-stringi=1.7.5
- r-stringr=1.4.0
- r-testthat=3.1.0
- r-tibble=3.1.6
- r-utf8=1.2.2
- r-vctrs=0.3.8
- r-vegan=2.5_7
- r-viridislite=0.4.0
- r-waldo=0.3.1
- r-withr=2.4.2
- raxml=8.2.12
- readline=8.1
- requests=2.25.1
- samtools=1.14
- scikit-bio=0.5.6
- scikit-learn=0.24.1
- scipy=1.7.2
- seaborn=0.11.2
- seaborn-base=0.11.2
- sed=4.8
- send2trash=1.8.0
- sepp=4.3.10
- setuptools=59.2.0
- six=1.16.0
- sortmerna=2.0
- sqlite=3.36.0
- statsmodels=0.13.1
- sysroot_linux-64=2.12
- tbb=2020.2
- terminado=0.12.1
- testpath=0.5.0
- threadpoolctl=3.0.0
- tk=8.6.11
- tktable=2.10
- toml=0.10.2
- tornado=6.1
- tqdm=4.62.3
- traitlets=5.1.1
- typing_extensions=4.0.0
- tzlocal=2.1
- umap-learn=0.5.2
- unicodedata2=13.0.0.post2
- unifrac=0.20.2
- urllib3=1.26.7
- vsearch=2.7.0
- wcwidth=0.2.5
- webencodings=0.5.1
- wheel=0.37.0
- widgetsnbextension=3.5.2
- xmltodict=0.12.0
- xopen=1.2.1
- xorg-kbproto=1.0.7
- xorg-libice=1.0.10
- xorg-libsm=1.2.3
- xorg-libx11=1.7.2
- xorg-libxau=1.0.9
- xorg-libxdmcp=1.1.3
- xorg-libxext=1.3.4
- xorg-libxrender=0.9.10
- xorg-libxt=1.2.1
- xorg-renderproto=0.11.1
- xorg-xextproto=7.3.0
- xorg-xproto=7.0.31
- xz=5.2.5
- yaml=0.2.5
- yq=2.12.2
- zeromq=4.3.4
- zipp=3.6.0
- zlib=1.2.11
- zstd=1.5.0