knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

L1fdvGenetics

The goal of L1fdvGenetics is to provide interactive tutorials for the Genetics project. Tutorials are packaged so you can install them on you computer and do the exercices without access to an internet connection.

Installation

Local installation

You only need to perform each of the following steps once:

However each of them may take some time.

Installing R

Go to the CRAN webpage, select your OS and follow the instructions.

```{bash, eval = FALSE}

If you're on Ubuntu

sudo apt-get install r-base

On **Windows**: you may need **Rtools** (unlikely) and **git** 

- **Rtools**: visit the dedicated [page](https://cran.r-project.org/bin/windows/Rtools/), download the suggested exe and install it on your computer
- **git**: visit the dedicated [page](https://git-scm.com/download/win), download the suggested exe and install it on your computer


On **MacOS**: you may need **XCode** (unlikely)

- **XCode**: visit the dedicated [page](https://mac.r-project.org/tools/), download the **Mandatory tools** and install them on your computer

#### Installing RStudio Desktop

Go to the [download](https://rstudio.com/products/rstudio/download/#download) page. Select, download and install the file corresponding to your OS. 

#### Installing R packages

Launch Rstudio (by clicking on the corresponding icon) and execute the following commands in the console
```r
install.packages("remotes") 
install.packages("learnr") 

Installation (II)

You need to install the tutorials every time I update them (hopefully not too often).

Installing the tutorials

You can install the tutorials from GitHub by launching Rstudio and typing the following command in the console:

remotes::install_github("mahendra-mariadassou/L1fdvGenetics")

The tutorials included in L1fdvGenetics are lightweight and have no dependencies. It should be quite fast and not consume a lot of data.

Remote installation: Rstudio Cloud

If you have trouble installing R on your computer, you can also use it on a remote server. This is not the preferred solution as it's limited to 9 people. Favor the local installation if you can.

Remote installation: binder

Alternatively, you can use create a remote R session to complete the tutorial by launching binder: Binder

You only need a web browser, no account or anything. The main drawback of this solution (compared to the previous ones) is that you lose your progress each time you launch a new session.

Starting a tutorial

This package is intended for use with learnr (which should be installed when you install L1fdvGenetics).

There are two tutorials in the package. Make sure to restart R before running a tutorial. Don't run a tutorial twice (or two different tutorials) in the same R session.

Candidate gene (single marker) approach

## Launch only one tutorial at the time and restart R before doing so!!
learnr::run_tutorial("01_candidate_gene", package = "L1fdvGenetics")

If you have an error, you can try the following command:

rmarkdown::run(file = NULL, 
               dir = learnr:::get_tutorial_path("01_candidate_gene",  
                                                package = "L1fdvGenetics"), 
               shiny_args = list(launch.browser = 1))

QTL detection by Simple Interval Mapping (SIM)

## Launch only one tutorial at the time and restart R before doing so!!
learnr::run_tutorial("02_interval_mapping", package = "L1fdvGenetics")

If you have an error, you can try the following command:

rmarkdown::run(file = NULL, 
               dir = learnr:::get_tutorial_path("02_interval_mapping",  
                                                package = "L1fdvGenetics"), 
               shiny_args = list(launch.browser = 1))

Assignement

You can open the (empty) assignment template with:

file.edit(system.file("assignment/assignment.Rmd", package = "L1fdvGenetics"))

Or download it from the web.

Make a copy and save it on your computer (you can edit the file you just opened but you can't save it).

This is an Rmd (similar to a jupyter notebook). You can write R code in code chuncks (you shoudn't have to, unless you attempt to detect QTL in Chromosome 2).

You should knit the document to an html file once to get the raw results. You can do so by clicking on the knit button.

You can also execute each chunck in the console using the small green triangle (note that you should execute chuncks in turn as a chunck may depend on previous chuncks).

When you're done adding comments and editing the document (for example, hiding some output from the final reports), you should knit it to a html file and submit it to moodle or through a google form (further instructions will follow).



mahendra-mariadassou/L1fdvGenetics documentation built on May 20, 2021, 10:42 p.m.