Skip to content

Commit

Permalink
adds more explanation on exercises
Browse files Browse the repository at this point in the history
  • Loading branch information
Czarnewski committed Jan 31, 2020
1 parent eff953f commit bd96173
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 35 deletions.
18 changes: 13 additions & 5 deletions conda_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ cd ~/Downloads
sh Miniconda3-latest-Linux-x86_64.sh
```

6. Inside MobaXterm, type the commands below to install the X-server graphical packages that will be used to lauch RStudio.
6. Inside MobaXterm, type the commands below to install the X-server graphical packages that will be used to launch RStudio.
[https://docs.anaconda.com/anaconda/install/linux/](https://docs.anaconda.com/anaconda/install/linux/)
```
sudo apt-get update
Expand Down Expand Up @@ -212,26 +212,34 @@ If by any means you see that the installations are not working as it should on y

6. Proceed with the Ubuntu installation as recommended. You can set to do "Minimal Installation" and deactivate to get updates during installation.

7. Inside UBUNTU, Download conda:

7. Inside Ubuntu, open TERMINAL and type the commands below to install the X-server graphical packages that will be used to launch RStudio.
[https://docs.anaconda.com/anaconda/install/linux/](https://docs.anaconda.com/anaconda/install/linux/)
```
sudo apt-get update
sudo apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
```

8. Inside UBUNTU, Download conda:
```
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
```

8. Inside UBUNTU, open the TERMINAL and type the commands below. Follow the instructions for the installation there.
9. Inside UBUNTU, open the TERMINAL and type the commands below. Follow the instructions for the installation there.
```
cd ~/Downloads
sh Miniconda3-latest-Linux-x86_64.sh
```

9. Close Terminal to apply the CONDA updates. Then you can create a course folder, download the environment file and create the environment:
10. Close Terminal to apply the CONDA updates. Then you can create a course folder, download the environment file and create the environment:
```
mkdir ~/Desktop/course
cd ~/Desktop/course
wget https://raw.githubusercontent.com/NBISweden/workshop-scRNAseq/master/labs/environment_r.yml
conda env create -n scRNAseq2020 -f environment_r.yml
```

10. You can then follow the instructions above to activate/deactivate the environment.
11. You can then follow the instructions above to activate/deactivate the environment.
```
conda activate scRNAseq2020
rstudio &
Expand Down
15 changes: 9 additions & 6 deletions exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ We highly recommend you to use the files provided instead of copying and pasting

<br/>

##### <img border="0" src="https://www.svgrepo.com/show/83019/faq-button.svg" width="40" height="40"> FAQ
***

As you run into problems, we will try to fill in the [FAQ](labs/FAQ) with common questions.

<br/>

<br/>

##### <img border="0" src="https://www.svgrepo.com/show/759/exercise.svg" width="40" height="40"> BONUS exercises
***

Expand All @@ -78,11 +87,5 @@ We will try to keep these tutorials up to date. If you find any errors or things

<br/>

##### <img border="0" src="https://www.svgrepo.com/show/83019/faq-button.svg" width="40" height="40"> FAQ
***

As you run into problems, we will try to fill in the [FAQ](labs/FAQ) with common questions.

<br/>

<div style="text-align: right; font-size: 5px"> Icons are provided from [www.svgrepo.com](www.svgrepo.com) </div>
63 changes: 39 additions & 24 deletions labs/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,56 @@
# Error - UMAP not found
---
layout: default
title: 'Precourse Material - scRNAseq course'
---

If your R does not find the correct python version, it will complain that `umap-learn` is not installed and ask you to install it. Here are some tips on how to find the correct python version that was installed in the conda environment.

### Try selecting the correct conda env in R:

In this example the conda env is named `sc_course`.
#### <img border="0" src="https://www.svgrepo.com/show/83019/faq-button.svg" width="40" height="40"> FAQ
***

library(reticulate)
reticulate:use_conda("sc_course")
<br/>

Then check what python you have in R:

reticulate::py_config()
# should read at top:
python: /Users/asbj/miniconda3/envs/sc_course/bin/python
##### Error - umap-learn not found
***

If your R does not find the correct python version, it will complain that `umap-learn` is not installed and ask you to install it. Here are some tips on how to find the correct python version that was installed in the conda environment.

If that still is not right, you may have an r-reticulate python installation as well and need to perform the steps below.
**Try selecting the correct conda env in R**

### Restart R and select python version
In this example the conda environment is named `scRNAseq2020`.
```
library(reticulate)
reticulate::use_conda("scRNAseq2020")
```

OBS! Before doing anything else you need to select python version.
Then check what python you have in R:
```
reticulate::py_config()
# should read at top:
python: /Users/asbj/miniconda3/envs/scRNAseq2020/bin/python
```

First, find out what path you have to your conda python (In terminal):
If that still is not right, you may have an `r-reticulate` python installation as well and need to perform the steps below.

which python
/Users/asbj/miniconda3/envs/sc_course/bin/python
<br/>

Then in R (after restarting):
**Restart R and select python version**

reticulate::use_python("/Users/asbj/miniconda3/envs/sc_course/bin/python", required=T)
OBS! Before doing anything else you need to select python version.

First, find out what path you have to your conda python (in TERMINAL):
```
which python
/Users/asbj/miniconda3/envs/scRNAseq2020/bin/python
```

Then check again with py_config if correct version of python is used:
Then in R (after restarting):
```
reticulate::use_python("/Users/asbj/miniconda3/envs/scRNAseq2020/bin/python", required=T)
```

reticulate::py_config()
Then check again with `py_config` if correct version of python is used:
```
reticulate::py_config()
```

If you have the correct version now, you should be able to run UMAP without issues.


0 comments on commit bd96173

Please sign in to comment.