Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lovely environment management with conda and ma...

Lovely environment management with conda and mamba🥰

Presentation in Tsukuba Bioinfo Assembly at 2022-06-14.
URL: https://tinyurl.com/tba-2022-06-14

Avatar for Akihiro Kuno

Akihiro Kuno

June 14, 2022
Tweet

Other Decks in Programming

Transcript

  1. Who am I? Akihiro Kuno MD,Ph.D 久野 朗広 👪 Child-rearing

    and houseworking 💼 Assist Prof at Anatomy and Embryology 🖥 Shellscript😍, R😊, Python😑 💡 Software development, Nanopore, Genome editing https:!/github.com/akikuno あなた誰よ?
  2. One day, you find an awesome tool ある日、あなたは良さげなソフトウェアを見つけました • This

    plot looks cool😍 • The tool is available on GitHub https:!/github.com/shenlab-sinai/ngsplot • Install and try it! https:!/doi.org/10.1186/1471-2164-15-284
  3. Error!!.😱 なんで動かんの??(ガチギレ) Traceback (most recent call last): File "<stdin>", line

    1, in <module> NameError: name 'xrange' is not defined. Did you mean: 'range'?
  4. Python 2.7 is required!!. 開発終わっとるやんけ… *Python 2 is no longer

    supported as of Jan 1st, 2020. https:!/github.com/shenlab-sinai/ngsplot
  5. You need multiple Python versions 同じソフトウェアで複数のバージョンを持ちたい! Daily usage🙂 Deep learning🤖

    Legacy tools👻 Py2.7 Py3.8 Py3.10 → → → You have three environments in this example
  6. Virtual environment 仮想環境 🚫 One machine, One environment Py3.10 Py3.8

    Py2.7 🆗 Virtual environment Py3.8 Py2.7 Py3.10 →
  7. conda creates multiple environments!! condaで複数の環境が作れる! Py2.7 Py3.8 Py3.10 → →

    → conda create -n env1 python=3.10 conda create -n env2 python=3.8 conda create -n env3 python=2.7
  8. Why I love conda?😻 1. Easy and simple commands 2.

    Bioinformatics tools are available 3. R and Bioconductor are supproted 4. Jupyter compatibility なぜconda推し?😻
  9. 1. Easy and simple commands condaでよく使うコマンド # create environment named

    as tba conda create !-name tba # activate the environment conda activate tba # install packages into the environment conda install wget # delete environment conda deactivate !& conda remove !-name tba !-all 👉 Short hands-on
  10. 2. Bioconda provides bioinfo tools Biocondaでバイオインフォツールのインストール conda config !-add channels

    defaults conda config !-add channels bioconda conda config !-add channels conda-forge # install bioinformatics tools conda install fastqc bwa samtools (https:!/bioconda.github.io/user/install.html) Bioconda's paper 👉 https:!/www.nature.com/articles/s41592-018-0046-7
  11. 3. R and Bioconductor packages R関係のパッケージもインストールできます # install R conda

    install r-base r-essentials # install R packages conda install r-tidyverse r-seurat # install Bioconductor packages conda install bioconductor-biostrings
  12. 4. Jupyter compatibility Jupyterの起動も可能 conda create -n tba_jpy3.8 python=3.8 jupyterlab

    conda create -n tba_jpy3.10 python=3.10 jupyterlab conda activate tba_jpy3.8 !& jupyter lab & conda activate tba_jpy3.10 !& jupyter lab 👉 Short hands-on
  13. mamba is a superior alternative conda's drawback is too SLOW😭

    mamba is an ultra-fast conda🚅💨 https:!/github.com/mamba-org/mamba mambaはcondaの上位互換(*個人の感想です)
  14. mamba's main commands mambaでよく使うコマンド mamba create -n tba # create

    environment mamba install wget # install pkgs mamba remove -n tba !-all ※ Use {conda activate} to activate environment
  15. If you are interested in conda/mamba お試しくださいませ • Install conda

    • https:!/docs.conda.io/en/latest/miniconda.html • Windows User: WSL2 is highly recommended • https:!/docs.microsoft.com/en-us/windows/wsl/install • Install mamba (and bioconda) conda config !-add channels defaults conda config !-add channels bioconda conda config !-add channels conda-forge conda install mamba # !> Enjoy your coding!!🍻