Skip to content

Commit

Permalink
Merge pull request #6 from fhdsl/lesson1
Browse files Browse the repository at this point in the history
Lesson1
  • Loading branch information
caalo authored Sep 28, 2023
2 parents 1188505 + fc83c0a commit fb7ff69
Show file tree
Hide file tree
Showing 22 changed files with 1,914 additions and 38 deletions.
4 changes: 0 additions & 4 deletions 01-intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@ The course is intended for researchers who want to learn coding for the first ti

The course covers fundamentals of R, a high-level programming language, and use it to wrangle data for analysis and visualization. The programming skills you will learn are transferable to learn more about R independently and other high-level languages such as Python. At the end of the class, you will be reproducing analysis from a scientific publication!


```{r}
devtools::session_info()
```
18 changes: 3 additions & 15 deletions lesson1.Rmd → 02-lesson1.Rmd
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@

# A new chapter

If you haven't yet read the getting started Wiki pages; [start there](https://www.ottrproject.org/getting_started.html).

To see the rendered version of this chapter and the rest of the template, see here: https://jhudatascience.org/OTTR_Template/.

Every chapter needs to start out with this chunk of code:


```{r, include = FALSE}
ottrpal::set_knitr_image_path()
```

# W1: Intro to Computing

## Goals of the course
Expand Down Expand Up @@ -141,7 +132,7 @@ x = 18 + 21

If you enter this in the Console, you will see that in the Environment, the variable `x` has a value of `39`.

::: {.callout-tip}
::: callout-tip
## Execution rule for variable assignment

Evaluate the expression to the right of `=`.
Expand All @@ -168,7 +159,7 @@ y = x * 2

A function has a **function name**, **arguments**, and **returns** a data type.

::: {.callout-tip}
::: callout-tip
## Execution rule for functions:

Evaluate the function by its arguments, and if the arguments are functions or contains operations, evaluate those functions or operations first.
Expand Down Expand Up @@ -214,13 +205,10 @@ Common errors:

- It did something else than I expected!


Solutions:

- Where is the problem?

- What kind of problem is it?

- Explain your problem to someone!


5 changes: 2 additions & 3 deletions _bookdown.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
book_filename: "Season 1 Introduction to R"
chapter_name: "Chapter "
repo: https://github.com/jhudsl/OTTR_Template/
rmd_files: ["index.Rmd",
"01-intro.Rmd",
"lesson1.Rmd",
rmd_files: ["01-intro.Rmd",
"02-lesson1.Rmd",
"About.Rmd",
"References.Rmd"]
new_session: yes
Expand Down
9 changes: 5 additions & 4 deletions _output.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
bookdown::gitbook:
css: assets/style.css
includes:
before_body: assets/big-image.html
before_body: assets/big-image_fhdasl.html
after_body: assets/footer.html
highlight: tango
config:
toc:
collapse: section
before: |
<a href="http://jhudatascience.org/"><img src="https://jhudatascience.org/images/dasl.png" style=" width: 80%; padding-left: 40px; padding-top: 8px; vertical-align: top "</a>
<a href="https://hutchdatascience.org/" target="_blank"><img src="assets/big-dasl-stacked.png" style="width: 80%; padding-left: 34px; padding-top: 8px;"</a>
after: |
<p style="text-align:center;"> <a href="https://github.com/jhudsl/OTTR_Template" target="blank" > This content was published with</a> <a href="https://bookdown.org/" target="blank"> bookdown by:</a> </p>
<p style="text-align:center;"> <a href="http://jhudatascience.org/"> The Johns Hopkins Data Science Lab </a></p>
<p style="text-align:center;"> <a href="https://github.com/jhudsl/OTTR_Template" target="blank" > This content was published with</a> <a href="https://bookdown.org/" target="blank"> bookdown by: </a> </p>
<p style="text-align:center;"> <a href="https://hutchdatascience.org/"> The Fred Hutch Data Science Lab </a></p>
<p style="text-align:center; font-size: 12px;"> <a href="https://github.com/rstudio4edu/rstudio4edu-book/"> Style adapted from: rstudio4edu-book </a> <a href ="https://creativecommons.org/licenses/by/2.0/"> (CC-BY 2.0) </a></p>
<p style="padding-left: 40px;"><div class="trapezoid" style = "padding-left: 40px;"><span> <a href="https://forms.gle/W6Mg4rzuMK6Yk3Am8"> Click here to provide feedback</a> <img src="assets/itcr_arrow.png" style=" width: 10%" ></span></div></p>
Binary file added classroom_data/CCLE.RData
Binary file not shown.
1,865 changes: 1,865 additions & 0 deletions classroom_data/CCLE_metadata.csv

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions classroom_data/gen_classroom_data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
library(tidyverse)

#Raw data downloaded from https://depmap.org/portal/download/all/.
#Raw data too large to keep in repository.
metadata = read.csv("../DepMap_23Q2_raw/Model.csv")
mutation = read.csv("../DepMap_23Q2_raw/OmicsSomaticMutations.csv")
expression = read.csv("../DepMap_23Q2_raw/OmicsExpressionProteinCodingGenesTPMLogp1.csv")


#Simplify mutation data for classroom use
#Pick genes that are Cosmic Hotspot, Driver, LikelyDriver, LoF
#Description of these criteria found https://storage.googleapis.com/shared-portal-files/Tools/%5BDMC%20Communication%5D%2022Q4%20Mutation%20Pipeline%20Update.pdf
mutation = summarise(group_by(mutation, ModelID, HugoSymbol),
mutated = ifelse(length(which(CosmicHotspot == "True" |
Driver == "True" | LoF == "True" |
LikelyDriver == "True")) >= 1, TRUE, NA))
mutation = pivot_wider(mutation, names_from = "HugoSymbol", values_from = "mutated")

idx = apply(mutation, MARGIN = 2, function(x) !all(is.na(x)))
mutation = mutation[, idx]
mutation[is.na(mutation)] = FALSE

#Clean up expression data
colnames(expression) = gsub("(.*)\\.\\..*", "\\1", colnames(expression))
#Subset expression data to be close to mutation data.
idx = c(1, which(colnames(expression) %in% colnames(mutation)))
expression = expression[, idx]

#Clean up colnames in mutation and expression data
colnames(mutation) = paste0(colnames(mutation), "_", "Mut")
colnames(mutation)[1] = "ModelID"
colnames(expression) = paste0(colnames(expression), "_", "Exp")
colnames(expression)[1] = "ModelID"

save(mutation, expression, metadata, file = "CCLE.RData")

2 changes: 1 addition & 1 deletion config_automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ url-checker: yes
# Render preview of content with changes (Rmd's and md's are checked)
render-preview: yes
# Spell check Rmds and quizzes
spell-check: yes
spell-check: no
# Style any R code
style-code: yes
# Test build the docker image if any docker-relevant files have been changed
Expand Down
Binary file added images/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/join.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/kras.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/lesson3_images.pdf
Binary file not shown.
13 changes: 2 additions & 11 deletions index.Rmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: "Course Name"
title: "Season 1 Introduction to R"
date: "`r format(Sys.time(), '%B, %Y')`"
site: bookdown::bookdown_site
documentclass: book
bibliography: [book.bib]
biblio-style: apalike
link-citations: yes
description: "Description about Course/Book."
description: ""
favicon: assets/dasl_favicon.ico
output:
bookdown::word_document2:
Expand All @@ -15,12 +15,3 @@ output:

# About this Course {-}


## Available course formats

This course is available in multiple formats which allows you to take it in the way that best suites your needs. You can take it for certificate which can be for free or fee.

- The material for this course can be viewed without login requirement on this [Bookdown website](LINK HERE). This format might be most appropriate for you if you rely on screen-reader technology.
- This course can be taken for [free certification through Leanpub](LINK HERE).
- This course can be taken on [Coursera for certification here](LINK HERE) (but it is not available for free on Coursera).
- Our courses are open source, you can find the [source material for this course on GitHub](LINK HERE).

0 comments on commit fb7ff69

Please sign in to comment.