使用mamba替换conda和anaconda配置环境安装软件

使用mamba替换miniconda和anaconda,原因是速度更快,无论是创建新环境还是激活环境

conda、mamba、anaconda都是蟒蛇的意思…

下载mambaforge

wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
bash Mambaforge-Linux-x86_64.sh

linux和mac使用命令行下载mambaforge

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"

windows版本和linux、mac版本可以从夸克网盘下载
链接:https://pan.quark.cn/s/6fd066275bd1
提取码:iG2E

安装

windows直接鼠标双击打开Mambaforge-Windows-x86_64.exe文件在图形界面安装;

linux和mac在命令行中安装

bash Mambaforge*.sh
  • 设置镜像

linux和mac在${HOME}目录下新建文件.condarc

Windows中默认路径为C:\Users\用户名\.condarc

always_yes设为true, 也不用每次加-y参数或者每次手动输入y确认安装包了。

always_yes: true
show_channel_urls: true
channels:
  - defaults
default_channels:
  - https://mirror.sjtu.edu.cn/anaconda/pkgs/r
  - https://mirror.sjtu.edu.cn/anaconda/pkgs/main
custom_channels:
  conda-forge: https://mirror.sjtu.edu.cn/anaconda/cloud/
  pytorch: https://mirror.sjtu.edu.cn/anaconda/cloud/
  bioconda: https://mirror.sjtu.edu.cn/anaconda/cloud/

创建一个简单环境

创建一个名叫fastq_env的环境,包括一个软件fastqc

mamba create -n fastq_env -c bioconda fastqc

创建一个单细胞分析环境

示例创建一个Python单细胞分析环境;

  • SC.yml文件如下

name 是环境名,prefix为环境目录路径,channels为镜像文件.condarc中设置的国内镜像名;dependencies包及其版本号

name: SC
prefix: /home/victor/mambaforge/envs/SC
channels:
  - conda-forge
  - bioconda
  - plotly
dependencies:
  - python=3.11
  - numpy
  - pandas
  - bioinfokit
  - matplotlib
  - seaborn
  - matplotlib-venn
  - adjustText
  - tabulate
  - textwrap3
  - notebook
  - ipykernel
  - openpyxl
  - pyarrow
  - scanpy
  - python-igraph
  - leidenalg
  - pytables
  - harmonypy
  - plotly
  - cython
  - scikit-learn
  - python-louvain
  - pip
  - pip:
    - scrublet
    - celltypist
    - pyscenic
    - cell2location
    - pydeseq2
    - gseapy


  • 创建环境
mamba env create -f SC.yml

创建一个R单细胞环境

R.yml文件如下,包括R4.3.2、tidyverse系列数据处理软件

name: R
prefix: /home/victor/mambaforge/envs/R
channels:
  - conda-forge
  - bioconda
dependencies:
  - r-base=4.3.2
  - r-monocle3
  - r-terra
  - r-tidyverse
  - r-lme4
  - r-ggrastr
  - r-pheatmap
  - r-plotly
  - r-gplots
  - conda-forge:r-seurat
  - conda-forge:r-seuratobject
  - conda-forge:r-circlize
  - conda-forge:r-speedglm
  - conda-forge:r-htmlwidgets
  - bioconductor-biocgenerics
  - bioconductor-delayedarray
  - bioconductor-delayedmatrixstats
  - bioconductor-limma
  - bioconductor-s4vectors
  - bioconductor-summarizedexperiment
  - bioconductor-batchelor
  - bioconductor-hdf5array
  - bioconductor-complexheatmap
  - bioconductor-monocle
  - libgdal
  - libudunits2

  • 创建环境
mamba env create -f R.yml

使用mamba替换conda和anaconda配置环境安装软件_第1张图片

你可能感兴趣的:(conda)