├── presentation_conda.pdf ├── presentation_conda ├── krona.png ├── conda_logo.png ├── conda_env_list.png └── default_path.png ├── presentation_conda-figure ├── unnamed-chunk-1-1.png ├── unnamed-chunk-2-1.png ├── unnamed-chunk-3-1.png ├── unnamed-chunk-4-1.png └── unnamed-chunk-5-1.png ├── README.md ├── presentation_conda.md ├── presentation_conda.Rpres └── index.html /presentation_conda.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda.pdf -------------------------------------------------------------------------------- /presentation_conda/krona.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda/krona.png -------------------------------------------------------------------------------- /presentation_conda/conda_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda/conda_logo.png -------------------------------------------------------------------------------- /presentation_conda/conda_env_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda/conda_env_list.png -------------------------------------------------------------------------------- /presentation_conda/default_path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda/default_path.png -------------------------------------------------------------------------------- /presentation_conda-figure/unnamed-chunk-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda-figure/unnamed-chunk-1-1.png -------------------------------------------------------------------------------- /presentation_conda-figure/unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda-figure/unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /presentation_conda-figure/unnamed-chunk-3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda-figure/unnamed-chunk-3-1.png -------------------------------------------------------------------------------- /presentation_conda-figure/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda-figure/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /presentation_conda-figure/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nevrome/conda-presentation/master/presentation_conda-figure/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Presentation of Conda for SHH 2 | Presentation here [maxibor.github.io/conda-presentation/#](https://maxibor.github.io/conda-presentation) 3 | 4 | Conda is a package and environment manager. 5 | -------------------------------------------------------------------------------- /presentation_conda.md: -------------------------------------------------------------------------------- 1 | --- 2 | output: 3 | pdf_document: default 4 | html_document: default 5 | --- 6 | Easy installations and virtual environments with conda 7 | ======================================================== 8 | author: Maxime Borry 9 | date: 24/01/2020 10 | width: 1440 11 | 12 | Follow the presentation 13 | ========================================================= 14 | ## [maxibor.github.io/conda-presentation](https://maxibor.github.io/conda-presentation) 15 | 16 | What does it mean to install a program ? 17 | ======================================================== 18 | 19 | ### -> Copy/move the executable of the program in the `PATH` 20 | 21 | ### What is the `PATH` ? 22 | 23 | 24 | ```bash 25 | borry@mpi-sdag1:~$ echo $PATH 26 | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ 27 | games:/usr/local/games:/opt/dell/srvadmin/bin 28 | ``` 29 | 30 | - `/usr/local/sbin` 31 | - `/usr/local/bin` 32 | - `/usr/sbin` 33 | - `/usr/bin` 34 | - ... 35 | 36 | ### When can't "install" programms on a computer, it's because you don't have write access to these directories 37 | 38 | What's in my path ? 39 | ======================================================== 40 | 41 | For example, let's have a look at `/usr/bin` ! 42 | 43 | 44 | ```bash 45 | borry@mpi-sdag1:~$ ls -1 /usr/bin 46 | ... 47 | head 48 | headerdoc2html 49 | heap 50 | heap32 51 | hexdump 52 | hidutil 53 | hiutil 54 | host 55 | ... 56 | ``` 57 | 58 | Great, but what about Conda ? 59 | ======================================================== 60 | 61 | 62 | ### I have a confession: this is not my real path 63 | 64 | ```bash 65 | borry@mpi-sdag1:~$ echo $PATH 66 | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ 67 | games:/usr/local/games:/opt/dell/srvadmin/bin 68 | ``` 69 | 70 | ### Here is my real path 71 | 72 | ```bash 73 | borry@mpi-sdag1:~$ echo $PATH 74 | /projects1/clusterhomes/borry/miniconda3/bin:/usr/local/ 75 | sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ 76 | games:/usr/local/games:/opt/dell/srvadmin/bin 77 | ``` 78 | 79 | ### The location where executables will be installed by Conda 80 | ``` 81 | /projects1/clusterhomes/borry/miniconda3/bin 82 | ``` 83 | Conda 84 | ======================================================== 85 | 86 | "Conda is an open source, **cross-platform**, **language-agnostic** **package and environment management system** distributed by Continuum Analytics." 87 | 88 | - Free 89 | - **No admin rights required** 90 | - Tons of bioinformatic packages available 91 | - Easy to install 92 | 93 | Install conda 94 | ======================================================== 95 | 96 | ### Two distributions: 97 | - Anaconda (fully featured, heavy) 98 | - **Miniconda** (bare minimum) 99 | 100 | ### Installation for Mac 101 | 102 | ```bash 103 | borry@maxime:~$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh 104 | borry@maxime:~$ bash ~/miniconda.sh 105 | ``` 106 | ### Installation for Linux 107 | 108 | ```bash 109 | borry@mpi-sdag1:~$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh 110 | borry@maxime:~$ bash ~/miniconda.sh 111 | ``` 112 | 113 | Using conda 114 | ======================================================== 115 | 116 | ## Install a package 117 | ##### When you install a package, conda automatically handles the installation of all its dependancies 118 | 119 | ### Jupyter/IPython notebook 120 | 121 | ```bash 122 | (base)borry@mpi-sdag1:~$ conda install jupyter 123 | ``` 124 | ## Install a package from a specific channel 125 | ##### BWA 126 | 127 | ```bash 128 | (base)borry@mpi-sdag1:~$ conda install -c bioconda bwa 129 | ``` 130 | ### [Bioconda](https://bioconda.github.io/recipes.html): Channel for bioinformatics packages 131 | ##### [Bioconda: sustainable and comprehensive software distribution for the life sciences](https://www.nature.com/articles/s41592-018-0046-7) 132 | ### [conda-forge](https://conda-forge.org/feedstocks/): community-led (huge) collection of recipes 133 | 134 | Everything with conda is an environment 135 | ======================================================== 136 | 137 | ## An environement is an isolated sandbox that allows a fine control on program's versions and dependancies 138 | 139 | ##### By default, you're in the **base** environment 140 | 141 | ```bash 142 | (base)borry@mpi-sdag1:~$ conda env list 143 | # conda environments: 144 | # 145 | base * /projects1/clusterhomes/borry/miniconda3 146 | ``` 147 | 148 | ##### But can create new environments... 149 | 150 | ```bash 151 | (base)borry@mpi-sdag1:~$ conda create -n myEnvName 152 | ``` 153 | Everything with conda is an environment(2) 154 | ======================================================== 155 | 156 | 157 | ##### Change your current environemnt (activate) 158 | 159 | ```bash 160 | (base)borry@mpi-sdag1:~$ conda activate myEnvName 161 | ``` 162 | 163 | ##### **Note that your prompt now includes the name of the active environment** 164 | 165 | ##### Install a package in this environment, for example, RStudio 166 | 167 | ```bash 168 | (myEnvName) borry@mpi-sdag1:~$ conda install -c r rstudio 169 | ``` 170 | 171 | ##### And go back to the **base** environment 172 | 173 | ```bash 174 | (myEnvName) borry@mpi-sdag1:~$ conda deactivate 175 | ``` 176 | 177 | ##### **The packages installed in one environement are not accessible from outside !** 178 | 179 | Let's create an environment for MetaPhlan2 and Krona 180 | ======================================================== 181 | 182 | 183 | [Krona plots](http://marbl.github.io/Krona/examples/rdp.krona.html) 184 | 185 | 186 | ```bash 187 | (base)borry@mpi-sdag1:~$ conda create -n metaphlan 188 | (base)borry@mpi-sdag1:~$ conda activate metaphlan 189 | (metaphlan) borry@mpi-sdag1:~$ conda install -c bioconda metaphlan2 190 | # Now you can use metaphlan ! 191 | (metaphlan) conda install -c bioconda krona 192 | ``` 193 | 194 | Now let's share our environement ! 195 | 196 | ```bash 197 | (metaphlan) borry@mpi-sdag1:~$ conda env export > metaphlan_env.yml 198 | ``` 199 | 200 | And recreate it on another machine from the environment file 201 | 202 | ```bash 203 | (base)borry@maxime:~$ conda env create -f metaphlan_env.yml 204 | ``` 205 | 206 | Other useful conda commands 207 | ======================================================== 208 | 209 | ##### List installed packages and versions in an environment 210 | 211 | ```bash 212 | (metaphlan) borry@mpi-sdag1:~$ conda list 213 | ``` 214 | 215 | ##### Uninstall a package (here Krona) 216 | 217 | ```bash 218 | (metaphlan) borry@mpi-sdag1:~$ conda remove krona 219 | ``` 220 | 221 | ##### Delete an environment 222 | 223 | ```bash 224 | (base)borry@mpi-sdag1:~$ conda env remove -n metaphlan 225 | ``` 226 | 227 | ### Conda documentation: [conda.io/docs](https://conda.io/docs) 228 | 229 | 230 | -------------------------------------------------------------------------------- /presentation_conda.Rpres: -------------------------------------------------------------------------------- 1 | Easy installations and virtual environments with conda 2 | ======================================================== 3 | author: Maxime Borry 4 | date: 24/01/2020 5 | width: 1440 6 | 7 | Follow the presentation 8 | ========================================================= 9 | ## [maxibor.github.io/conda-presentation](https://maxibor.github.io/conda-presentation) 10 | 11 | What does it mean to install a program ? 12 | ======================================================== 13 | incremental: true 14 | ### -> Copy/move the executable of the program in the `PATH` 15 | 16 | ### What is the `PATH` ? 17 | 18 | ```{bash, eval=FALSE} 19 | borry@mpi-sdag1:~$ echo $PATH 20 | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ 21 | games:/usr/local/games:/opt/dell/srvadmin/bin 22 | ``` 23 | 24 | - `/usr/local/sbin` 25 | - `/usr/local/bin` 26 | - `/usr/sbin` 27 | - `/usr/bin` 28 | - ... 29 | 30 | ### When can't "install" programms on a computer, it's because you don't have write access to these directories 31 | 32 | What's in my path ? 33 | ======================================================== 34 | incremental: true 35 | For example, let's have a look at `/usr/bin` ! 36 | 37 | ```{bash, eval=FALSE} 38 | borry@mpi-sdag1:~$ ls -1 /usr/bin 39 | ... 40 | head 41 | headerdoc2html 42 | heap 43 | heap32 44 | hexdump 45 | hidutil 46 | hiutil 47 | host 48 | ... 49 | ``` 50 | 51 | Great, but what about Conda ? 52 | ======================================================== 53 | incremental: true 54 | 55 | ### I have a confession: this is not my real path 56 | ```{bash, eval=FALSE} 57 | borry@mpi-sdag1:~$ echo $PATH 58 | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ 59 | games:/usr/local/games:/opt/dell/srvadmin/bin 60 | ``` 61 | 62 | ### Here is my real path 63 | ```{bash, eval=FALSE} 64 | borry@mpi-sdag1:~$ echo $PATH 65 | /projects1/clusterhomes/borry/miniconda3/bin:/usr/local/ 66 | sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/ 67 | games:/usr/local/games:/opt/dell/srvadmin/bin 68 | ``` 69 | 70 | ### The location where executables will be installed by Conda 71 | ``` 72 | /projects1/clusterhomes/borry/miniconda3/bin 73 | ``` 74 | Conda 75 | ======================================================== 76 | incremental: true 77 | "Conda is an open source, **cross-platform**, **language-agnostic** **package and environment management system** distributed by Continuum Analytics." 78 | 79 | - Free 80 | - **No admin rights required** 81 | - Tons of bioinformatic packages available 82 | - Easy to install 83 | 84 | Install conda 85 | ======================================================== 86 | incremental: true 87 | ### Two distributions: 88 | - Anaconda (fully featured, heavy) 89 | - **Miniconda** (bare minimum) 90 | 91 | ### Installation for Mac 92 | ```{bash, eval=FALSE} 93 | borry@maxime:~$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh 94 | borry@maxime:~$ bash ~/miniconda.sh 95 | ``` 96 | ### Installation for Linux 97 | ```{bash, eval=FALSE} 98 | borry@mpi-sdag1:~$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh 99 | borry@maxime:~$ bash ~/miniconda.sh 100 | ``` 101 | 102 | Using conda 103 | ======================================================== 104 | incremental: true 105 | ## Install a package 106 | ##### When you install a package, conda automatically handles the installation of all its dependancies 107 | 108 | ### Jupyter/IPython notebook 109 | ```{bash, eval=FALSE} 110 | (base)borry@mpi-sdag1:~$ conda install jupyter 111 | ``` 112 | ## Install a package from a specific channel 113 | ##### BWA 114 | ```{bash, eval=FALSE} 115 | (base)borry@mpi-sdag1:~$ conda install -c bioconda bwa 116 | ``` 117 | ### [Bioconda](https://bioconda.github.io/recipes.html): Channel for bioinformatics packages 118 | ##### [Bioconda: sustainable and comprehensive software distribution for the life sciences](https://www.nature.com/articles/s41592-018-0046-7) 119 | ### [conda-forge](https://conda-forge.org/feedstocks/): community-led (huge) collection of recipes 120 | 121 | Everything with conda is an environment 122 | ======================================================== 123 | incremental: true 124 | ## An environement is an isolated sandbox that allows a fine control on program's versions and dependancies 125 | 126 | ##### By default, you're in the **base** environment 127 | ```{bash, eval=FALSE} 128 | (base)borry@mpi-sdag1:~$ conda env list 129 | # conda environments: 130 | # 131 | base * /projects1/clusterhomes/borry/miniconda3 132 | ``` 133 | 134 | ##### But can create new environments... 135 | ```{bash, eval=FALSE} 136 | (base)borry@mpi-sdag1:~$ conda create -n myEnvName 137 | ``` 138 | Everything with conda is an environment(2) 139 | ======================================================== 140 | incremental: true 141 | 142 | ##### Change your current environemnt (activate) 143 | ```{bash, eval=FALSE} 144 | (base)borry@mpi-sdag1:~$ conda activate myEnvName 145 | ``` 146 | 147 | ##### **Note that your prompt now includes the name of the active environment** 148 | 149 | ##### Install a package in this environment, for example, RStudio 150 | ```{bash, eval=FALSE} 151 | (myEnvName) borry@mpi-sdag1:~$ conda install -c r rstudio 152 | ``` 153 | 154 | ##### And go back to the **base** environment 155 | ```{bash, eval=FALSE} 156 | (myEnvName) borry@mpi-sdag1:~$ conda deactivate 157 | ``` 158 | 159 | ##### **The packages installed in one environement are not accessible from outside !** 160 | 161 | Let's create an environment for MetaPhlan2 and Krona 162 | ======================================================== 163 | incremental: true 164 | 165 | [Krona plots](http://marbl.github.io/Krona/examples/rdp.krona.html) 166 | 167 | ```{bash, eval=FALSE} 168 | (base)borry@mpi-sdag1:~$ conda create -n metaphlan 169 | (base)borry@mpi-sdag1:~$ conda activate metaphlan 170 | (metaphlan) borry@mpi-sdag1:~$ conda install -c bioconda metaphlan2 171 | # Now you can use metaphlan ! 172 | (metaphlan) conda install -c bioconda krona 173 | ``` 174 | 175 | Now let's share our environement ! 176 | ```{bash, eval=FALSE} 177 | (metaphlan) borry@mpi-sdag1:~$ conda env export > metaphlan_env.yml 178 | ``` 179 | 180 | And recreate it on another machine from the environment file 181 | ```{bash, eval=FALSE} 182 | (base)borry@maxime:~$ conda env create -f metaphlan_env.yml 183 | ``` 184 | 185 | Other useful conda commands 186 | ======================================================== 187 | incremental: true 188 | ##### List installed packages and versions in an environment 189 | ```{bash, eval=FALSE} 190 | (metaphlan) borry@mpi-sdag1:~$ conda list 191 | ``` 192 | 193 | ##### Uninstall a package (here Krona) 194 | ```{bash, eval=FALSE} 195 | (metaphlan) borry@mpi-sdag1:~$ conda remove krona 196 | ``` 197 | 198 | ##### Delete an environment 199 | ```{bash, eval=FALSE} 200 | (base)borry@mpi-sdag1:~$ conda env remove -n metaphlan 201 | ``` 202 | 203 | ### Conda documentation: [conda.io/docs](https://conda.io/docs) 204 | 205 | 206 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 |