Skip to content

Commit

Permalink
Updated README and vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Rauter committed Jun 11, 2024
1 parent 81db377 commit b5574d2
Show file tree
Hide file tree
Showing 147 changed files with 14,615 additions and 708 deletions.
109 changes: 53 additions & 56 deletions R/create_limma_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,58 +52,62 @@ create_limma_report <- function(run_limma_splines_result,
}
###


plots <- c(plots, list("Average Difference Conditions"))
plots_sizes <- c(plots_sizes, 999)

header_info <- list(header_name = "Average Difference Conditions")
section_headers_info <- c(section_headers_info, list(header_info))

for (i in seq_along(avrg_diff_conditions)) {
element_name <- names(avrg_diff_conditions)[i]
top_table <- avrg_diff_conditions[[i]]
# length == 0 when there was just one level or no interaction effect
if (length(avrg_diff_conditions) > 0) {

comparison <- remove_prefix(element_name, "avrg_diff_")
title <- paste("P-Value Histogram:", comparison)
plots <- c(plots, list("Average Difference Conditions"))
plots_sizes <- c(plots_sizes, 999)

p_value_hist <- create_p_value_histogram(top_table = top_table,
adj_pthresh = adj_pthresh,
title = title)
header_info <- list(header_name = "Average Difference Conditions")
section_headers_info <- c(section_headers_info, list(header_info))

compared_levels <- stringr::str_split(comparison, "_vs_")[[1]]

volcano_plot <- create_volcano_plot(top_table = top_table,
adj_pthresh = adj_pthresh,
compared_levels)

plots <- c(plots, list(p_value_hist), list(volcano_plot))
plots_sizes <- c(plots_sizes, 1, 1.5)
for (i in seq_along(avrg_diff_conditions)) {
element_name <- names(avrg_diff_conditions)[i]
top_table <- avrg_diff_conditions[[i]]

comparison <- remove_prefix(element_name, "avrg_diff_")
title <- paste("P-Value Histogram:", comparison)

p_value_hist <- create_p_value_histogram(top_table = top_table,
adj_pthresh = adj_pthresh,
title = title)

compared_levels <- stringr::str_split(comparison, "_vs_")[[1]]

volcano_plot <- create_volcano_plot(top_table = top_table,
adj_pthresh = adj_pthresh,
compared_levels)

plots <- c(plots, list(p_value_hist), list(volcano_plot))
plots_sizes <- c(plots_sizes, 1, 1.5)
}
}
###


plots <- c(plots, list("Interaction of Condition and Time"))
plots_sizes <- c(plots_sizes, 999)

header_info <- list(header_name = "Interaction of Condition and Time")
section_headers_info <- c(section_headers_info, list(header_info))

# length == 0 when there was just one level or no interaction effect
if (length(interaction_condition_time) > 0) {

for (i in seq_along(interaction_condition_time)) {
element_name <- names(interaction_condition_time)[i]
title <- paste(element_name, ": Adj. p-value vs. F-statistic")
top_table <- interaction_condition_time[[i]]

comparison <- remove_prefix(element_name, "time_interaction_")
title <- paste("P-Value Histogram:", comparison)
plots <- c(plots, list("Interaction of Condition and Time"))
plots_sizes <- c(plots_sizes, 999)

p_value_hist <- create_p_value_histogram(top_table = top_table,
adj_pthresh = adj_pthresh,
title = title)
header_info <- list(header_name = "Interaction of Condition and Time")
section_headers_info <- c(section_headers_info, list(header_info))

plots <- c(plots, list(p_value_hist))
plots_sizes <- c(plots_sizes, 1)
for (i in seq_along(interaction_condition_time)) {
element_name <- names(interaction_condition_time)[i]
title <- paste(element_name, ": Adj. p-value vs. F-statistic")
top_table <- interaction_condition_time[[i]]

comparison <- remove_prefix(element_name, "time_interaction_")
title <- paste("P-Value Histogram:", comparison)

p_value_hist <- create_p_value_histogram(top_table = top_table,
adj_pthresh = adj_pthresh,
title = title)

plots <- c(plots, list(p_value_hist))
plots_sizes <- c(plots_sizes, 1)
}
}
###

all_top_tables <- c(time_effect,
avrg_diff_conditions,
Expand Down Expand Up @@ -269,10 +273,10 @@ shorten_names <- function(name,
#' \code{\link{plot2base64}}, \code{\link{create_progress_bar}}
#'
build_create_limma_report <- function(header_section,
plots,
plots_sizes,
level_headers_info,
output_file_path = here::here()) {
plots,
plots_sizes,
level_headers_info,
output_file_path = here::here()) {

html_content <- paste(header_section, "<!--TOC-->", sep = "\n")

Expand Down Expand Up @@ -319,13 +323,7 @@ build_create_limma_report <- function(header_section,
next
}
}

# Process each plot
# plot <- plots[[index]]
# plot_size <- plots_sizes[[index]]
# img_tag <- plot2base64(plot, plot_size)
# html_content <- paste(html_content, img_tag, sep="\n")


html_content <- process_plots(plots = plots,
plots_sizes = plots_sizes,
index = index,
Expand All @@ -349,6 +347,5 @@ build_create_limma_report <- function(header_section,
dir.create(dir_path, recursive = TRUE)
}

# Write the HTML content to file
writeLines(html_content, output_file_path)
}
8 changes: 2 additions & 6 deletions R/screen_limma_hyperparams.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ screen_limma_hyperparams <- function(datas,
adj_pthresholds = c(0.05),
meta_batch_column = NA, # batch-effect
meta_batch2_column = NA,
time_unit = "m", # For the plot labels
time_unit = "min", # For the plot labels
padjust_method = "BH") {

modes <- c()
Expand Down Expand Up @@ -104,7 +104,6 @@ screen_limma_hyperparams <- function(datas,
spline_test_configs = spline_test_configs,
meta_batch_column = meta_batch_column,
meta_batch2_column = meta_batch2_column,
# designs,
time_unit = time_unit)

timestamp <- format(Sys.time(), "%d_%m_%Y-%H_%M_%S")
Expand Down Expand Up @@ -225,7 +224,6 @@ plot_limma_combos_results <- function(top_tables_combos,
spline_test_configs,
meta_batch_column,
meta_batch2_column,
# designs,
time_unit = time_unit) {

names_extracted <- stringr::str_extract(names(top_tables_combos),
Expand All @@ -246,9 +244,7 @@ plot_limma_combos_results <- function(top_tables_combos,
format = "[:bar] :percent")
pb$tick(0)

time_unit_labels <- c("s" = "[sec]", "m" = "[min]", "h" = "[hours]",
"d" = "[days]")
time_unit_label <- time_unit_labels[time_unit]
time_unit_label <- paste0("[", time_unit, "]")

if (!is.na(meta_batch_column)) {

Expand Down
3 changes: 2 additions & 1 deletion R/utils_input_validation.R
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,8 @@ InputControl <- R6::R6Class("InputControl",
if (!is.character(time_unit) ||
length(time_unit) != 1 ||
nchar(time_unit) > 15) {
stop(paste0("time_unit must be a single character with < 16 letters"),
stop(paste0("time_unit must be a single character vector with",
"< 16 letters"),
call. = FALSE)
}
},
Expand Down
27 changes: 23 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ knitr::opts_chunk$set(

# SplineOmics <img src="man/figures/hex_logo.png" style="float: right; width: 150px; margin-left: 300px; vertical-align: middle;"/>

![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) ![Maintained? Yes](https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg)
![Version](https://img.shields.io/badge/version-0.1.0-blue) ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg) ![Maintained? Yes](https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg) ![R CMD Check](https://img.shields.io/badge/R%20CMD%20check-passed-brightgreen) [![Docker](https://img.shields.io/badge/docker-pull-blue)](https://ghcr.io/thomas-rauter/splineomics:0.1.0)

The R package `SplineOmics` gets the significant features (hits) of time-series omics data by using splines and limma for hypothesis testing and clusters the hits based on the spline shape, showing all results in HTML reports.

Expand All @@ -28,8 +28,10 @@ The R package `SplineOmics` gets the significant features (hits) of time-series
- [📦 Dependencies](#-dependencies)
- [❓ Getting Help](#-getting-help)
- [🤝 Contributing](#-contributing)
- [💬 Feedback](#-feedback)
- [📜 License](#-license)
- [🎓 Citation](#-citation)
- [🌟 Contributors](#-contributors)

## 📘 Introduction {#introduction}

Expand Down Expand Up @@ -153,7 +155,7 @@ docker run -it -d \
-v $(pwd)/output:/home/rstudio/output \
-p 8888:8787 \
-e PASSWORD=password \
--name splineomics_container \
--name splineomics \
thomasrauter/splineomics:0.1.0
```

Expand All @@ -162,13 +164,13 @@ Once the container is running, open a web browser and navigate to <http://localh
Stop the container:

``` sh
docker stop splineomics_container
docker stop splineomics
```

Start the container again:

``` sh
docker start splineomics_container
docker start splineomics
```

### Inspect Docker container installations
Expand Down Expand Up @@ -245,6 +247,16 @@ Please adhere to our [Code of Conduct](CODE_OF_CONDUCT.md) in all your interacti

Thank you for considering contributing to `SplineOmics`. Your efforts are what make the open-source community a fantastic place to learn, inspire, and create.

## 💬 Feedback

We appreciate your feedback! Besides raising issues, you can provide feedback in the following ways:

- **Direct Email**: Send your feedback directly to [Thomas Rauter](mailto:thomas.rauter@plus.ac.at).

- **Anonymous Feedback**: Use [this Google Form](https://forms.gle/jocMXSxLf3GrGBdT9) to provide anonymous feedback by answering questions.

Your feedback helps us improve the project and address any issues you may encounter.

## 📜 License {#license}

This package is licensed under the MIT License: [LICENSE](./LICENSE)
Expand All @@ -256,3 +268,10 @@ This package is licensed under the MIT License: [LICENSE](./LICENSE)
The `SplineOmics` package is currently not published in a peer-reviewed scientific journal or similar outlet. However, if this package helped you in your work, consider citing this GitHub repository.

Also, if you like the package, consider giving the GitHub repository a star. Your support helps us in the continued development and improvement of `SplineOmics`. Thank you for using our package!

## 🌟 Contributors

- [Thomas-Rauter](https://github.com/Thomas-Rauter) - 🚀 Wrote the package, developed the approach together with VSchaepertoens under guidance from nfortelny.
- [nfortelny](https://github.com/nfortelny) - 🧠 Principal Investigator, provided guidance and support
- [skafdasschaf](https://github.com/skafdasschaf) - 🔧 Helped reviewing code, delivered improvement suggestions
- [VSchaepertoens](https://github.com/VSchaepertoens) - ✨ Developed parts of the functions and the overall approach together with Thomas-Rauter
45 changes: 39 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@

# SplineOmics <img src="man/figures/hex_logo.png" style="float: right; width: 150px; margin-left: 300px; vertical-align: middle;"/>

![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
![Maintained?
Yes](https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg)
![Version](https://img.shields.io/badge/version-0.1.0-blue) ![License:
MIT](https://img.shields.io/badge/License-MIT-yellow.svg) ![Maintained?
Yes](https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg) ![R
CMD
Check](https://img.shields.io/badge/R%20CMD%20check-passed-brightgreen)
[![Docker](https://img.shields.io/badge/docker-pull-blue)](https://ghcr.io/thomas-rauter/splineomics:0.1.0)

The R package `SplineOmics` gets the significant features (hits) of
time-series omics data by using splines and limma for hypothesis testing
Expand All @@ -21,8 +24,10 @@ HTML reports.
- [📦 Dependencies](#-dependencies)
- [❓ Getting Help](#-getting-help)
- [🤝 Contributing](#-contributing)
- [💬 Feedback](#-feedback)
- [📜 License](#-license)
- [🎓 Citation](#-citation)
- [🌟 Contributors](#-contributors)

## 📘 Introduction

Expand Down Expand Up @@ -188,7 +193,7 @@ docker run -it -d \
-v $(pwd)/output:/home/rstudio/output \
-p 8888:8787 \
-e PASSWORD=password \
--name splineomics_container \
--name splineomics \
thomasrauter/splineomics:0.1.0
```

Expand All @@ -201,13 +206,13 @@ the `SplineOmics` package is installed.
Stop the container:

``` sh
docker stop splineomics_container
docker stop splineomics
```

Start the container again:

``` sh
docker start splineomics_container
docker start splineomics
```

### Inspect Docker container installations
Expand Down Expand Up @@ -325,6 +330,21 @@ Thank you for considering contributing to `SplineOmics`. Your efforts
are what make the open-source community a fantastic place to learn,
inspire, and create.

## 💬 Feedback

We appreciate your feedback! Besides raising issues, you can provide
feedback in the following ways:

- **Direct Email**: Send your feedback directly to [Thomas
Rauter](mailto:thomas.rauter@plus.ac.at).

- **Anonymous Feedback**: Use [this Google
Form](https://forms.gle/jocMXSxLf3GrGBdT9) to provide anonymous
feedback by answering questions.

Your feedback helps us improve the project and address any issues you
may encounter.

## 📜 License

This package is licensed under the MIT License: [LICENSE](./LICENSE)
Expand All @@ -340,3 +360,16 @@ you in your work, consider citing this GitHub repository.
Also, if you like the package, consider giving the GitHub repository a
star. Your support helps us in the continued development and improvement
of `SplineOmics`. Thank you for using our package!

## 🌟 Contributors

- [Thomas-Rauter](https://github.com/Thomas-Rauter) - 🚀 Wrote the
package, developed the approach together with VSchaepertoens under
guidance from nfortelny.
- [nfortelny](https://github.com/nfortelny) - 🧠 Principal Investigator,
provided guidance and support
- [skafdasschaf](https://github.com/skafdasschaf) - 🔧 Helped reviewing
code, delivered improvement suggestions
- [VSchaepertoens](https://github.com/VSchaepertoens) - ✨ Developed
parts of the functions and the overall approach together with
Thomas-Rauter
Loading

0 comments on commit b5574d2

Please sign in to comment.