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

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

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

下载mambaforge

Bash 复制代码
wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
bash Mambaforge-Linux-x86_64.sh

linux和mac使用命令行下载mambaforge

Bash 复制代码
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 复制代码
bash Mambaforge*.sh
  • 设置镜像

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

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

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

Bash 复制代码
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

Python 复制代码
mamba create -n fastq_env -c bioconda fastqc

创建一个单细胞分析环境

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

  • SC.yml文件如下

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

Python 复制代码
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
  • 创建环境
Bash 复制代码
mamba env create -f SC.yml

创建一个R单细胞环境

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

Python 复制代码
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
  • 创建环境
Bash 复制代码
mamba env create -f R.yml
相关推荐
QFIUNE1 天前
CD-HIT 详解:序列去冗余、安装使用与聚类结果解析
linux·服务器·机器学习·数据挖掘·conda·聚类
Echo_NGC22373 天前
【论文解读】Attention Is All You Need —— AI 时代的“开山之作“,经典中的经典(transformer小白导读)
人工智能·python·深度学习·神经网络·机器学习·conda·transformer
何中应3 天前
Conda安装&使用
python·conda·python3.11
qq_229058014 天前
conda中安装 rdkit版本的postgresql然后在Win11中使用虚拟环境里的rdkit
数据库·postgresql·conda
独隅7 天前
Anaconda被误删后抢救手册
conda
矢志航天的阿洪7 天前
手动安装Gurobi并配置gurobipy到Python环境(Windows/Conda)
windows·python·conda
GL_Rain8 天前
conda通过environment.yml创建虚拟环境(指定路径)报错解决教程
conda
雕刻刀11 天前
linux中复制conda环境
linux·python·conda
乐园游梦记11 天前
在pycharm中添加Conda创建的openmmlab虚拟环境作为解释器
ide·pycharm·conda
贵沫末12 天前
Python——图像处理项目Conda环境搭建
开发语言·python·conda