Skip to content

Commit

Permalink
Edit vignettes and helpfiles (#144)
Browse files Browse the repository at this point in the history
* Check if target_dir has been passed as an argument

* Rewriting vignettes

* Updates NEWS

* Add spacing to tables in helpfiles
  • Loading branch information
rhenkin authored Feb 5, 2024
1 parent 62a82ba commit ceae04b
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 93 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

- Corrected Bioconductor package dependency (#136)

### DOCUMENTATION

- Edited vignettes for better reading (#143)
- Added friendlier error messages to functions that require target_dir

# shinyExprPortal 1.0.1

- Plots not shown when no groups are selected in overlay module (#131)
Expand Down
13 changes: 12 additions & 1 deletion R/create_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#' @importFrom cli cli_h1 cli_h2 cli_h3 cli_text cli_ol cli_alert_danger
#' cli_alert cli_alert_success cli_alert_info cli_abort
create_config_wizard <- function(target_dir) {
if (missing(target_dir)) {
stop(" The target_dir argument must be passed to the function. This is
the folder where your files have been placed.")
}
if (!interactive()) {
stop("create_config must be run in an interactive terminal")
}
Expand Down Expand Up @@ -129,7 +133,9 @@ the package website for a complete module configuration guide.")

cli::cli_text("If you have a separate file with metadata separate from the
measures, enter the name of the file. Leave it blank if you
don't have one.")
don't have one. The metadata file should have one row per
subject, in the samer order of the measures and no
identifier columns.")

metadata_file <- readline("Enter name of sample metadata file:")

Expand Down Expand Up @@ -236,6 +242,7 @@ the package website for a complete module configuration guide.")
cli::cli_alert_success("Done!")
}

if (continue_yn == "y") {
cli::cli_h3("Correlation modules")

cli::cli_text("The correlation modules will be set up to include all
Expand Down Expand Up @@ -343,6 +350,7 @@ the package website for a complete module configuration guide.")
cli::cli_alert("Creating {.file config.yaml} file in {.file {target_dir}}")
yaml::write_yaml(config, file.path(target_dir, "config.yaml"))
cli::cli_alert_success("Done!")
}
Sys.sleep(1)
cli::cli_alert("Creating {.file app.R} file in {.file {target_dir}}")
app_r <- file(file_path(target_dir, "app.R"))
Expand Down Expand Up @@ -382,6 +390,9 @@ the package website for a complete module configuration guide.")
#' @export
create_config_template <-
function(target_dir, filename = "config.yaml") {
if (missing(target_dir)) {
stop("target_dir must be passed as an argument to the function")
}
config <- list(
name = "REPLACE_WITH_PROJECT_NAME",
logo = "PROJECT_LOGO.png",
Expand Down
4 changes: 3 additions & 1 deletion inst/helpfiles/cohortOverview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Cohort overview

<style>
td { padding: 5px; border-spacing: 5px; }
</style>
This module shows a map of temporal trajectories for a selected measure over time. Each patient is represented by a small line, and the lines are ordered in a left-to-right, top-bottom manner. The measures shown over time are defined by the authors of the study shared in this portal.

<table>
Expand Down
4 changes: 3 additions & 1 deletion inst/helpfiles/compareTrajGroups.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Compare trajectories of groups

<style>
td { padding: 5px; border-spacing: 5px; }
</style>
This module displays scatterplots with the expression of a selected gene and a selected observed measure over time. Each scatterplot contains a subset of samples/patients that is defined by the study authors. This module is useful to see how expression changes over time relative to a measure such as disease activity.

<table>
Expand Down
4 changes: 3 additions & 1 deletion inst/helpfiles/degDetails.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Detailed results of differential expression analysis

<style>
td { padding: 5px; border-spacing: 5px; }
</style>
This module displays volcano plots and tables of results of differential expression models that have been precomputed and loaded by the study authors.

<table>
Expand Down
4 changes: 3 additions & 1 deletion inst/helpfiles/geneModulesHeatmap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Gene modules heatmap

<style>
td { padding: 5px; border-spacing: 5px; }
</style>
This module displays heatmaps and scatterplots of modules/clusters/groups of genes. The heatmaps show the expression, while the scatterplots (if defined by the study authors) show observed measures and the average module expression for each sample.

<table>
Expand Down
26 changes: 24 additions & 2 deletions inst/helpfiles/geneProjectionOverlay.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
### Gene projection overlay

<style>
td { padding: 5px; border-spacing: 5px; }
</style>
This module displays two scatterplots of a precomputed 2D projection of genes. The objective of the module is to allow the exploration of the relationship between the genes using a dimensionality reduction method and an expression overlay. In the overlay, the color of each projected gene is the average expression of the samples selected on the sidebar.

<table><colgroup><col style="width: 50%"/><col style="width: 60%"/></colgroup><tbody><tr> <td><img width="75%" src="geneProjectionOverlay-subset.png"></td> <td>On the sidebar, you can select the subset of samples that will be used to compute the average expression in the overlay.</td></tr><tr> <td><img width="75%" src="geneProjectionOverlay-options.png"></td> <td>The checkboxes allow you to select gene groups to hide from the scatterplot.</td></tr><tr> <td><img width="100%" src="geneProjectionOverlay-plot.png"></td> <td>In the scatterplot, you can click on a single point to highlight that group of genes. All other groups will be displayed in gray. Once you click on a group, you can also click on the buttons below the scatterplots to view the genes that are in that group and the heatmap with the expression of the genes. Please note that if the groups are too big the heatmap may become unreadable.</td></tr></tbody></table>
<table>
<colgroup>
<col style="width: 50%"/>
<col style="width: 60%"/>
</colgroup>
<tbody>
<tr>
<td><img width="75%" src="geneProjectionOverlay-subset.png"></td>
<td>On the sidebar, you can select the subset of samples that will be used to compute the average expression in the overlay.</td>
</tr>
<tr>
<td><img width="75%" src="geneProjectionOverlay-options.png"></td>
<td>The checkboxes allow you to select gene groups to hide from the scatterplot.</td>
</tr>
<tr>
<td><img width="100%" src="geneProjectionOverlay-plot.png"></td>
<td>In the scatterplot, you can click on a single point to highlight that group of genes. All other groups will be displayed in gray. Once you click on a group, you can also click on the buttons below the scatterplots to view the genes that are in that group and the heatmap with the expression of the genes. Please note that if the groups are too big the heatmap may become unreadable.</td>
</tr>

</tbody>
</table>

Module name in configuration file: *geneModulesHeatmap*
4 changes: 3 additions & 1 deletion inst/helpfiles/multiMeasureCorr.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Correlations between all genes and multiple measures

<style>
td { padding: 5px; border-spacing: 5px; }
</style>
This module allows you to explore the relationship between the expression of all genes and sets of measures through correlation, with results displayed on a heatmap.

<table>
Expand Down
4 changes: 3 additions & 1 deletion inst/helpfiles/singleGeneCorr.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Correlations between single gene and measures

<style>
td { padding: 5px; border-spacing: 5px; }
</style>
This module allows you to explore the relationship between the expression of a single gene and various observed measures through scatterplots and correlation measures.

<table>
Expand Down
4 changes: 3 additions & 1 deletion inst/helpfiles/singleMeasureCorr.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Correlations between single measure and all genes

<style>
td { padding: 5px; border-spacing: 5px; }
</style>
This module allows you to explore the relationship between the expression of all genes and a single observed measure through correlation.

<table>
Expand Down
Loading

0 comments on commit ceae04b

Please sign in to comment.