Skip to content
Open
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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Imports:
scales,
grid,
utils,
patchwork
patchwork,
cowplot
Suggests:
biomaRt,
cowplot,
dbscan,
ggnewscale,
ggrepel,
Expand Down
9 changes: 5 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# Generated by roxygen2: do not edit by hand

export(add_annotations)
export(barplot_GSEA)
export(detect_filter)
export(get_annotations)
export(get_stars)
export(heatmap_GSEA)
export(merge_GSEA)
export(heatmap_PA)
export(merge_PA)
export(nice_KM)
export(nice_PCA)
export(nice_UMAP)
export(nice_VSB)
export(nice_Volcano)
export(nice_tSNE)
export(plot_GSEA)
export(plot_PA)
export(power_analysis)
export(save_results)
export(split_cases)
export(tpm)
import(ggplot2)
importFrom(cowplot,get_legend)
importFrom(magrittr,"%>%")
importFrom(patchwork,plot_layout)
importFrom(rlang,.data)
importFrom(utils,modifyList)
57 changes: 0 additions & 57 deletions R/barplot_GSEA.R

This file was deleted.

13 changes: 9 additions & 4 deletions R/heatmap_GSEA.R → R/heatmap_PA.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#########################
# Function heatmap_GSEA #
# Function heatmap_PA #
#########################

#' Plot leading edge heatmaps from GSEA results.
#' Plot leading edge heatmaps from GSEA/CAMERA/PADOG results.
#'
#' Generates heatmaps of leading edge genes for each gene set from GSEA output.
#' Generates heatmaps based on normalized data of genes for each gene set from GSEA/CAMERA/PADOG output.
#'
#' @param main_dir Optional base directory. If supplied, it will be prepended to all relative file paths.
#' @param expression_file Path to the expression data file (tab-delimited) or relative to main_dir.
Expand All @@ -19,10 +19,15 @@
#' @return Saves one PDF and one JPG heatmap per gene set under output_dir; optionally saves intermediate TSV.
#' @export

heatmap_GSEA <- function(main_dir = NULL, expression_file, metadata_file, gmt_file,
heatmap_PA <- function(main_dir = NULL, expression_file, metadata_file, gmt_file,
ranked_genes_file, gsea_file, output_dir = "leading_edge_heatmaps",
sample_col = "Sample", group_col = "group", save_dataframe = FALSE)
{
# Avoid check NOTES for global variables across multiple functions
utils::globalVariables(c(
"NAME", "GENES", "SIZE", "tags", "L.EDGE_size"
))

# Ensure required packages are installed
if (!requireNamespace("readr", quietly = TRUE)) stop("Package \"readr\" must be installed to use this function.", call. = FALSE)
if (!requireNamespace("grDevices", quietly = TRUE)) stop("Package \"grDevices\" must be installed to use this function.", call. = FALSE)
Expand Down
17 changes: 11 additions & 6 deletions R/merge_GSEA.R → R/merge_PA.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
#######################
# Function merge_GSEA #
# Function merge_PA #
#######################

#' Merge GSEA results data frames.
#'
#' After running GSEA_all.sh from GSEA.sh, merge_GSEA function joins .tsv files to a single file
#' After running GSEA_all.sh from GSEA.sh, merge_PA function joins .tsv files to a single file
#'
#' @param input_directory The directory containing the GSEA collection results in TSV format.
#' @param output_file The output file to save the merged data. If not provided, the file will be saved in the input directory.
#' @importFrom magrittr %>%
#' @export


merge_GSEA <- function(input_directory, output_file = "collections_merged_gsea_data.tsv") {

merge_PA <- function(input_directory, output_file = "collections_merged_gsea_data.tsv") {

# Avoid check NOTES for global variables across multiple functions
utils::globalVariables(c(
"...12", "numeric_cols", "LEADING EDGE", "tags", "signal",
"FDR q-val", "Log10FDR", "FWER p-val", "Comparison"
))

# Ensure required packages are installed
if (!requireNamespace("dplyr", quietly = TRUE)) stop("Package \"dplyr\" must be installed to use this function.", call. = FALSE)
if (!requireNamespace("readr", quietly = TRUE)) stop("Package \"readr\" must be installed to use this function.", call. = FALSE)
if (!requireNamespace("tidyr", quietly = TRUE)) stop("Package \"tidyr\" must be installed to use this function.", call. = FALSE)
Expand Down
117 changes: 0 additions & 117 deletions R/plot_GSEA.R

This file was deleted.

Loading
Loading