Skip to content

Commit

Permalink
Auto-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lcolladotor committed Jul 3, 2023
1 parent 62a703f commit 6084f4d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions 01_SPEAQeasy.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## ----download_data_biocfilecache_speaqeasy_example-------------------
## ----download_data_biocfilecache_speaqeasy_example---------------
## Load the container package for this type of data
library("SummarizedExperiment")

Expand All @@ -23,7 +23,7 @@ rse_gene
lobstr::obj_size(rse_gene)


## --------------------------------------------------------------------
## ----------------------------------------------------------------
class(rse_gene$trimmed)

## logical vectors can take 2 values (plus the third `NA` if it's missing)
Expand Down
42 changes: 21 additions & 21 deletions 06_smokingMouse_plotting_basics.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## ----download_data_biocfilecache_repeat------------------------------
## ----download_data_biocfilecache_repeat--------------------------
## Load the container package for this type of data
library("SummarizedExperiment")

Expand All @@ -20,7 +20,7 @@ load(cached_rse_gene, verbose = TRUE)
rse_gene_nic <- rse_gene[, which(rse_gene$Expt == "Nicotine")]


## ----Data preparation, message=FALSE, warning=FALSE------------------
## ----Data preparation, message=FALSE, warning=FALSE--------------
library("ggplot2")

## Histogram and density plot of read counts before and after normalization
Expand All @@ -43,7 +43,7 @@ plot <- ggplot(logcounts_data, aes(x = logcounts)) +
plot + theme(plot.margin = unit(c(2, 4, 2, 4), "cm"))


## ---- message=FALSE, warning=FALSE----------------------------------
## ---- message=FALSE, warning=FALSE------------------------------
## Retain genes that passed filtering step
rse_gene_filt <- rse_gene_nic[rowData(rse_gene_nic)$retained_after_feature_filtering == TRUE, ]

Expand All @@ -59,7 +59,7 @@ plot <- ggplot(filt_logcounts_data, aes(x = logcounts)) +
plot + theme(plot.margin = unit(c(2, 4, 2, 4), "cm"))


## ----QC_boxplots, message=FALSE, warning=FALSE----------------------
## ----QC_boxplots, message=FALSE, warning=FALSE------------------
library("Hmisc")
library("stringr")
library("cowplot")
Expand Down Expand Up @@ -156,31 +156,31 @@ multiple_QC_boxplots <- function(sample_var) {
}


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_boxplots("Age")


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_boxplots("Sex")


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_boxplots("Group")


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_boxplots("Pregnancy")


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_boxplots("plate")


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_boxplots("flowcell")


## ----"QC scatterplots", message=FALSE, warning=FALSE-----------------
## ----"QC scatterplots", message=FALSE, warning=FALSE-------------
## Scatterplots for a pair of QC metrics

QC_scatterplots <- function(sample_var, qc_metric1, qc_metric2) {
Expand Down Expand Up @@ -254,23 +254,23 @@ multiple_QC_scatterplots <- function(qc_metric1, qc_metric2) {
}


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_scatterplots("mitoRate", "rRNA_rate")


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_scatterplots("mitoRate", "totalAssignedGene")


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_scatterplots("sum", "detected")


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_scatterplots("sum", "totalAssignedGene")


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
multiple_QC_scatterplots("detected", "totalAssignedGene")


Expand All @@ -280,7 +280,7 @@ multiple_QC_scatterplots("detected", "totalAssignedGene")
## ## Because in mitoMapped you take reads that mapped to the whole mt chr, in subsets_Mito_sum only reads that were aligned to mt genes. But there's almost a perfect correlation between these two metrics.


## ----"QC sample filtering", message=FALSE, warning=FALSE-------------
## ----"QC sample filtering", message=FALSE, warning=FALSE---------
library("scater")
library("rlang")
library("ggrepel")
Expand Down Expand Up @@ -368,7 +368,7 @@ rse_gene_pups$Retention_after_QC_filtering <- as.vector(sapply(rse_gene_pups$SAM
}))


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
## Boxplots of QC metrics after sample filtering

## Boxplots
Expand Down Expand Up @@ -432,21 +432,21 @@ boxplots_after_QC_filtering <- function(rse_gene, qc_metric, sample_var) {
}


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
## Plots

## All samples together
p <- boxplots_after_QC_filtering(rse_gene_filt, "mitoRate", "Age")
p + theme(plot.margin = unit(c(2, 4, 2, 4), "cm"))


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
## Adult samples
p <- boxplots_after_QC_filtering(rse_gene_adults, "mitoRate", "Group")
p + theme(plot.margin = unit(c(2, 4, 2, 4), "cm"))


## ----message=FALSE, warning=FALSE------------------------------------
## ----message=FALSE, warning=FALSE--------------------------------
## Pup samples
p <- boxplots_after_QC_filtering(rse_gene_pups, "rRNA_rate", "Group")
p + theme(plot.margin = unit(c(2, 4, 2, 4), "cm"))
Expand Down
6 changes: 3 additions & 3 deletions index.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## ----install, eval = FALSE-------------------------------------------
## ----install, eval = FALSE---------------------------------------
## ## For installing Bioconductor packages
## if (!requireNamespace("BiocManager", quietly = TRUE)) {
## install.packages("BiocManager")
Expand Down Expand Up @@ -43,7 +43,7 @@
## BiocManager::install("LieberInstitute/smokingMouse")


## ----session_packages, eval = TRUE, message = FALSE------------------
## ----session_packages, eval = TRUE, message = FALSE--------------
## Load the package at the top of your script
library("sessioninfo")

Expand Down Expand Up @@ -92,7 +92,7 @@ library("ggrepel")
library("spatialLIBD")


## ----session_info----------------------------------------------------
## ----session_info------------------------------------------------
## Reproducibility information
options(width = 120)
session_info()
Expand Down

0 comments on commit 6084f4d

Please sign in to comment.