Skip to content

Commit

Permalink
Fixed minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
msauria committed Oct 10, 2024
1 parent 5519dae commit 0bb57af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions assignments/lab/bulk_RNA-seq_part1/assignment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Before loading the data, you will first need to load the following libraries:
- matrixStats
- readr
- dplyr
- tibble
- ggfortify

Now, using the `readr::read_tsv` function, load the file `salmon.merged.gene_counts.tsv`. You will want to use the column `gene_name` as the row names. You will also want to use `dplyr::select` to remove the column `gene_id`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# install new packages
BiocManager::install("DESeq2")
BiocManager::install("vsn")
install.packages("ggfortify")
install.packages("hexbin")

# Load libraries we'll need
library(DESeq2)
library(vsn)
library(matrixStats)
library(readr)
library(dplyr)
library(tibble)
library(hexbin)
library(ggfortify)

# Load tab-separated data file
Expand Down Expand Up @@ -36,7 +40,7 @@ broad_metadata = tibble(tissue=as.factor(c("A1_3", "A1_3", "A1_3", "Cu_LFC_Fe",
broaddata = DESeqDataSetFromMatrix(countData=as.matrix(broad), colData=broad_metadata, design=~tissue)

# Plot variance by average
meanSdPlot(assay(broadLogdata))
meanSdPlot(assay(broaddata))

# Log transform data
broadLogdata = normTransform(broaddata) # log(1 + data)
Expand Down Expand Up @@ -66,9 +70,9 @@ ggplot(broadPcaData, aes(PC1, PC2, color=tissue, shape=rep)) +
broadVstdata = as.matrix(assay(broadVstdata[sds>1,]))

# Find replicate means
combined = broadVstdata[,seq(1, 21, 3)]
combined = combined + broadVstdata[,seq(2, 21, 3)]
combined = combined + broadVstdata[,seq(3, 21, 3)]
combined = broadVstdata[,seq(1, 9, 3)]
combined = combined + broadVstdata[,seq(2, 9, 3)]
combined = combined + broadVstdata[,seq(3, 9, 3)]
combined = combined / 3

# Use replicate means to filter low variance genes out
Expand Down

0 comments on commit 0bb57af

Please sign in to comment.