Skip to content

Commit

Permalink
some babs 4 infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
3mmaRand committed Jan 11, 2024
1 parent 028c0d9 commit aa5e2a7
Show file tree
Hide file tree
Showing 62 changed files with 3,597 additions and 18 deletions.
Binary file removed .DS_Store
Binary file not shown.
Binary file removed pgt52m/.DS_Store
Binary file not shown.
53 changes: 40 additions & 13 deletions r4babs4/r4babs4.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,57 @@ The BABS4 Module Learning outcomes that relate to the Data Analysis in R content

# How R4BABS 4 is organised

Each x has:
<!-- Each x has: -->

- An overview on the "About" page which gives the Learning Objectives, a topic summary and the instructions for the week. You should read this first.
<!-- - An overview on the "About" page which gives the Learning Objectives, a topic summary and the instructions for the week. You should read this first. -->

- Some independent study on the "Prepare!" page to prepare you for the workshop. This will be reading from the course book ([Computational Analysis for Bioscientists](https://3mmarand.github.io/comp4biosci/)), watching a video, or doing some coding or set up. It is designed to take about 30-45 mins on average. You will most likely learn best if you can find people to study with.
<!-- - Some independent study on the "Prepare!" page to prepare you for the workshop. This will be reading from the course book ([Computational Analysis for Bioscientists](https://3mmarand.github.io/comp4biosci/)), watching a video, or doing some coding or set up. It is designed to take about 30-45 mins on average. You will most likely learn best if you can find people to study with. -->

- A two-hour workshop using R. This will usually start with me doing a short demonstration of one or more of the examples that were in "Prepare!" but you will spend most of the session going through some exercises. Anything you have not done before is explained and guided but you will also have to use the skills gained in previous workshops. I often remind you to take care of future you by making notes so you can look up your previous work but you can also search the [R4BABS](https://3mmarand.github.io/R4BABS/) site (search is top right). Talking to other people in the workshop about the exercises and working together will really help you understand more. There will be plenty of help from me and my demonstrators.
<!-- - A two-hour workshop using R. This will usually start with me doing a short demonstration of one or more of the examples that were in "Prepare!" but you will spend most of the session going through some exercises. Anything you have not done before is explained and guided but you will also have to use the skills gained in previous workshops. I often remind you to take care of future you by making notes so you can look up your previous work but you can also search the [R4BABS](https://3mmarand.github.io/R4BABS/) site (search is top right). Talking to other people in the workshop about the exercises and working together will really help you understand more. There will be plenty of help from me and my demonstrators. -->

- Some independent study on the "Consolidate!" page to give you more practice. The exercises are usually similar to those in the workshop but with less guidance. Occasionally, there will be reading to do. It is designed to take about 30-45 mins on average but may be quicker if you understood the workshop very well or slower if you need to revisit the workshop.
<!-- - Some independent study on the "Consolidate!" page to give you more practice. The exercises are usually similar to those in the workshop but with less guidance. Occasionally, there will be reading to do. It is designed to take about 30-45 mins on average but may be quicker if you understood the workshop very well or slower if you need to revisit the workshop. -->

Learning Data Analysis in R is like learning to speak a new language or play an instrument or a technical sport - you can't really rush it or cram for it. You need regular practice.
<!-- Learning Data Analysis in R is like learning to speak a new language or play an instrument or a technical sport - you can't really rush it or cram for it. You need regular practice. -->

- a little bit of engagement and practice is always better than none
<!-- - a little bit of engagement and practice is always better than none -->

- if you get behind, just pick up where you left off rather than jumping in. It is fine to work on a previous week's workshop
<!-- - if you get behind, just pick up where you left off rather than jumping in. It is fine to work on a previous week's workshop -->

# Content

## All Strands
## Week 1 Core

many var and obs, examples, PCA, log fc transformation, normalisation, QC gating, missing values, excluding proteins id'd from fewer thaan two peptides, FDR, data structures
Workshop

##

##
All strands

##
many var and obs, examples, use the emphasise equivalance
PCA, log fc transformation, normalisation, QC gating, missing values, excluding proteins id'd from fewer than two peptides, FDR, data structures


## Week 2 Immunobiology - 1

Workshop

There are three different cell treatments: Media, Lipopolysaccharide (LPS) and E. coli (NeonGreen fluorescence))
Two experimental conditions: Isotype antibody and TNFalpha antibody conjugated to Allophycocyanin (APC)



## Week 3



## Week 4 Immunobiology - 2

Workshop



## Week 5


## Week 6 Immunobiology - 3

Workshop
31 changes: 31 additions & 0 deletions r4babs4/week-1/data-raw/adipocytes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
adiponectin treatment
7.39 nicotinic
7.58 nicotinic
6.87 nicotinic
7.23 nicotinic
9.32 nicotinic
5.72 nicotinic
7.12 nicotinic
9.74 nicotinic
8.55 nicotinic
6.31 nicotinic
6.71 nicotinic
8.01 nicotinic
10.62 nicotinic
8.33 nicotinic
3.13 nicotinic
3.77 control
2.46 control
6.9 control
5.89 control
4.31 control
7.86 control
4.35 control
6.61 control
6.19 control
6.52 control
3.94 control
5.86 control
6.36 control
6.83 control
5.34 control
101 changes: 101 additions & 0 deletions r4babs4/week-1/data-raw/beewing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
wing
3.6
3.7
3.8
3.8
4
4
4
4
4.1
4.1
4.1
4.1
4.1
4.1
4.2
4.2
4.2
4.2
4.2
4.2
4.2
4.3
4.3
4.3
4.3
4.3
4.3
4.3
4.3
4.4
4.4
4.4
4.4
4.4
4.4
4.4
4.4
4.4
5.1
5.1
5.1
5.1
4.5
4.5
4.5
4.5
4.5
4.5
4.5
4.5
4.5
4.5
4.9
4.9
4.9
4.9
4.9
4.9
4.9
5.2
5.2
5.3
5.3
4.6
4.6
4.6
4.6
4.6
4.6
4.6
4.6
4.6
4.6
5
5
5
5
5
5.4
5.5
4.7
4.7
4.7
4.7
4.7
4.7
4.7
4.7
4.7
4.8
4.8
4.8
4.8
4.8
4.8
4.8
4.8
3.9
3.9
5
9 changes: 9 additions & 0 deletions r4babs4/week-1/data-raw/neuron.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
csa
160.6
129.7
153.7
128.1
137.4
137.7
149.6
142
Binary file added r4babs4/week-1/images/answer.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 r4babs4/week-1/images/do_in_R.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 r4babs4/week-1/images/do_on_internet.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 r4babs4/week-1/images/do_on_your_computer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions r4babs4/week-1/overview.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "Overview"
subtitle: "The logic of hypothesis testing and confidence intervals"
toc: true
toc-location: right
---

This week we will cover the logic of consider the logic of hypothesis testing and type 1 and type 2 errors. We will also find out what the sampling distribution of the mean and the standard error are, and how to calculate confidence intervals.


![Artwork by @allison_horst: "type 1 error"](images/type-1-error.png){fig-alt="A cute population with a normal distribution with two samples, one which happens to have at mean at the low end of the population and one at the high end. The population is saying 'yes, I'm still sure I birthed both of you'. Because these samples are relatively rare - would happen less than 5% of the time - we would conclude they did not come from this population. That would be making a type 1 error." width="600"}


![Artwork by @allison_horst: "type 2 error"](images/type-2-error.png){fig-alt="Two cute populations with a normal distribution with very little overlap. There are two samples, one which happens to have at mean at the low end of one population and and the other at the high end of the other population so that the two samples are close togther. Deciding these two samples were from the same population would be making a type 2 error." width="600"}


### Learning objectives

The successful student will be able to:

- demonstrate the process of hypothesis testing with an example

- explain type 1 and type 2 errors

- define the sampling distribution of the mean and the standard error

- explain what a confidence interval is

- calculate confidence intervals for large and small samples

### Instructions

1. [Prepare](study_before_workshop.qmd)

i. 📖 Read The logic of hyothesis testing
ii. 📖 Read Confidence Intervals


2. [Workshop](workshop.qmd)

i. 💻 Remind yourself how to import files
ii. 💻 Calculate confidence intervals on large
iii. 💻 Calculate confidence intervals on small samples.


3. [Consolidate](study_after_workshop.qmd)

i. 💻 Calculate confidence intervals for each group in a data set



56 changes: 56 additions & 0 deletions r4babs4/week-1/study_after_workshop.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: "Independent Study to consolidate this week"
subtitle: "The logic of hypothesis testing and confidence intervals"
toc: true
toc-location: right
format:
html:
code-fold: true
code-summary: "Answer - don't look until you have tried!"
---

# Set up

If you have just opened RStudio you will want to load the **`tidyverse`** package

```{r}
#| code-fold: false
library(tidyverse)
```

# Exercises

1. 💻 Adiponectin is exclusively secreted from adipose tissue and modulates a number of metabolic processes. Nicotinic acid can affect adiponectin secretion. 3T3-L1 adipocytes were treated with nicotinic acid or with a control treatment and adiponectin concentration (pg/mL) measured. The data are in [adipocytes.txt](data-raw/adipocytes.txt). Each row represents an independent sample of adipocytes and the first column gives the concentration adiponectin and the second column indicates whether they were treated with nicotinic acid or not. Estimate the mean Adiponectin concentration in each group - this means calculate the sample mean and construct a confidence interval around it for each group. This exercise forces you to bring together ideas from this workshop and from previous workshops

- How to calculate a confidence intervals (this workshop)
- How to summarise variables in more than one group (previous workshop)

```{r}
#| output: false
# data import
adip <- read_table("data-raw/adipocytes.txt")
# examine the structure
str(adip)
# summarise
adip_summary <- adip %>%
group_by(treatment) %>%
summarise(mean = mean(adiponectin),
sd = sd(adiponectin),
n = length(adiponectin),
se = sd/sqrt(n),
dif = qt(0.975, df = n - 1) * se,
lower_ci = mean - dif,
uppp_ci = mean + dif)
# we conclude we're 95% certain the mean for the control group is
# between 4.73 and 6.36 and the mean for the nicotinic group is
# between 6.52 and 8.50. More usually we might put is like this:
# the mean for the control group is 5.55 +/- 0.82 and that for the nicotinic group is 7.51 +/- 0.99
```

12 changes: 12 additions & 0 deletions r4babs4/week-1/study_before_workshop.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "Independent Study to prepare for workshop"
subtitle: "The logic of hypothesis testing and confidence intervals"
toc: true
toc-location: right
---

1. 📖 Read [The logic of hyothesis testing](https://3mmarand.github.io/comp4biosci/logic_hyopthesis_testing.html)

2. 📖 Read [Confidence Intervals](https://3mmarand.github.io/comp4biosci/confidence_intervals.html)


Loading

0 comments on commit aa5e2a7

Please sign in to comment.