R Code Module 3

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/83

encourage image

There's no tags or description

Looks like no tags are added yet.

84 Terms

1
New cards

SummarizedExperiment

An R object that combines assay data (the count matrix), ColData (sample metadata), and RowData (gene metadata)

2
New cards

Assay data

The count matrix representing the read counts for each gene in each sample

3
New cards

ColData

The sample metadata, also known as phenotype data

4
New cards

RowData

The gene metadata, also known as feature data

5
New cards

Count

based data

6
New cards

Over

dispersed data

7
New cards

Zero

inflated data

8
New cards

Library size dependent data

Data where the total counts vary between samples

9
New cards

DESeq2

The most popular package for differential expression analysis that models count data using negative binomial distributions, accounts for over

10
New cards

edgeR

An alternative R package approach for differential expression

11
New cards

limma

voom

12
New cards

sleuth

A tool used for transcript

13
New cards

airway

An R package containing an example RNA

14
New cards

ggplot2

An R package that creates publication

15
New cards

dplyr

An R package that provides tools for data manipulation and transformation

16
New cards

set.seed()

A function that ensures reproducible results by fixing the random number generator

17
New cards

data()

A function used to load datasets, such as the airway dataset, into R's workspace

18
New cards

class()

A function that shows what type of R object a variable is

19
New cards

dim()

A function that shows the dimensions of a dataset, such as the number of genes (rows) and samples (columns)

20
New cards

colData()

A function that accesses or extracts the sample metadata from a SummarizedExperiment object

21
New cards

str()

A function that shows the structure of an object, including column names and data types

22
New cards

colnames()

A function that gets the sample names or column names of the count matrix

23
New cards

table()

A function used to count occurrences, such as how many samples are in each treatment group

24
New cards

rowData()

A function that extracts gene metadata from the SummarizedExperiment object

25
New cards

assay()

A function that accesses the actual count matrix, which is the core RNA

26
New cards

head()

A function that shows the first few rows of data to help understand the available information

27
New cards

summary()

A function that provides a statistical summary of data, such as counts

28
New cards

is.na()

A function that checks for missing values in the count matrix

29
New cards

colSums()

A function that calculates library sizes by finding the total counts per sample

30
New cards

rowSums()

A function that calculates the total expression per gene across all samples

31
New cards

colMeans()

A function that calculates the average expression per sample to help identify samples with unusual expression patterns

32
New cards

data.frame()

A function that creates a data frame combining variables like library sizes and average expression with treatment information for plotting

33
New cards

ggplot()

A function that creates plots to visualize relationships between data points

34
New cards

scale_y_log10()

A ggplot function that uses a log scale for the y

35
New cards

read.csv()

A function used to load data from a CSV file

36
New cards

gsub()

A function used to clean strings, such as removing gene IDs after a pipe symbol

37
New cards

strsplit()

A function used to parse strings, such as splitting TCGA sample IDs to extract project and participant informatio

38
New cards
Library sizes
Total read counts per sample
39
New cards
Gene detection
Number of expressed genes per sample
40
New cards
Distribution of counts
How reads are distributed across genes
41
New cards
Sample correlation
Similarity between samples
42
New cards
airway
Contains the example RNA
43
New cards
SummarizedExperiment
Provides the data structure for storing RNA
44
New cards
ggplot2
Creates publication
45
New cards
dplyr
Provides tools for data manipulation and transformation
46
New cards
Base R heatmap()
Creates heatmaps for sample correlation and other QC visualizations
47
New cards
set.seed(123)
Ensures reproducible results for any random sampling
48
New cards
colSums(count_data)
Calculates library sizes (total read counts per sample) a key QC metric
49
New cards
summary(library_sizes)
Provides statistical summary (min, max, mean, median) of library sizes
50
New cards
range(library_sizes)
Shows the range of library sizes to identify extreme differences
51
New cards
sd(library_sizes)
Calculates standard deviation to measure variability between samples
52
New cards
data.frame()
Creates a data frame combining library sizes with treatment information for plotting
53
New cards
ggplot()
Creates boxplots to visualize library size distributions by treatment group and creates plots comparing raw vs normalized library sizes
54
New cards
log(count_data + 1)
Log
55
New cards
rowMeans(log_counts)
Calculates geometric mean of log
56
New cards
apply() with median calculation
Computes size factors using the DESeq2 method (median ratio method)
57
New cards
exp(size_factors)
Converts log
58
New cards
sweep(count_data, 2, size_factors, "/")
Applies normalization by dividing each sample by its size factor
59
New cards
cor()
Used to calculate correlations and assess similarity between samples
60
New cards
Principal Component Analysis (PCA)
A dimensionality reduction technique that reduces complexity by finding the main sources of variation, visualizes relationships between samples, identifies patterns in high
61
New cards
airway
Contains the example RNA
62
New cards
SummarizedExperiment
Provides the data structure for storing RNA
63
New cards
ggplot2
Creates publication
64
New cards
dplyr
Provides tools for data manipulation and transformation
65
New cards
ggrepel
Adds non
66
New cards
set.seed(123)
Ensures reproducible results for any random sampling
67
New cards
log2(normalized counts + 1)
Applies log2 transformation to reduce the influence of highly expressed genes
68
New cards
apply(log_normalized_counts, 1, var)
Calculates variance for each gene across samples to identify most variable genes
69
New cards
order(gene variances, decreasing = TRUE)
Ranks genes by variance (most variable first)
70
New cards
top_variable genes <
...
71
New cards
t(log_normalized_counts[top_variable_genes, ])
Transposes the data matrix so samples are rows and genes are columns (required for PCA)
72
New cards
prcomp(pca data, scale. = TRUE)
Performs PCA with scaling to give equal weight to all genes
73
New cards
Experimental factors
Treatment conditions, time points, dose levels
74
New cards
Technical factors
Batch effects, sequencing runs, sample processing dates
75
New cards
Biological factors
Individual differences, cell type heterogeneity, disease subtypes
76
New cards
Quality issues
Sample degradation, contamination, technical failures
77
New cards
Real
world data
78
New cards
Patient heterogeneity
Each sample represents a different individual with unique genetic backgrounds, ages, lifestyles, and disease progression
79
New cards
Technical variation
Samples were processed at different times, in different laboratories, using potentially different protocols
80
New cards
Biological complexity
Cancer is inherently heterogeneous, with multiple molecular subtypes and varying degrees of disease severity
81
New cards
Controlled experiment
The airway dataset comes from a carefully designed laboratory experiment
82
New cards
Minimal biological variation
Samples are from the same cell line, treated under controlled conditions
83
New cards
Standardized protocols
All samples were processed using identical methods and timing
84
New cards
Clear treatment groups
The experimental design creates distinct, well