R Tutorial: The limma package
Skills:
ML Pipelines60%
Key Takeaways
The limma package in R for differential expression analysis, using empirical Bayes methods and linear models to identify differentially expressed genes between ER- and ER+ tumors in a breast cancer study.
Full Transcript
now you'll learn about the limo package for differential expression using the limo package for differential expression has multiple clear advantages over writing your own bespoke code first testing thousands of genes individually would require writing a loop with boilerplate code like counting variables thus obscuring the intent of the analysis every limo function performs its action on every gene in the dataset making it easier for you to write the code and easier for others to understand your analysis but it's not only more convenient for you it's also better statistics the loop in the code above treats every gene as a completely independent analysis but because all the genes were measured in the same experiment limo uses a statistical technique known as empirical base to share information across the genes which is especially helpful for studies with small sample sizes now empirical Bayes methods would deserve its own separate course so I won't elaborate more but know that not only are you getting convenience but also sophisticated statistics lastly lemma has many functions for processing the data before and after performing the differential expression test you'll learn about some of these in chapter 3 to get started using the limo package install it using BIOS Eli recall that the goal of the breast cancer study is to identify differentially expressed genes between er- tumors in which the estrogen receptor protein is absent versus ER positive tumors in which the estrogen receptor protein is present thus for each gene you need to fit the following linear model the response variable Y is the expression level of the given gene beta naught is the mean expression level of the gene in the ER negative tumors beta 1 is the mean difference in expression level of the gene in the ER positive tumors compared to the ER negative tumors explanatory variable x1 indicates er status an epsilon models the random noise you translate the statistical model to our code using the function model dot matrix in the formula syntax you use to create box plots however this time you only need to specify the explanatory variable the result is called a design matrix and limo will then apply this to every gene here I create a design matrix for the breast cancer data by including the column er as the explanatory variable I don't need to surround it in quotes because I specify the source of the data is the phenotype data frame each column of the design matrix corresponds to a coefficient in the linear model if the sample in a given row is modeled by this coefficient then it has the value 1 and 0 otherwise looking at the first two samples the intercept is 1 because it is 1 for all samples the first sample is er negative it has zero for beta1 conversely the second sample is they are positive and has one summing the columns of the design matrix is a good sanity check the number of samples modeled by the er coefficient should equal the number of er positive samples 209 now that you have specified a design matrix you can proceed with the standard limit pipeline first load the package second fit the coefficients of the model with LM fit by passing it the expression set object and design matrix third calculate the T statistics by passing it the fitted model object to the eBay's function lastly count the number of genes with higher or lower expression an ER positive tumors compared to ER negative there are 5000 for upregulated genes 6000 276 downregulated genes and 11,000 3g news expression level is not different between the tumors note that in a call to decide test I specified the coefficient er since it wouldn't be meaningful to test the intercept coefficient now it's your turn to build and test a model for the Lukey
Original Description
Want to learn more? Take the full course at https://learn.datacamp.com/courses/differential-expression-analysis-with-limma-in-r at your own pace. More than a video, you'll learn hands-on coding & quickly apply skills to your daily work.
---
Now you'll learn about the limma package for differential expression.
Using the limma package for differential expresssion has multiple clear advantages over writing your own bespoke code. First, testing thousands of genes individually would require writing a loop with boiler plate code, like counting variables, thus obscuring the intent of the analysis. Every limma function performs its action on every gene in the data set, making it easier for you to write the code and easier for others to understand your analysis.
But it's not only more convenient for you, it's also better statistics! The loop in the code above treats every gene as a completely independent analysis. But because all the genes were measured in the same experiment, limma uses a statistical technique known as empirical Bayes to share information across the genes, which is especially helpful for studies with small sample sizes. Now empirical Bayes methods would deserve its own separate course, so I won't elaborate more, but know that not only are you getting convenience, but also sophisticated statistics.
Lastly, limma has many functions for processing the data before and after performing the differential expression test. You'll learn about some of these in Chapter 3.
To get started using the limma package, install it using `biocLite`.
Recall that the goal of the breast cancer study is to identify differentially expressed genes between ER-negative tumors in which the estrogren receptor protein is absent versus ER-positive tumors in which the estrogren receptor protein is present. Thus for each gene you need to fit the following linear model: The response variable Y is the expression level of the given gene, beta-not is the mean expression level of the gene
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from DataCamp · DataCamp · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
SQL Server Tutorial: Date manipulation
DataCamp
R Tutorial: Intermediate Interactive Data Visualization with plotly in R
DataCamp
R Tutorial: Adding aesthetics to represent a variable
DataCamp
R Tutorial: Moving Beyond Simple Interactivity
DataCamp
Python Tutorial: Why use ML for marketing? Strategies and use cases
DataCamp
Python Tutorial: Preparation for modeling
DataCamp
Python Tutorial: Machine Learning modeling steps
DataCamp
R Tutorial: The prior model
DataCamp
R Tutorial: Data & the likelihood
DataCamp
R Tutorial: The posterior model
DataCamp
R Tutorial: An Introduction to plotly
DataCamp
R Tutorial: Plotting a single variable
DataCamp
R Tutorial: Bivariate graphics
DataCamp
Python Tutorial: Customer Segmentation in Python
DataCamp
Python Tutorial: Time cohorts
DataCamp
Python Tutorial: Calculate cohort metrics
DataCamp
Python Tutorial: Cohort analysis visualization
DataCamp
R Tutorial: Building Dashboards with flexdashboard
DataCamp
R Tutorial: Anatomy of a flexdashboard
DataCamp
R Tutorial: Layout basics
DataCamp
R Tutorial: Advanced layouts
DataCamp
Python Tutorial: Time Series Analysis in Python
DataCamp
Python Tutorial: Correlation of Two Time Series
DataCamp
Python Tutorial: Simple Linear Regressions
DataCamp
Python Tutorial: Autocorrelation
DataCamp
R Tutorial: The gapminder dataset
DataCamp
R Tutorial: The filter verb
DataCamp
R Tutorial: The arrange verb
DataCamp
R Tutorial: The mutate verb
DataCamp
R Tutorial: What is cluster analysis?
DataCamp
R Tutorial: Distance between two observations
DataCamp
R Tutorial: The importance of scale
DataCamp
R Tutorial: Measuring distance for categorical data
DataCamp
Python Tutorial: Plotting multiple graphs
DataCamp
Python Tutorial: Customizing axes
DataCamp
Python Tutorial: Legends, annotations, & styles
DataCamp
Python Tutorial: Introduction to iterators
DataCamp
Python Tutorial: Playing with iterators
DataCamp
Python Tutorial: Using iterators to load large files into memory
DataCamp
SQL Tutorial: Introduction to Relational Databases in SQL
DataCamp
SQL Tutorial: Tables: At the core of every database
DataCamp
SQL Tutorial: Update your database as the structure changes
DataCamp
Python Tutorial: Classification-Tree Learning
DataCamp
Python Tutorial: Decision-Tree for Classification
DataCamp
Python Tutorial: Decision-Tree for Regression
DataCamp
Python Tutorial: Census Subject Tables
DataCamp
Python Tutorial: Census Geography
DataCamp
Python Tutorial: Using the Census API
DataCamp
R Tutorial: A/B Testing in R
DataCamp
R Tutorial: Baseline Conversion Rates
DataCamp
R Tutorial: Designing an Experiment - Power Analysis
DataCamp
R Tutorial: Introduction to qualitative data
DataCamp
R Tutorial: Understanding your qualitative variables
DataCamp
R Tutorial: Making Better Plots
DataCamp
SQL Tutorial: OLTP and OLAP
DataCamp
SQL Tutorial: Storing data
DataCamp
SQL Tutorial: Database design
DataCamp
Python Tutorial: Introduction to spaCy
DataCamp
Python Tutorial: Statistical Models
DataCamp
Python Tutorial: Rule-based Matching
DataCamp
More on: ML Pipelines
View skill →Related Reads
📰
📰
📰
📰
AI-Ready Infrastructure: A Checklist Before You Scale
Dev.to AI
How I Cut My OpenAI Bill by 97% — The Full Migration Guide
Dev.to · rarenode
Your Website Passed Claude’s Search Test. It Might Still Fail the Other Two
Medium · AI
AI Made Creation Free. Taste Is What's Scarce Now
Forbes Innovation
🎓
Tutor Explanation
DeepCamp AI