Skip to content

Commit

Permalink
update Liver vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
cstubben committed Feb 17, 2021
1 parent fe5b722 commit c2a9309
Show file tree
Hide file tree
Showing 20 changed files with 53,968 additions and 53,923 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Encoding: UTF-8
Description: This package loads output from RNA-seq workflows to create interactive graphics and reports.
LazyData: true
biocViews: Software
RoxygenNote: 7.0.2
RoxygenNote: 7.1.1
4 changes: 3 additions & 1 deletion R/write_deseq.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ write_deseq <- function(result_all, dds, rld, biomart, sets, fpkm,
names(res1) <- gsub( "\\.? ", "_", names(res1))
## forward slash will cause Excel errors
names(res1) <- gsub( "/", "", names(res1))
# A worksheet name cannot exceed 31 characters.
# also not allowed \ * [ ] : ?

# Worksheet names cannot exceed 31 characters.
if(any(nchar(names(res1)) > 31)){
message("Note: some contrast names are longer than the 31 characters and will be truncated")
z <- substr(names(res1), 1, 31)
Expand Down
107,604 changes: 53,802 additions & 53,802 deletions inst/extdata/liver_counts.tsv

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions inst/extdata/liver_samples.tsv
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
id name trt diet
15089X1 194-Liver Control NCD
15089X2 198-Liver Control NCD
15089X3 209-Liver Control NCD
15089X4 220-Liver Control NCD
15089X5 179-Liver Degs1_KO NCD
15089X6 185-Liver Degs1_KO NCD
15089X7 186-Liver Degs1_KO NCD
15089X8 187-Liver Degs1_KO NCD
15089X9 61-Liver Control HFD
15089X10 70-Liver Control HFD
15089X11 71-Liver Control HFD
15089X12 76-Liver Control HFD
15089X13 82-Liver Degs1_KO HFD
15089X14 89-Liver Degs1_KO HFD
15089X15 90-Liver Degs1_KO HFD
15089X16 92-Liver Degs1_KO HFD
4 changes: 3 additions & 1 deletion man/pasilla.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions man/plot_fgsea.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/reexports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion man/write_gsea_rnk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/write_ipa.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 21 additions & 10 deletions vignettes/Liver.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ options(width=120)
knitr::opts_chunk$set(warning=FALSE, comment="# ", collapse=TRUE)
```

This guide follows the [Bioconductor RNA-Seq workflow] to find differentially expressed
genes using [DESeq2] version `r gsub("‘’", "", packageVersion("DESeq2"))`. For more details about the
statistics, check the original [paper] or online tutorials like the one from [Harvard].


This guide follows the [Bioconductor RNA-Seq workflow] to find differentially
expressed genes in [GSE132056] using [DESeq2] version `r gsub("‘’", "",
packageVersion("DESeq2"))`. For more details about the statistics, check the
original [paper] or online tutorials like the one from [Harvard].


### Load samples and counts
Expand All @@ -41,8 +44,8 @@ counts[, 1:8]
```


Remove 18059 features with zero counts and 16304 features with 5 or fewer reads
in every sample to create a final count matrix with 19438 rows.
Remove 17597 features with zero counts and 16431 features with 5 or fewer reads
in every sample to create a final count matrix with 19773 rows.


```{r count_matrix}
Expand All @@ -60,10 +63,16 @@ library(hciRdata)
n1 <- rowMeans(as_matrix(counts))
inner_join( dplyr::select(mouse92, 1:4,8),
tibble(id= names(n1), mean_count = n1)) %>%
mutate(description=substr(description, 1, 40)) %>%
mutate(description=trimws(substr(description, 1, 40))) %>%
arrange(desc(mean_count))
```

Drop the two MT rRNAs.

```{r dropmt}
counts <- semi_join(counts, filter(mouse92, biotype!="Mt_rRNA"), by=c(geneid="id"))
```



Following the DESeq2 vignette on [interactions], there are a few ways to model the data.
Expand Down Expand Up @@ -181,7 +190,7 @@ rld2 <- r_log(dds2)
```

Check if the treatment effect differs across diets using a 5% false discovery rate (FDR).
There are 98 signfiicant interactions.
There are 105 signfiicant interactions.

```{r summary1}
DESeq2::resultsNames(dds2)
Expand Down Expand Up @@ -213,8 +222,8 @@ binary data file to load into a new session.

```{r write_results_to_Excel, eval=FALSE}
res_all <- c(res, list(Interactions=int))
write_deseq(res_all, dds, rld, mouse92)
save(res, int, dds, rld, file="dds.rda")
write_deseq(res_all, dds1, rld1, mouse92)
save(res, int, dds1, rld1, dds2, rld2, file="dds.rda")
```


Expand Down Expand Up @@ -275,7 +284,7 @@ ggplot2::labs(title="ECM Receptor Interaction")

Plot NES scores from significant pathways in two or more contrasts.

```{r plotfgsea, fig.height=8, fig.width=3.75}
```{r plotfgsea, fig.height=9, fig.width=3.75}
plot_fgsea(k1, fontsize_row=7, sets =2)
```

Expand Down Expand Up @@ -308,6 +317,8 @@ names(msig_cancer)

<br>


[GSE132056]: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE132056
[Harvard]: https://hbctraining.github.io/DGE_workshop/lessons/04_DGE_DESeq2_analysis.html
[paper]: https://genomebiology.biomedcentral.com/articles/10.1186/s13059-014-0550-8
[Correlation Engine]: https://hci.ussc.informatics.illumina.com/
Expand Down
Loading

0 comments on commit c2a9309

Please sign in to comment.