Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Rpkg/.Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
^\.gitignore$
^\.gitattributes$
^\.gitmodules$
^coherence_internal\.md$

# Python package and related files
^python/
Expand Down Expand Up @@ -58,6 +59,8 @@
^scratch/
^tmp/
^temp/
^analysis/.*\.md$
^analysis/.*\.html$

# Build artifacts
^.*\.tar\.gz$
Expand Down
Binary file not shown.
Binary file not shown.
Binary file removed Rpkg/analysis/R/hClust/RawZHeatmapAll-1.pdf
Binary file not shown.
Binary file removed Rpkg/analysis/R/hClust/RawZHeatmapAll-1.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Rpkg/analysis/R/hClust/RawZHeatmapTMEMModule-1.png
Binary file not shown.
1 change: 1 addition & 0 deletions Rpkg/vignettes/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.RData
.Ruserdata
inst/doc
coherence_internal.md
81 changes: 52 additions & 29 deletions Rpkg/vignettes/HierarchicalClustering.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
title: "IMPS Hierarchical Clustering"
title: "Hierarchical Clustering vignette"
author: "Erik Larsen"
date: "`r Sys.Date()`"
always_allow_html: true
output:
html_document:
toc: true
Expand Down Expand Up @@ -75,7 +76,6 @@ library(visNetwork)
options(stringsAsFactors = FALSE)
```


## Load the Pre-Computed Data

```{r Data Load}
Expand All @@ -85,7 +85,6 @@ load("../../analysis/R/precompute_objects.rda")

```{r Second Data Load, echo = FALSE}
rm(IPMS_mat_log)

```


Expand Down Expand Up @@ -189,24 +188,24 @@ if (identical(fmt, "html")) {
}
```
In order to assess this method and also to compare/validate the hierarchical SAINT
model, describing modules/clusters based on the proteins in them is useful.
model, describing modules/clusters based on the proteins in them is useful

Similarly localized proteins could be expected to have similar abundances to
each other as well as the target (**TMEM184B**).
each other as well as the target (**TMEM184B**)

Similar functioning proteins could also be expected to have similar abundances
to each other as well as the target.
to each other as well as the target

Describing these modules/clusters attained by `hierarchical clustering` via
gene ontology gene set enrichment analysis is, therefore, useful and standard
practice.
practice

Furthermore, we may be able to assemble a `protein-protein interaction network`
from the results.
from the results

I outline this below-- the methods and results for acquiring these modules,
their constituent proteins, and how we make sense of them-- visualized as
`dotplots`, `heatmaps`, and a `network`. I include searchable tables printed last.
`dotplots`, `heatmaps`, and a `network`. I include searchable tables printed last

## Extract Modules

Expand Down Expand Up @@ -657,13 +656,19 @@ global_enrichment_results_df |>
strip.background = ggplot2::element_rect(color = 'black',
fill = 'white')) +
ggplot2::guides(#shape = ggplot2::guide_legend(override.aes = list(size = 4, shape = c(19, 17))),
color = ggplot2::guide_legend(override.aes = list(size = 4, shape = 19, color = c('navy', 'darkgoldenrod3', 'firebrick'))),
alpha = ggplot2::guide_legend(override.aes = list(size = 5, shape = 19)),
color = ggplot2::guide_legend(override.aes = list(size = 4,
shape = 19,
color = c('navy',
'darkgoldenrod3',
'firebrick'))),
alpha = ggplot2::guide_legend(override.aes = list(size = 5,
shape = 19)),
size = ggplot2::guide_legend(override.aes = list(shape = 19))
# size = 'none'
) +
ggplot2::scale_color_manual(values = c('navy', 'darkgoldenrod3', 'firebrick')) +
ggplot2::scale_fill_manual(values = c('navy', 'darkgoldenrod3', 'firebrick'))
ggplot2::scale_fill_manual(values = c('navy',
'darkgoldenrod3',
'firebrick'))
```

## Module GO (similarity) Network
Expand Down Expand Up @@ -817,7 +822,9 @@ if (identical(fmt, "html")) {
```{r RawZHeatmapAll, render = T}
pheatmap::pheatmap(
IPMS_z_ordered,
color = grDevices::colorRampPalette(c('navy', 'white', 'darkgoldenrod'))((200)),
color = grDevices::colorRampPalette(c('navy',
'white',
'darkgoldenrod'))((200)),
cluster_rows = hc,
cluster_cols = F,
show_rownames = F,
Expand Down Expand Up @@ -852,7 +859,9 @@ pheatmap::pheatmap(
dplyr::pull(Protein)
),
],
color = grDevices::colorRampPalette(c('navy', 'white', 'darkgoldenrod'))((200)),
color = grDevices::colorRampPalette(c('navy',
'white',
'darkgoldenrod'))((200)),
cluster_rows = T,
cluster_cols = F,
show_rownames = T,
Expand Down Expand Up @@ -901,7 +910,9 @@ pheatmap::pheatmap(
grepl(classification,
pattern = 'High SAINT, Low')) |>
dplyr::pull(Protein)),],
color = grDevices::colorRampPalette(c('navy', 'white', 'darkgoldenrod'))((200)),
color = grDevices::colorRampPalette(c('navy',
'white',
'darkgoldenrod'))((200)),
cluster_rows = T,
cluster_cols = F,
show_rownames = F,
Expand Down Expand Up @@ -937,7 +948,9 @@ pheatmap::pheatmap(
grepl(classification,
pattern = 'High SAINT, High')) |>
dplyr::pull(Protein)),],
color = grDevices::colorRampPalette(c('navy', 'white', 'darkgoldenrod'))((200)),
color = grDevices::colorRampPalette(c('navy',
'white',
'darkgoldenrod'))((200)),
cluster_rows = T,
cluster_cols = F,
show_rownames = F,
Expand All @@ -955,7 +968,10 @@ pheatmap::pheatmap(
]
),

annotation_colors = list(Module = c('darkorange', 'darkviolet', 'lightpink', 'skyblue')),
annotation_colors = list(Module = c('darkorange',
'darkviolet',
'lightpink',
'skyblue')),
angle_col = 90,
use_raster = F,
border_color = NA,
Expand All @@ -973,7 +989,9 @@ pheatmap::pheatmap(
grepl(classification,
pattern = 'Low SAINT, Low')) |>
dplyr::pull(Protein)),],
color = grDevices::colorRampPalette(c('navy', 'white', 'darkgoldenrod'))((200)),
color = grDevices::colorRampPalette(c('navy',
'white',
'darkgoldenrod'))((200)),
cluster_rows = T,
cluster_cols = F,
show_rownames = F,
Expand Down Expand Up @@ -1016,7 +1034,9 @@ pheatmap::pheatmap(
grepl(classification,
pattern = 'Low SAINT, High')) |>
dplyr::pull(Protein)),],
color = grDevices::colorRampPalette(c('navy', 'white', 'darkgoldenrod'))((200)),
color = grDevices::colorRampPalette(c('navy',
'white',
'darkgoldenrod'))((200)),
cluster_rows = T,
cluster_cols = F,
show_rownames = F,
Expand Down Expand Up @@ -1058,7 +1078,7 @@ if (identical(fmt, "html")) {
} else if (identical(fmt, "markdown")) {
cat('<details><summary><strong>Results Tables</strong></summary>\n')
} else {
cat('#Results Tables\n')
cat('# Results Tables\n')
}
```

Expand All @@ -1081,15 +1101,18 @@ DT::datatable(
score_mass), ~paste0("module_", .x)) |>
dplyr::filter(!is.na(GO_Term)) |>
dplyr::filter(!is.na(GO_Category)) |>
dplyr::filter((grepl(module, pattern = '12') &
hSAINT_score > 0.5) |
(grepl(classification,
pattern = 'High SAINT, Low') &
hSAINT_score > 0.5)
)
)
dplyr::filter( (grepl(module,
pattern = '12') &
hSAINT_score > 0.5) |
(grepl(classification,
pattern = 'High SAINT, Low') &
hSAINT_score > 0.5)
)
)
```

This (complete) table exists as [hClust_protein_level_GO_GSEA.rda](../../analysis/R/hClust/hClust_protein_level_GO_GSEA.rda) in [Endo/analysis/R/hClust/](../../analysis/R/hClust)

## Clustering Results Table by Module

```{r Print Module Level Results Table}
Expand All @@ -1107,7 +1130,7 @@ DT::datatable(
)
```


This table exists as [hClust_module_level_GO_GSEA.rda](../../analysis/R/hClust/hClust_module_level_GO_GSEA.rda) in [Endo/analysis/R/hClust/](../../analysis/R/hClust)

```{r, results='asis', echo=FALSE}
fmt <- knitr::pandoc_to()
Expand Down
8,366 changes: 8,366 additions & 0 deletions analysis/HierarchicalClustering.html

Large diffs are not rendered by default.

Loading
Loading