Skip to content

Commit a3500fe

Browse files
author
wikiselev
committed
update the course website
1 parent 77319b7 commit a3500fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+98
-82
lines changed

docs/09-L3-intro-to-R.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ b
161161
## [1] 5
162162
```
163163

164-
In addition to standard alphanumeric characters, strings can also store various special characters. Special characters are identified using a backlash followed by a single character, the most relevant are the special character for tab : "\t" and new line : "\n". To demonstrate the these special characters lets concatenate (cat) together two strings with these characters separating (sep) them:
164+
In addition to standard alphanumeric characters, strings can also store various special characters. Special characters are identified using a backlash followed by a single character, the most relevant are the special character for tab : `\t` and new line : `\n`. To demonstrate the these special characters lets concatenate (cat) together two strings with these characters separating (sep) them:
165165

166166
```r
167167
cat("Hello", "World", sep= " ")
@@ -187,7 +187,7 @@ cat("Hello", "World", sep= "\n")
187187
## Hello
188188
## World
189189
```
190-
Note that special characters work differently in different functions. For instance the "paste" function does the same thing as "cat" but does not recognize special characters.
190+
Note that special characters work differently in different functions. For instance the `paste` function does the same thing as `cat` but does not recognize special characters.
191191

192192

193193
```r
@@ -214,7 +214,7 @@ paste("Hello", "World", sep= "\n")
214214
## [1] "Hello\nWorld"
215215
```
216216

217-
Single or double backslash is also used as an "escape" character to turn off special characters or allow quotation marks to be included in strings:
217+
Single or double backslash is also used as an `escape` character to turn off special characters or allow quotation marks to be included in strings:
218218

219219

220220
```r
@@ -231,7 +231,7 @@ Special characters are generally only used in pattern matching, and reading/writ
231231
dat = read.delim("file.tsv", sep="\t")
232232
```
233233

234-
Another special type of character data are colours. Colours can be specified in three main ways: by name from those [available](http://bxhorn.com/r-color-tables/), by red, green, blue values using the "rgb" function, and by hue (colour), saturation (colour vs white) and value (colour/white vs black) using the "hsv" function. By default rgb and hsv expect three values in 0-1 with an optional fourth value for transparency. Alternatively, sets of predetermined colours with useful properties can be loaded from many different packages with [RColorBrewer](http://colorbrewer2.org/) being one of the most popular.
234+
Another special type of character data are colours. Colours can be specified in three main ways: by name from those [available](http://bxhorn.com/r-color-tables/), by red, green, blue values using the `rgb` function, and by hue (colour), saturation (colour vs white) and value (colour/white vs black) using the `hsv` function. By default rgb and hsv expect three values in 0-1 with an optional fourth value for transparency. Alternatively, sets of predetermined colours with useful properties can be loaded from many different packages with [RColorBrewer](http://colorbrewer2.org/) being one of the most popular.
235235

236236

237237
```r
@@ -253,7 +253,7 @@ barplot(c(1,1,1), col=reds, names=c("by_name", "by_rgb", "by_hsv"))
253253

254254
### Logical
255255

256-
The "logical" class stores boolean truth values, i.e. TRUE and FALSE. It is used for storing the results of logical operations and conditional statements will be coerced to this class. Most other data-types can be coerced to boolean without triggering (or "throwing") error messages, which may cause unexpected behaviour.
256+
The `logical` class stores boolean truth values, i.e. TRUE and FALSE. It is used for storing the results of logical operations and conditional statements will be coerced to this class. Most other data-types can be coerced to boolean without triggering (or "throwing") error messages, which may cause unexpected behaviour.
257257

258258

259259
```r
@@ -368,14 +368,14 @@ as.numeric(as.character(x))
368368
## [1] 20 25 23 38 20 40 25 30
369369
```
370370

371-
To make R read text as character data instead of factors set the environment option "stringsAsFactors=FALSE". This must be done at the start of each R session.
371+
To make R read text as character data instead of factors set the environment option `stringsAsFactors=FALSE`. This must be done at the start of each R session.
372372

373373

374374
```r
375375
options(stringsAsFactors=FALSE)
376376
```
377377
__Exercise__
378-
How would you use factors to create a vector of colours for an arbitrarily long vector of fruits like "str_vector" above?
378+
How would you use factors to create a vector of colours for an arbitrarily long vector of fruits like `str_vector` above?
379379
__Answer__
380380

381381

@@ -437,9 +437,9 @@ class(x)
437437
```
438438
## [1] "character"
439439
```
440-
Here we tried to put character, numeric and logical data into a single vector so all the values were coerced to "character" data.
440+
Here we tried to put character, numeric and logical data into a single vector so all the values were coerced to `character` data.
441441

442-
A "matrix" is the two dimensional version of a vector, it also requires all data to be of the same type.
442+
A `matrix` is the two dimensional version of a vector, it also requires all data to be of the same type.
443443
If we combine a character vector and a numeric vector into a matrix, all the data will be coerced to characters:
444444

445445

@@ -517,15 +517,15 @@ class(z[,1])
517517
## [1] "factor"
518518
```
519519

520-
Another difference between matrices and dataframes is the ability to select columns using the "$" operator:
520+
Another difference between matrices and dataframes is the ability to select columns using the `$` operator:
521521

522522

523523
```r
524524
m$x # throws an error
525525
z$x # ok
526526
```
527527

528-
The final basic data structure is the "list". Lists allow data of different types and different lengths to be stored in a single object. Each element of a list can be any other R object : data of any type, any data structure, even other lists or functions.
528+
The final basic data structure is the `list`. Lists allow data of different types and different lengths to be stored in a single object. Each element of a list can be any other R object : data of any type, any data structure, even other lists or functions.
529529

530530

531531
```r
@@ -564,12 +564,12 @@ ll
564564
## $even_a_function
565565
## function (..., deparse.level = 1)
566566
## .Internal(cbind(deparse.level, ...))
567-
## <bytecode: 0x7f3bf97ae978>
567+
## <bytecode: 0x55e4ded2f378>
568568
## <environment: namespace:base>
569569
```
570570

571571
Lists are most commonly used when returning a large number of results from a function that do not fit into any of the previous data structures.
572572

573573
## More information
574574

575-
You can get more information about any R commands relevant to these datatypes using by typing "?function" in an interactive session.
575+
You can get more information about any R commands relevant to these datatypes using by typing `?function` in an interactive session.

docs/10-L3-Intro-to-Bioconductor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Task 1: In what ways is the untidy data not tidy? How could we make the untidy d
4343

4444
Tidy data is generally easier to work with than untidy data, especially if you are working with packages such as ggplot. Fortunately, packages are available to make untidy data tidy. Today we will explore a few of the functions available in the tidyr package which can be used to make untidy data tidy. If you are interested in finding out more about tidying data, we recommend reading "R for Data Science", by Garrett Grolemund and Hadley Wickham. An electronic copy is available here: http://r4ds.had.co.nz/
4545

46-
The untidy data above is untidy because two variables ("Wins" and "Losses") are stored in one column ("Category"). This is a common way in which data can be untidy. To tidy this data, we need to make "Wins" and "Losses" into columns, and store the values in "Counts" in these columns. Fortunately, there is a function from the tidyverse packages to perform this operation. The function is called `spread`, and it takes two arguments, `key` and `value`. You should pass the name of the column which contains multiple variables to `key`, and pass the name of the column which contains values from multiple variables to `value`. For example:
46+
The untidy data above is untidy because two variables (`Wins` and `Losses`) are stored in one column (`Category`). This is a common way in which data can be untidy. To tidy this data, we need to make `Wins` and `Losses` into columns, and store the values in `Counts` in these columns. Fortunately, there is a function from the tidyverse packages to perform this operation. The function is called `spread`, and it takes two arguments, `key` and `value`. You should pass the name of the column which contains multiple variables to `key`, and pass the name of the column which contains values from multiple variables to `value`. For example:
4747

4848

4949
```r
@@ -86,7 +86,7 @@ Task 2: The dataframe `foods` defined below is untidy. Work out why and use `spr
8686
foods<-data.frame(student=c("Antoinette","Antoinette","Taylor", "Taylor", "Alexa", "Alexa"), Category=c("Dinner", "Dessert", "Dinner", "Dessert", "Dinner","Dessert"), Frequency=c(3,1,4,5,2,1))
8787
```
8888

89-
The other common way in which data can be untidy is if the columns are values instead of variables. For example, the dataframe below shows the percentages some students got in tests they did in May and June. The data is untidy because the columns "May" and "June" are values, not variables.
89+
The other common way in which data can be untidy is if the columns are values instead of variables. For example, the dataframe below shows the percentages some students got in tests they did in May and June. The data is untidy because the columns `May` and `June` are values, not variables.
9090

9191

9292
```r
2.51 KB
Loading
182 Bytes
Loading
31 Bytes
Loading
-797 Bytes
Loading
733 Bytes
Loading
-3.64 KB
Loading
260 Bytes
Loading

docs/20-exprs-norm.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,18 @@ plotRLE(
436436

437437
\caption{Cell-wise RLE of the tung data}(\#fig:norm-ours-rle-scran)
438438
\end{figure}
439+
scran sometimes calculates negative or zero size factors. These will completely distort the normalized expression matrix.
440+
We can check the size factors scran has computed like so:
439441

442+
```r
443+
summary(sizeFactors(umi.qc))
444+
```
445+
446+
```
447+
## Min. 1st Qu. Median Mean 3rd Qu. Max.
448+
## 0.4646 0.7768 0.9562 1.0000 1.1444 3.4348
449+
```
450+
For this dataset all the size factors are reasonable so we are done. If you find scran has calculated negative size factors try increasing the cluster and pool sizes until they are all positive.
440451

441452
### Downsampling
442453

0 commit comments

Comments
 (0)