使用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
相关推荐
从0至12 天前
Conda 命令指南:从入门到精通
python·conda·小项目
xiaotao1313 天前
阶段零:Python 安装与虚拟环境(venv / Conda)
开发语言·人工智能·python·conda
KANGBboy4 天前
anaconda 相关
python·conda
qq_白羊座5 天前
‌Miniconda 和 Conda 的关系
conda
萧行之7 天前
CONDA设置、查看、管理源
conda
DeepHacking8 天前
Ubuntu 上安装 ComfyUI(NVIDIA GPU / Conda / CUDA 12.1)
linux·ubuntu·conda
不吃香菜的小趴菜9 天前
conda配置国内镜像源
conda
hui-梦苑10 天前
[Conda]环境激活钩子作用与应用
conda
做cv的小昊10 天前
【conda】打包已有conda环境并在其他服务器上搭建
运维·服务器·python·conda·运维开发·pip·开发
csdn_aspnet11 天前
用Anaconda驯服AI开发流,从数据预处理到模型部署,全链路环境标准化实战
人工智能·docker·ai·conda·anaconda