/jpg/top_genes/}
+Default: \code{"heatmaps_PA"}.
+}}
-\item{group_col}{Name of the group column in metadata; default "group".}
+\item{pdf}{Logical. If \code{TRUE}, saves PDF heatmaps. Default: \code{TRUE}.}
-\item{save_dataframe}{Logical; if TRUE, saves the merged data frame as TSV before plotting.}
+\item{jpg}{Logical. If \code{TRUE}, saves JPG heatmaps. Default: \code{TRUE}.}
}
\value{
-Saves one PDF and one JPG heatmap per gene set under output_dir; optionally saves intermediate TSV.
+Invisibly returns \code{TRUE} upon completion. Saves heatmap files to
+the corresponding subdirectories under \code{out_dir}.
}
\description{
-Generates heatmaps based on normalized data of genes for each gene set from GSEA/CAMERA/PADOG output.
+Generates heatmaps of gene expression for each gene set in \code{pa_data_annot},
+using the \code{all_genes}, \code{le_genes} (GSEA output only), and/or \code{top_genes}
+columns produced by \code{\link[=addgenesPA]{addgenesPA()}}. Genes within each heatmap are ordered
+by their position in \code{ranked_genes}.
+}
+\details{
+The recommended workflow before calling this function is:
+
+\if{html}{\out{}}\preformatted{gsl <- list_gmts("path/to/gmt/")
+pa_data <- merge_PA("path/to/pa_data/")
+ranked <- deseq2_results$gene_id[order(deseq2_results$stat,
+ decreasing = TRUE)]
+gene_lists <- getgenesPA(pa_data, gsl, ranked, genes = c("all", "le"))
+pa_annot <- addgenesPA(pa_data, gene_lists)
+
+heatmap_PA(
+ expression_data = vst_counts,
+ metadata = sampledata,
+ pa_data_annot = pa_annot,
+ ranked_genes = ranked,
+ plot_genes = c("all_genes", "le_genes")
+)
+}\if{html}{\out{
}}
+}
+\examples{
+\dontrun{
+data(vst_counts)
+data(sampledata)
+data(deseq2_results)
+data(gsea_results)
+data(geneset_list)
+
+ranked <- deseq2_results$gene_id[order(deseq2_results$stat,
+ decreasing = TRUE)]
+
+# ── Example 1: GSEA results (all_genes + le_genes) ────
+pa_single <- gsea_results[gsea_results$COMPARISON == "TumorVsNormal", ]
+gene_lists <- getgenesPA(pa_single, geneset_list, ranked,
+ genes = c("all", "le"))
+pa_annot <- addgenesPA(pa_single, gene_lists)
+
+heatmap_PA(
+ expression_data = vst_counts,
+ metadata = sampledata,
+ pa_data_annot = pa_annot,
+ ranked_genes = ranked,
+ plot_genes = c("all_genes", "le_genes"),
+ sample_col = "patient_id",
+ group_col = "sample_type",
+ out_dir = "heatmaps_gsea",
+ pdf = TRUE,
+ jpg = TRUE
+)
+# Creates:
+# heatmaps_gsea/pdf/all_genes/_heatmap.pdf
+# heatmaps_gsea/pdf/le_genes/_heatmap.pdf
+# heatmaps_gsea/jpg/all_genes/_heatmap.jpg
+# heatmaps_gsea/jpg/le_genes/_heatmap.jpg
+
+# ── Example 2: CAMERA results (all_genes + top_genes)
+# camera_results does not contain leading edge information.
+# Use genes = "top" with a manually set top fraction instead.
+# Note: top_genes are rank-based and do NOT represent true leading edge genes.
+data(camera_results)
+camera_pa <- camera_results
+colnames(camera_pa)[colnames(camera_pa) == "GeneSet"] <- "NAME"
+camera_pa$SIZE <- sapply(camera_pa$NAME,
+ function(x) length(geneset_list[[x]]))
+camera_pa$top <- 0.25
+
+gene_lists_cam <- getgenesPA(camera_pa, geneset_list, ranked,
+ genes = c("all", "top"))
+pa_annot_cam <- addgenesPA(camera_pa, gene_lists_cam)
+
+heatmap_PA(
+ expression_data = vst_counts,
+ metadata = sampledata,
+ pa_data_annot = pa_annot_cam,
+ ranked_genes = ranked,
+ plot_genes = c("all_genes", "top_genes"),
+ sample_col = "patient_id",
+ group_col = "sample_type",
+ out_dir = "heatmaps_camera"
+)
+}
+
+}
+\seealso{
+\code{\link[=getgenesPA]{getgenesPA()}} for gene extraction;
+\code{\link[=addgenesPA]{addgenesPA()}} to generate \code{pa_data_annot};
+\code{\link[=list_gmts]{list_gmts()}} to generate the geneset list;
+\code{\link[=merge_PA]{merge_PA()}} to generate \code{pa_data};
+\link{vst_counts} for an example expression matrix.
}
diff --git a/man/heatmap_path_PA.Rd b/man/heatmap_path_PA.Rd
new file mode 100644
index 0000000..5d72ced
--- /dev/null
+++ b/man/heatmap_path_PA.Rd
@@ -0,0 +1,126 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/plot_PA.R
+\name{heatmap_path_PA}
+\alias{heatmap_path_PA}
+\title{Plot leading edge heatmaps from GSEA analysis results using file paths}
+\usage{
+heatmap_path_PA(
+ 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
+)
+}
+\arguments{
+\item{main_dir}{Character or \code{NULL}. Optional base directory prepended to
+all relative file paths. If \code{NULL} (default), all paths are used as-is.}
+
+\item{expression_file}{Character. Path to a tab-delimited expression data
+file. Rows are genes (first column or a column named \code{NAME} used as row
+names), columns are sample IDs. Recommended input: VST-transformed counts.}
+
+\item{metadata_file}{Character. Path to an Excel (\code{.xlsx}) metadata file.
+Must contain a column matching \code{sample_col} (sample IDs) and a column
+matching \code{group_col} (condition labels, e.g., \code{"Control"},
+\code{"Treatment"}).}
+
+\item{gmt_file}{Character. Path to a \code{.gmt} file defining gene sets. Each
+row contains: gene set name (column 1), description (column 2, ignored),
+and gene symbols (columns 3+).}
+
+\item{ranked_genes_file}{Character. Path to a tab-delimited file where the
+first column contains gene symbols ordered by their ranking metric (e.g.,
+log2FC or signal-to-noise ratio), from most positive to most negative.
+Used to order leading edge genes within each heatmap.}
+
+\item{gsea_file}{Character. Path to a GSEA results \code{.tsv} file containing
+at least the columns \code{NAME}, \code{SIZE}, and \code{tags} (from the \verb{LEADING EDGE}
+column parsed by \code{\link[=merge_PA]{merge_PA()}}).}
+
+\item{output_dir}{Character. Directory where heatmap files are saved.
+Created automatically if it does not exist. Default:
+\code{"leading_edge_heatmaps"}.}
+
+\item{sample_col}{Name of the sample ID column in the metadata file.
+Default: \code{"Sample"}.}
+
+\item{group_col}{Name of the condition/group column in the metadata file
+(e.g., \code{"Control"} vs \code{"Treatment"}). Used for heatmap column
+annotations. Default: \code{"group"}.}
+
+\item{save_dataframe}{Logical. If \code{TRUE}, saves the intermediate data frame
+(gene sets with computed leading edge genes) as a \code{.tsv} file in
+\code{output_dir} before plotting. Useful for inspection or reuse.
+Default: \code{FALSE}.}
+}
+\value{
+Invisibly returns \code{TRUE} upon completion. Saves two files per gene
+set in \code{output_dir}:
+\itemize{
+\item \verb{_heatmap.pdf}
+\item \verb{_heatmap.jpg}
+}
+
+If \code{save_dataframe = TRUE}, also saves
+\verb{/leading_edge_genes_df.tsv}.
+}
+\description{
+Generates one heatmap per gene set from GSEA/CAMERA/PADOG output by reading
+all required inputs from file paths. For each gene set, the leading edge
+genes are extracted, ordered by their rank in the ranked gene list, and
+plotted as a scaled row heatmap against the expression matrix.
+}
+\details{
+This function is the file-path-based alternative to \code{\link[=heatmap_PA]{heatmap_PA()}}, which
+accepts R objects directly. Use this version when working from raw output
+files on disk (e.g., directly after running \code{GSEA_merge.sh}).
+}
+\note{
+For a more flexible workflow that accepts R objects directly (avoiding
+repeated file reads), use \code{\link[=heatmap_PA]{heatmap_PA()}} instead, which takes
+\code{expression_data}, \code{metadata}, and \code{pa_data_annot} as R objects and
+integrates with \code{\link[=getgenesPA]{getgenesPA()}} and \code{\link[=addgenesPA]{addgenesPA()}}.
+}
+\examples{
+\dontrun{
+# Run with all files in a single base directory
+heatmap_path_PA(
+ main_dir = "path/to/analysis/",
+ expression_file = "vst_expression.tsv",
+ metadata_file = "metadata.xlsx",
+ gmt_file = "genesets.gmt",
+ ranked_genes_file = "ranked_genes.tsv",
+ gsea_file = "gsea_results.tsv",
+ output_dir = "leading_edge_heatmaps",
+ sample_col = "Sample",
+ group_col = "group",
+ save_dataframe = TRUE
+)
+# Saves:
+# leading_edge_heatmaps/_heatmap.pdf
+# leading_edge_heatmaps/_heatmap.jpg
+# leading_edge_heatmaps/leading_edge_genes_df.tsv (if save_dataframe = TRUE)
+
+# Run with absolute paths (no main_dir)
+heatmap_path_PA(
+ expression_file = "/data/vst_counts.tsv",
+ metadata_file = "/data/metadata.xlsx",
+ gmt_file = "/data/h.all.v2023.gmt",
+ ranked_genes_file = "/data/ranked_genes.tsv",
+ gsea_file = "/data/gsea_results.tsv"
+)
+}
+
+}
+\seealso{
+\code{\link[=heatmap_PA]{heatmap_PA()}} for the R-object-based alternative;
+\code{\link[=getgenesPA]{getgenesPA()}} and \code{\link[=addgenesPA]{addgenesPA()}} for extracting leading edge genes
+from R objects; \code{\link[=merge_PA]{merge_PA()}} to generate the GSEA results input;
+\code{\link[=list_gmts]{list_gmts()}} to load GMT files as R objects.
+}
diff --git a/man/merge_PA.Rd b/man/merge_PA.Rd
index c0a5bc9..b5bc037 100644
--- a/man/merge_PA.Rd
+++ b/man/merge_PA.Rd
@@ -2,15 +2,104 @@
% Please edit documentation in R/merge_PA.R
\name{merge_PA}
\alias{merge_PA}
-\title{Merge GSEA results data frames.}
+\title{Merge GSEA result files into a single data frame}
\usage{
-merge_PA(input_directory, output_file = "collections_merged_gsea_data.tsv")
+merge_PA(input_directory, fdr_replace = 0.001)
}
\arguments{
-\item{input_directory}{The directory containing the GSEA collection results in TSV format.}
+\item{input_directory}{Character. Path to the directory containing one or
+more GSEA collection result files in \code{.tsv} format (e.g., output of
+\code{GSEA_merge.sh}). Each file must end in \code{.tsv}.}
-\item{output_file}{The output file to save the merged data. If not provided, the file will be saved in the input directory.}
+\item{fdr_replace}{Numeric. Value used to replace \verb{FDR q-val = 0}. This
+occurs when no permutation produced an NES as extreme as the observed
+one, meaning the true FDR is below \code{1 / n_permutations}. With the
+standard 1,000 permutations, the recommended value is \code{0.001}. Adjust
+to \code{1 / n_permutations} if a different number of permutations was used.
+Default: \code{0.001}.}
+}
+\value{
+A data frame (\code{gsea_data}) containing all merged and processed GSEA
+results with standardized column names.
}
\description{
-After running GSEA_all.sh from GSEA.sh, merge_PA function joins .tsv files to a single file
+Reads all \code{.tsv} files produced by \code{GSEA_merge.sh} (from the GSEA.sh
+pipeline) from a directory, standardizes numeric columns, parses the
+leading edge string, computes \code{-log10(FDR)}, and returns a single merged
+data frame ready for downstream use with \code{\link[=splot_PA]{splot_PA()}}, \code{\link[=multiplot_PA]{multiplot_PA()}} , \code{\link[=getgenesPA]{getgenesPA()}}, and
+\code{\link[=heatmap_PA]{heatmap_PA()}}.
+}
+\details{
+\strong{Input file format:} Each \code{.tsv} file corresponds to one MSigDB collection
+(e.g., \code{H.tsv}, \code{C2.tsv}) and must follow the standard GSEA output
+format with the following columns:
+\itemize{
+\item \code{NAME}: gene set name.
+\item \code{SIZE}: number of genes in the gene set.
+\item \code{ES}: enrichment score.
+\item \code{NES}: normalized enrichment score.
+\item \verb{NOM p-val}: nominal p-value.
+\item \verb{FDR q-val}: false discovery rate. Values of exactly \code{0} indicate
+that no permutation produced an equally extreme NES (i.e., the true
+FDR is below the permutation resolution \code{1 / n_permutations}). These
+are replaced by \code{fdr_replace} to avoid \code{-Inf} in log-transforms.
+\item \verb{FWER p-val}: family-wise error rate.
+\item \verb{RANK AT MAX}: gene rank at maximum enrichment score.
+\item \verb{LEADING EDGE}: string encoding the leading edge statistics in the
+format \code{"tags=XX\%, list=XX\%, signal=XX\%"}. Parsed into three numeric
+columns: \code{tags} (fraction of gene set in leading edge), \code{list}
+(fraction of ranked list used), and \code{signal} (enrichment signal
+strength).
+\item \code{Comparison}: name of the comparison (e.g., \code{"TumorVsNormal"}).
+Renamed to \code{COMPARISON} in the output. Required for visualization
+with \code{\link[=splot_PA]{splot_PA()}} or \code{\link[=multiplot_PA]{multiplot_PA()}} .
+\item \verb{GS
follow link to MSigDB} and \verb{GS DETAILS}: removed automatically.
+}
+
+\strong{Output columns:} All input columns (minus the two removed above) plus:
+\itemize{
+\item \code{COLLECTION}: name of the MSigDB collection, derived from the file name
+by removing the \code{.tsv} suffix.
+\item \code{tags}, \code{list}, \code{signal}: numeric leading edge components (0-1 scale).
+\item \code{Log10FDR}: \code{-log10(FDR)} computed after applying \code{fdr_replace}.
+\item \code{FDR}: renamed from \verb{FDR q-val}.
+\item \code{COMPARISON}: renamed from \code{Comparison}.
+}
+}
+\note{
+The input \code{.tsv} files must contain a \code{Comparison} column identifying
+each comparison (e.g., \code{"TumorVsNormal"}). This column is renamed to
+\code{COMPARISON} in the output and is required by \code{\link[=splot_PA]{splot_PA()}} or \code{\link[=multiplot_PA]{multiplot_PA()}} to operate in
+multi-comparison mode. If your files come from a single comparison and
+do not have this column, add it manually to each file before merging:
+\code{your_data$Comparison <- "YourComparisonName"}.
+}
+\examples{
+\dontrun{
+# Merge all GSEA collection TSV files from a directory
+gsea_data <- merge_PA(
+ input_directory = "path/to/gsea_results/",
+ fdr_replace = 0.001 # standard for 1000 permutations
+)
+
+# Inspect result
+head(gsea_data)
+colnames(gsea_data)
+
+# Use directly in downstream functions
+gsl <- list_gmts("path/to/gmt_folder/")
+ranked <- deseq2_results$gene_id[order(deseq2_results$stat,
+ decreasing = TRUE)]
+gene_lists <- getgenesPA(gsea_data, gsl, ranked)
+pa_annot <- addgenesPA(gsea_data, gene_lists)
+
+plot_PA(gsea_data, comparison_col = "COMPARISON")
+}
+
+}
+\seealso{
+\code{\link[=splot_PA]{splot_PA()}} or \code{\link[=multiplot_PA]{multiplot_PA()}} for visualization of merged results;
+\code{\link[=getgenesPA]{getgenesPA()}} and \code{\link[=addgenesPA]{addgenesPA()}} for gene-level annotation;
+\code{\link[=heatmap_PA]{heatmap_PA()}} for leading edge heatmaps;
+\code{\link[=list_gmts]{list_gmts()}} to load gene sets.
}
diff --git a/man/multiplot_PA.Rd b/man/multiplot_PA.Rd
new file mode 100644
index 0000000..678a152
--- /dev/null
+++ b/man/multiplot_PA.Rd
@@ -0,0 +1,140 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/plot_PA.R
+\name{multiplot_PA}
+\alias{multiplot_PA}
+\title{Pathway analysis visualization across multiple comparisons}
+\usage{
+multiplot_PA(
+ data,
+ comparison_col = "COMPARISON",
+ facet_col = "NAME",
+ axis_y = "NES",
+ fdr_col = "FDR",
+ comparison_order = NULL,
+ custom_labels = NULL,
+ ncol_wrap = 2,
+ free_y = TRUE,
+ fill_limits = NULL,
+ fill_palette = c("white", "red"),
+ theme_params = list()
+)
+}
+\arguments{
+\item{data}{A data frame of pathway analysis results containing two or more
+comparisons. Typically the output of \code{\link[=merge_PA]{merge_PA()}}.}
+
+\item{comparison_col}{Name of the column identifying each comparison.
+Appears on the x-axis of each facet. Default: \code{"COMPARISON"}.}
+
+\item{facet_col}{Name of the column used to define facets one facet per
+unique value. Can be the original gene set name column (e.g., \code{"NAME"})
+or a manually curated column with cleaner or shorter labels
+(e.g., \code{"clean_name"}). Default: \code{"NAME"}.}
+
+\item{axis_y}{Name of the column to use for the y-axis. Default: \code{"NES"}.}
+
+\item{fdr_col}{Name of the column containing FDR values. \code{-log10(FDR)} is
+computed internally and used as the fill color. Default: \code{"FDR"}.}
+
+\item{comparison_order}{Character vector specifying the left-to-right order
+of comparisons on the x-axis of each facet. For example,
+\code{comparison_order = c("BvsA", "CvsA")} places \code{BvsA} on the left and
+\code{CvsA} on the right. If \code{NULL} (default), the order follows the factor
+levels of \code{comparison_col} as they appear in \code{data}.}
+
+\item{custom_labels}{Named character vector of x-axis tick labels. Useful
+for shortening comparison names on the axis. For example,
+\code{custom_labels = c(TumorVsNormal = "Tumor", MetastasisVsNormal = "Mets")}.
+Default: \code{NULL}.}
+
+\item{ncol_wrap}{Integer. Number of columns in \code{facet_wrap}. Default: \code{2}.}
+
+\item{free_y}{Logical. If \code{TRUE}, each facet uses its own y-axis scale.
+Default: \code{TRUE}.}
+
+\item{fill_limits}{Numeric vector of length 2 setting the color scale range
+for \code{-log10(FDR)}. Values outside this range are clamped to the nearest
+limit. For example, \code{fill_limits = c(0, 5)} maps all gene sets with
+\code{-log10(FDR) >= 5} (FDR <= 0.00001) to maximum red, and any value below
+0 to white. Useful when one gene set has extreme significance that makes
+the rest appear uniform. Default: \code{NULL} (auto).}
+
+\item{fill_palette}{Character vector of two colors for the fill gradient
+(low to high -log10(FDR)). Default: \code{c("white", "red")}.}
+
+\item{theme_params}{Named list to override default theme parameters.
+See Details.}
+}
+\value{
+A ggplot2 object.
+}
+\description{
+Generates a faceted barplot showing NES values across multiple comparisons
+for a set of gene sets. Each facet represents one gene set and bars
+represent the NES per comparison, colored by -log10(FDR). This layout makes
+it easy to compare how enrichment of gene sets changes across conditions
+(e.g., TumorVsNormal, MetastasisVsNormal).
+}
+\details{
+All comparisons must be combined in a single data frame with a column
+identifying each comparison as produced by \code{\link[=merge_PA]{merge_PA()}}.
+
+For visualizing a single comparison with full collection grouping, use
+\code{\link[=splot_PA]{splot_PA()}} instead.
+
+\code{theme_params} accepts any of the following named elements:
+\describe{
+\item{\code{bar_col}}{Bar border color. Default: \code{"black"}.}
+\item{\code{bar_size}}{Bar border linewidth. Default: \code{0.5}.}
+\item{\code{bar_width}}{Bar width. Default: \code{0.6}.}
+\item{\code{hline_size}}{Linewidth for horizontal line at y = 0. Default: \code{2}.}
+\item{\code{axis_title_size}}{Font size for axis titles. Default: \code{45}.}
+\item{\code{axis_text_size_x}}{Font size for x-axis labels. Default: \code{30}.}
+\item{\code{axis_text_size_y}}{Font size for y-axis labels. Default: \code{50}.}
+\item{\code{tick_size}}{Linewidth for axis ticks. Default: \code{1.5}.}
+\item{\code{tick_length}}{Length of axis ticks in cm. Default: \code{0.3}.}
+\item{\code{strip_text_size}}{Font size for facet strip labels. Default: \code{50}.}
+\item{\code{panel_spacing_multi}}{Spacing between facets. Default: \code{0.6}.}
+}
+}
+\examples{
+\dontrun{
+gsea_results <- merge_PA("path/to/gsea_results/")
+
+# Basic multi-comparison plot
+multiplot_PA(
+ data = gsea_results,
+ comparison_col = "COMPARISON",
+ facet_col = "NAME",
+ fdr_col = "FDR",
+ ncol_wrap = 3
+)
+
+# Control left-to-right order of comparisons on the x-axis
+multiplot_PA(
+ data = gsea_results,
+ comparison_col = "COMPARISON",
+ facet_col = "NAME",
+ fdr_col = "FDR",
+ comparison_order = c("BvsA", "CvsA") # BvsA on the left, CvsA on the right
+)
+
+# Use cleaner facet labels and shorten x-axis tick names
+gsea_results$clean_name <- gsub("_", " ", gsea_results$NAME)
+
+multiplot_PA(
+ data = gsea_results,
+ comparison_col = "COMPARISON",
+ facet_col = "clean_name",
+ fdr_col = "FDR",
+ comparison_order = c("BvsA", "CvsA"),
+ custom_labels = c(BvsA = "Tumor", CvsA = "Metastasis")
+)
+}
+
+}
+\seealso{
+\code{\link[=splot_PA]{splot_PA()}} for single-comparison patchwork plots;
+\code{\link[=merge_PA]{merge_PA()}} to generate the input data frame;
+\link{camera_results} for a minimal example dataset.
+}
diff --git a/man/plot_PA.Rd b/man/plot_PA.Rd
deleted file mode 100644
index 3fb9ced..0000000
--- a/man/plot_PA.Rd
+++ /dev/null
@@ -1,88 +0,0 @@
-% Generated by roxygen2: do not edit by hand
-% Please edit documentation in R/plot_PA.R
-\name{plot_PA}
-\alias{plot_PA}
-\title{Unified Pathway analysis results plotting function with theme configuration}
-\usage{
-plot_PA(
- data,
- Comparison = "Comparison",
- custom_labels = NULL,
- axis_y = "NES",
- fdr_col = "FDR",
- logFDR = TRUE,
- geneset_col,
- collection_col,
- nes_col,
- logfdr_col,
- order = c("desc", "asc"),
- ncol_wrap = 2,
- free_y = TRUE,
- fill_limits = NULL,
- fill_palette = c("white", "red"),
- theme_params = list()
-)
-}
-\arguments{
-\item{data}{A data frame containing GSEA results.}
-
-\item{Comparison}{Name of the column defining different comparisons. Default: "Comparison".}
-
-\item{custom_labels}{Named vector of labels for the x-axis discrete scale (barplot mode only). Default: NULL.}
-
-\item{axis_y}{Name of the column to use for the y-axis aesthetic. Default: "NES".}
-
-\item{fdr_col}{Name of the column containing FDR values. Default: "FDR".}
-
-\item{logFDR}{Logical; if TRUE, compute -log10(FDR) from \code{fdr_col}, otherwise use \code{fdr_col} directly. Default: TRUE.}
-
-\item{geneset_col}{Name of the column containing the geneset labels (single comparison mode).}
-
-\item{collection_col}{Name of the column containing the MSigDB collections (single comparison mode).}
-
-\item{nes_col}{Name of the column containing NES values (single comparison mode).}
-
-\item{logfdr_col}{Name of the column containing -log10(FDR) or similar (single comparison mode).}
-
-\item{order}{One of "desc" or "asc"; order of \code{axis_y} values. Default: c("desc","asc").}
-
-\item{ncol_wrap}{Number of columns for \code{facet_wrap} in barplot mode. Default: 2.}
-
-\item{free_y}{Logical; if TRUE, allow free y scales in facets. Default: TRUE.}
-
-\item{fill_limits}{Numeric vector of length 2 to set fill gradient limits (barplot mode). Default: NULL.}
-
-\item{fill_palette}{Character vector of two colors for fill gradient. Default: c("white","red").}
-
-\item{theme_params}{Named list to override default theme parameters (see details).}
-}
-\value{
-A ggplot or patchwork object for the GSEA plot.
-}
-\description{
-Creates either a global GSEA plot or a faceted barplot depending on the number of unique
-comparisons in the \code{Comparison} column. Allows customizing all previously hard-coded theme
-parameters via a single \code{theme_params} list.
-}
-\details{
-theme_params may include:
-\describe{
-\item{side_label_size}{Size for side panel labels (default 35)}
-\item{geneset_text_size}{Text size for geneset labels (default 5)}
-\item{collection_text_size}{Text size for collection labels (default 5)}
-\item{panel_widths}{Patchwork widths vector (default c(4,25,15,3,10,3))}
-\item{bar_col}{Bar/col border color (default "black")}
-\item{bar_size}{Border size for bars (default 0.5)}
-\item{bar_width}{Width for bars (default 0.6)}
-\item{col_size}{Border size for geom_col (default 1)}
-\item{hline_size}{Size for horizontal line at y=0 (default 2)}
-\item{axis_title_size}{Font size for axis titles (default 45)}
-\item{axis_text_size_x}{Font size for x-axis text (default 30)}
-\item{axis_text_size_y}{Font size for y-axis text (default 50)}
-\item{tick_size}{Size for axis ticks (default 1.5)}
-\item{tick_length}{Length for axis ticks in cm (default 0.3)}
-\item{strip_text_size}{Font size for strip text (default 50)}
-\item{panel_spacing_single}{Facet spacing single mode (default 4)}
-\item{panel_spacing_multi}{Facet spacing multi mode (default 0.6)}
-}
-}
diff --git a/man/splot_PA.Rd b/man/splot_PA.Rd
new file mode 100644
index 0000000..aa4053f
--- /dev/null
+++ b/man/splot_PA.Rd
@@ -0,0 +1,117 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/plot_PA.R
+\name{splot_PA}
+\alias{splot_PA}
+\title{Pathway analysis visualization for a single comparison}
+\usage{
+splot_PA(
+ data,
+ geneset_col = "NAME",
+ collection_col = "COLLECTION",
+ nes_col = "NES",
+ fdr_col = "FDR",
+ order = "desc",
+ fill_limits = NULL,
+ fill_palette = c("white", "red"),
+ theme_params = list()
+)
+}
+\arguments{
+\item{data}{A data frame of pathway analysis results for a single
+comparison. Typically the output of \code{\link[=merge_PA]{merge_PA()}} filtered to one value
+of the \code{COMPARISON} column, or results from a single CAMERA/GSEA run.
+Must contain the columns specified by \code{geneset_col}, \code{collection_col},
+\code{nes_col}, and \code{fdr_col}.}
+
+\item{geneset_col}{Name of the column containing gene set labels shown on
+the y-axis. Default: \code{"NAME"}.}
+
+\item{collection_col}{Name of the column containing MSigDB collection
+labels used to group gene sets (e.g., \code{"KEGG"}, \code{"HALLMARK"}, \code{"GO"}).
+Default: \code{"COLLECTION"}.}
+
+\item{nes_col}{Name of the column containing NES values (x-axis).
+Default: \code{"NES"}.}
+
+\item{fdr_col}{Name of the column containing FDR values. \code{-log10(FDR)} is
+computed internally and used as the fill color. Default: \code{"FDR"}.}
+
+\item{order}{One of \code{"desc"} or \code{"asc"}. Sort order for NES values on the
+y-axis. Default: \code{"desc"}.}
+
+\item{fill_limits}{Numeric vector of length 2 setting the color scale range
+for \code{-log10(FDR)}. Values outside this range are clamped to the nearest
+limit. For example, \code{fill_limits = c(0, 5)} maps all gene sets with
+\code{-log10(FDR) >= 5} (i.e., FDR <= 0.00001) to the maximum color (red),
+and any value below 0 to the minimum color (white). Useful when a few
+gene sets have extreme significance that washes out color variation in the
+rest. Default: \code{NULL} (auto uses the actual data range).}
+
+\item{fill_palette}{Character vector of two colors for the fill gradient
+(low to high -log10(FDR)). Default: \code{c("white", "red")}.}
+
+\item{theme_params}{Named list to override default theme parameters.
+See Details.}
+}
+\value{
+A \code{patchwork} object combining six ggplot2 panels.
+}
+\description{
+Generates a publication-quality multi-panel pathway enrichment plot for a
+single comparison using patchwork. Gene sets appear on the y-axis grouped
+by MSigDB collection, NES on the x-axis, and -log10(FDR) as fill color.
+Six panels are assembled side by side: a "Pathways" label, gene set names,
+the NES bar chart, collection labels, a "MSigDB" label, and the color legend.
+}
+\details{
+For visualizing enrichment across multiple comparisons, use
+\code{\link[=multiplot_PA]{multiplot_PA()}} instead.
+
+\code{theme_params} accepts any of the following named elements:
+\describe{
+\item{\code{side_label_size}}{Size for "Pathways" and "MSigDB" labels.
+Default: \code{35}.}
+\item{\code{geneset_text_size}}{Text size for gene set labels. Default: \code{5}.}
+\item{\code{collection_text_size}}{Text size for collection labels.
+Default: \code{5}.}
+\item{\code{panel_widths}}{Patchwork relative widths for the 6 panels.
+Default: \code{c(4, 25, 15, 3, 10, 3)}.}
+\item{\code{col_size}}{Border linewidth for \code{geom_col}. Default: \code{1}.}
+\item{\code{axis_title_size}}{Font size for axis titles. Default: \code{45}.}
+\item{\code{axis_text_size_x}}{Font size for x-axis labels. Default: \code{30}.}
+\item{\code{tick_size}}{Linewidth for axis ticks. Default: \code{1.5}.}
+\item{\code{tick_length}}{Length of axis ticks in cm. Default: \code{0.3}.}
+\item{\code{panel_spacing_single}}{Spacing between facets. Default: \code{4}.}
+}
+}
+\examples{
+\dontrun{
+gsea_results <- merge_PA("path/to/gsea_results/")
+
+# Filter to one comparison
+single <- gsea_results[gsea_results$COMPARISON == "TumorVsNormal", ]
+
+splot_PA(
+ data = single,
+ geneset_col = "NAME",
+ collection_col = "COLLECTION",
+ nes_col = "NES",
+ fdr_col = "FDR"
+)
+
+# Cap color scale at -log10(FDR) = 5 so subtle differences are visible
+# (gene sets with FDR <= 0.00001 all get the same max red color)
+splot_PA(
+ data = single,
+ geneset_col = "NAME", collection_col = "COLLECTION",
+ nes_col = "NES", fdr_col = "FDR",
+ fill_limits = c(0, 5)
+)
+}
+
+}
+\seealso{
+\code{\link[=multiplot_PA]{multiplot_PA()}} for multi-comparison faceted barplots;
+\code{\link[=merge_PA]{merge_PA()}} to generate the input data frame;
+\link{camera_results} for a minimal example dataset.
+}
diff --git a/vignettes/PA_workflow.Rmd b/vignettes/PA_workflow.Rmd
new file mode 100644
index 0000000..97a42c9
--- /dev/null
+++ b/vignettes/PA_workflow.Rmd
@@ -0,0 +1,381 @@
+---
+title: "Pathway Analysis Workflow with OmicsKit"
+output: rmarkdown::html_vignette
+vignette: >
+ %\VignetteIndexEntry{Pathway Analysis Workflow with OmicsKit}
+ %\VignetteEngine{knitr::rmarkdown}
+ %\VignetteEncoding{UTF-8}
+---
+
+```{r setup, include = FALSE}
+
+knitr::opts_chunk$set(
+ collapse = TRUE,
+ comment = "#>",
+ fig.align = "center",
+ warning = FALSE,
+ message = FALSE
+)
+```
+
+## Overview
+This vignette demonstrates a complete gene set enrichment analysis (GSEA)
+downstream workflow using OmicsKit, from loading gene sets through
+publication-quality visualization.
+
+The workflow covers:
+
+1. **Loading gene sets** : reading GMT files with `list_gmts()`
+2. **Merging results** : combining multi-collection GSEA TSV files with
+ `merge_PA()`
+3. **Gene extraction** : retrieving leading edge and top-ranked genes with
+ `getgenesPA()` and annotating results with `addgenesPA()`
+4. **Heatmaps** : visualizing gene expression per pathway with `heatmap_PA()`
+ (file-path alternative: `heatmap_path_PA()`)
+5. **Single-comparison plot** : `splot_PA()` : a publication-quality
+ multi-panel barplot for one comparison
+6. **Multi-comparison plot** : `multiplot_PA()` : faceted barplots comparing
+ enrichment across conditions
+
+## Required packages
+```{r packages}
+library(OmicsKit)
+library(ggplot2)
+```
+
+---
+
+## Section 1 : Load gene sets
+### `list_gmts()`
+Gene sets used for enrichment analysis are stored as `.gmt` files, the
+standard format used by MSigDB. `list_gmts()` reads all `.gmt` files from a
+directory and returns a single named list, ready for downstream use.
+
+```{r list_gmts, eval = FALSE}
+geneset_list <- list_gmts("path/to/your/gmt_folder/")
+
+# Number of gene sets loaded
+length(geneset_list)
+# Names of the first five gene sets
+names(geneset_list)[1:5]
+# Genes in one specific set
+geneset_list[["HALLMARK_INTERFERON_GAMMA_RESPONSE"]]
+```
+
+In this vignette, we use a built-in example `geneset_list`, which contains
+40 curated gene sets across four biological themes (apoptosis, cell cycle,
+immune response, and metabolism), and the built-in `gsea_results` dataset,
+which mimics the output of `merge_PA()` for three comparisons across HALLMARK,
+KEGG, and GO collections.
+```{r load_data}
+data(geneset_list)
+data(gsea_results)
+data(deseq2_results)
+data(vst_counts)
+data(sampledata)
+# Ranked gene list: DESeq2 Wald stat from most positive to most negative
+ranked_genes <- deseq2_results$gene_id[
+ order(deseq2_results$stat, decreasing = TRUE)
+]
+# Overview of the enrichment results
+dim(gsea_results)
+unique(gsea_results$COMPARISON)
+unique(gsea_results$COLLECTION)
+```
+
+---
+
+## Section 2 : Merge GSEA results
+### `merge_PA()`
+In a real analysis, GSEA produces one results file per MSigDB collection
+(e.g., `H.tsv` for HALLMARK, `C2.tsv` for KEGG). `merge_PA()` reads all
+`.tsv` files from a directory, standardizes column names, parses the leading
+edge string into numeric components (`tags`, `list`, `signal`), computes
+`-log10(FDR)`, and returns a single combined data frame.
+```{r merge_PA, eval = FALSE}
+gsea_data <- merge_PA(
+ input_directory = "path/to/gsea_results/",
+ fdr_replace = 0.001 # replace FDR = 0 (below permutation resolution)
+)
+# Inspect result
+head(gsea_data[, c("NAME", "NES", "FDR", "COLLECTION", "COMPARISON", "tags")])
+```
+
+> **Note:** Each `.tsv` file must contain a `Comparison` column identifying
+> the comparison name (e.g., `"TumorVsNormal"`). Then `merge_PA()` renames it to
+> `COMPARISON`. If your files come from a single run without that column,
+> add it manually:
+> ```r
+> your_data$Comparison <- "TumorVsNormal"
+> ```
+
+The built-in `gsea_results` already has this structure:
+```{r inspect_data}
+# Key columns produced by merge_PA()
+head(gsea_results[, c("NES", "FDR", "Log10FDR",
+ "COLLECTION", "COMPARISON", "tags", "SIZE")], n = 2)
+```
+
+---
+
+## Section 3 : Extract leading edge genes
+### `getgenesPA()`
+### `addgenesPA()`
+After obtaining pathway results, `getgenesPA()` retrieves the gene members
+relevant to each enrichment signal. Three extraction modes are available:
+- **`"le"`** (GSEA only): leading edge genes : the subset that drives the
+ enrichment score.
+- **`"top"`**: top-ranked *n* % of genes by rank metric : applicable to any
+ enrichment method (GSEA, CAMERA, PADOG, etc.).
+- **`"all"`**: all members of the gene set, ordered by rank.
+`addgenesPA()` then appends the gene lists as comma-separated columns
+(`le_genes`, `top_genes`, `all_genes`) to the pathway results table.
+
+```{r getgenesPA_addgenesPA, eval = FALSE}
+# Filter to one comparison
+pa_single <- gsea_results[gsea_results$COMPARISON == "TumorVsNormal", ]
+# Optional: define the top fraction for mode "top"
+pa_single$top <- 0.30 # top 30% of gene set members by rank
+# Extract genes using all three modes
+gene_lists <- getgenesPA(
+ pa_data = pa_single,
+ geneset_list = geneset_list,
+ ranked_genes = ranked_genes,
+ genes = c("all", "le", "top")
+)
+# Inspect results for one pathway
+ ## leading edge
+ gene_lists$le[["HALLMARK_INTERFERON_GAMMA_RESPONSE"]]
+ ## top 30% by rank
+ gene_lists$top[["HALLMARK_INTERFERON_GAMMA_RESPONSE"]]
+ ## all members
+ gene_lists$all[["HALLMARK_INTERFERON_GAMMA_RESPONSE"]]
+# Append gene columns to the pathway table
+pa_annot <- addgenesPA(pa_single, gene_lists)
+# Number of gene sets annotated
+nrow(pa_annot)
+
+head(pa_annot[, c("NAME", "all_genes", "le_genes", "top_genes")])
+```
+
+> **Tip:** For CAMERA or other enrichment methods that do not produce leading
+> edge information, use `genes = c("all", "top")` and set `pa_data$top` to
+> your desired fraction (e.g., `0.25` for the top 25 % by rank). Do not
+> request `genes = "le"` without a `tags` column.
+
+---
+
+## Section 4 : Heatmaps
+### `heatmap_PA()`
+`heatmap_PA()` generates one heatmap per gene set based on `pa_data_annot`.
+Genes are ordered within each heatmap by their position in `ranked_genes`. Output
+files are organized into subdirectories by format (PDF / JPG) and gene
+selection mode (`all_genes`, `le_genes`, `top_genes`).
+
+```{r heatmap_PA, eval = FALSE}
+heatmap_PA(
+ expression_data = vst_counts,
+ metadata = sampledata,
+ pa_data_annot = pa_annot,
+ ranked_genes = ranked_genes,
+ plot_genes = c("all_genes", "le_genes", "top_genes"),
+ sample_col = "patient_id",
+ group_col = "sample_type",
+ out_dir = "heatmaps_PA",
+ pdf = TRUE,
+ jpg = TRUE
+)
+# Creates, for example:
+# heatmaps_PA/jpg/top_genes/HALLMARK_INTERFERON_GAMMA_RESPONSE_heatmap.jpg
+# heatmaps_PA/pdf/le_genes/HALLMARK_INTERFERON_GAMMA_RESPONSE_heatmap.pdf
+# ... (one file per gene set per format per mode)
+```
+
+The heatmap below shows the top-ranked genes for
+`HALLMARK_INTERFERON_GAMMA_RESPONSE` across tumor and normal TCGA-LUAD
+samples:
+
+```{r heatmap_plot, echo = FALSE, fig.cap = "Expression heatmap of top-ranked genes in HALLMARK_INTERFERON_GAMMA_RESPONSE across TCGA-LUAD tumor and normal samples. Genes are ordered by DESeq2 Wald statistic.", fig.width = 7, fig.height = 6}
+
+knitr::include_graphics(
+ "figures_PA/heatmaps/jpg/top_genes/HALLMARK_INTERFERON_GAMMA_RESPONSE_heatmap.jpg"
+)
+```
+
+### `heatmap_path_PA()` : file-path alternative
+`heatmap_path_PA()` is a convenience wrapper that reads all inputs from disk
+(expression TSV, metadata XLSX, GMT file, ranked-genes TSV, GSEA TSV) and
+calls the same heatmap engine internally. It is useful when running the
+analysis immediately after GSEA without loading data into R.
+
+```{r heatmap_path_PA, eval = FALSE}
+
+heatmap_path_PA(
+ main_dir = "path/to/analysis/",
+ expression_file = "vst_expression.tsv",
+ metadata_file = "metadata.xlsx",
+ gmt_file = "h.all.v2023.symbols.gmt",
+ ranked_genes_file = "ranked_genes.tsv",
+ gsea_file = "H.tsv",
+ output_dir = "leading_edge_heatmaps",
+ sample_col = "patient_id",
+ group_col = "sample_type",
+ save_dataframe = TRUE # also saves intermediate gene table as .tsv
+)
+# Produces the same output as heatmap_PA() for a single GSEA file
+```
+
+> **Which function to use?** Prefer `heatmap_PA()` when your data are already
+> in R (e.g., after calling `merge_PA()`, `getgenesPA()`, and `addgenesPA()`).
+> Use `heatmap_path_PA()` when you want a quick one-call solution that reads
+> directly from files on disk. Both functions produce identical heatmaps.
+
+---
+
+## Section 5 : General plot | Single-comparison
+`splot_PA()` generates a publication-quality multi-panel enrichment plot for
+**one comparison**. Gene sets appear on the y-axis (grouped by MSigDB
+collection), NES on the x-axis, and −log10(FDR) as fill color. Six panels
+are assembled side-by-side using `patchwork`.
+```{r splot_PA, eval = FALSE}
+
+single <- gsea_results[gsea_results$COMPARISON == "TumorVsNormal", ]
+splot_PA(
+ data = single,
+ geneset_col = "NAME",
+ collection_col = "COLLECTION",
+ nes_col = "NES",
+ fdr_col = "FDR",
+ order = "desc",
+ fill_limits = c(0, 2), # cap at -log10(FDR) = 5
+ fill_palette = c("white", "red")
+)
+```
+
+```{r splot_plot, echo = FALSE, fig.cap = "Single-comparison pathway enrichment plot (TumorVsNormal). Gene sets are sorted by NES; fill color encodes -log10(FDR), capped at 2. Collections are annotated to the right.", fig.width = 6, fig.height = 5}
+knitr::include_graphics("figures_PA/splot_PA.jpg")
+```
+> **Tip:** Use `fill_limits = c(0, 2)` to prevent a handful of extremely
+> significant gene sets from washing out the color contrast for the rest. Any
+> pathway with FDR ≤ 0.01 will be shown in the maximum color (red).
+
+---
+
+## Section 6 : General plot | Multi-comparison
+`multiplot_PA()` generates a **faceted barplot** showing NES across multiple
+comparisons for a selected set of gene sets. Each facet represents one gene
+set; bars represent the NES per comparison, colored by −log10(FDR). This
+layout makes it straightforward to assess how enrichment changes across
+conditions.
+```{r multiplot_PA, eval = FALSE}
+
+# Subset to pathways of interest across all comparisons
+pathways_of_interest <- c(
+ "HALLMARK_INTERFERON_GAMMA_RESPONSE",
+ "HALLMARK_INFLAMMATORY_RESPONSE",
+ "HALLMARK_G2M_CHECKPOINT",
+ "HALLMARK_E2F_TARGETS",
+ "HALLMARK_GLYCOLYSIS",
+ "HALLMARK_OXIDATIVE_PHOSPHORYLATION"
+)
+multi_data <- gsea_results[gsea_results$NAME %in% pathways_of_interest, ]
+multiplot_PA(
+ data = multi_data,
+ comparison_col = "COMPARISON",
+ facet_col = "NAME",
+ axis_y = "NES",
+ fdr_col = "FDR",
+ comparison_order = c("TumorVsNormal",
+ "MetastasisVsNormal",
+ "MetastasisVsTumor"),
+ custom_labels = c(
+ TumorVsNormal = "Tumor",
+ MetastasisVsNormal = "Meta",
+ MetastasisVsTumor = "Meta/Tumor"
+ ),
+ ncol_wrap = 3,
+ free_y = TRUE,
+ fill_limits = c(0, 5),
+ fill_palette = c("white", "red")
+)
+```
+
+```{r multiplot_plot, echo = FALSE, fig.cap = "Multi-comparison pathway enrichment plot. Each facet shows NES for one HALLMARK gene set across three pairwise comparisons. Fill color encodes -log10(FDR), capped at 5.", fig.width = 6, fig.height = 5}
+knitr::include_graphics("figures_PA/multiplot_PA.jpg")
+```
+
+> **Tip:** Use `comparison_order` to control the left-to-right arrangement of
+> comparisons on the x-axis of each facet, and `custom_labels` to replace
+> long comparison names with shorter axis labels.
+
+## Full workflow : summary
+```{r full_workflow, eval = FALSE}
+library(OmicsKit)
+
+# 1. Load gene sets
+gsl <- list_gmts("path/to/gmt_folder/")
+
+# 2. Merge GSEA output TSV files
+gsea_data <- merge_PA(
+ input_directory = "path/to/gsea_results/",
+ fdr_replace = 0.001
+)
+# 3. Build ranked gene list (from DESeq2 stat or log2FC)
+ranked <- deseq2_results$gene_id[
+ order(deseq2_results$stat, decreasing = TRUE)
+]
+# 4. Extract leading edge and top-ranked genes
+pa_single <- gsea_data[gsea_data$COMPARISON == "TumorVsNormal", ]
+pa_single$top <- 0.30
+gene_lists <- getgenesPA(pa_single, gsl, ranked, genes = c("all", "le", "top"))
+pa_annot <- addgenesPA(pa_single, gene_lists)
+# 5. Heatmaps
+heatmap_PA(
+ expression_data = vst_counts,
+ metadata = sampledata,
+ pa_data_annot = pa_annot,
+ ranked_genes = ranked,
+ plot_genes = c("all_genes", "le_genes", "top_genes"),
+ sample_col = "patient_id",
+ group_col = "sample_type",
+ out_dir = "heatmaps_PA"
+)
+# Alternative: file-path version (reads directly from disk)
+heatmap_path_PA(
+ main_dir = "path/to/analysis/",
+ expression_file = "vst_expression.tsv",
+ metadata_file = "metadata.xlsx",
+ gmt_file = "h.all.v2023.symbols.gmt",
+ ranked_genes_file = "ranked_genes.tsv",
+ gsea_file = "H.tsv",
+ output_dir = "leading_edge_heatmaps"
+)
+# 6. Single-comparison enrichment plot
+splot_PA(
+ data = pa_single,
+ geneset_col = "NAME",
+ collection_col = "COLLECTION",
+ nes_col = "NES",
+ fdr_col = "FDR",
+ fill_limits = c(0, 5)
+)
+# 7. Multi-comparison enrichment plot
+pathways_oi <- c(
+ "HALLMARK_INTERFERON_GAMMA_RESPONSE",
+ "HALLMARK_INFLAMMATORY_RESPONSE",
+ "HALLMARK_G2M_CHECKPOINT"
+)
+multiplot_PA(
+ data = gsea_data[gsea_data$NAME %in% pathways_oi, ],
+ comparison_col = "COMPARISON",
+ facet_col = "NAME",
+ fdr_col = "FDR",
+ comparison_order = c("TumorVsNormal", "MetastasisVsNormal", "MetastasisVsTumor"),
+ ncol_wrap = 3
+)
+```
+
+## Session info
+```{r session_info}
+sessionInfo()
+```
diff --git a/vignettes/figures_PA/heatmaps/jpg/top_genes/HALLMARK_INTERFERON_GAMMA_RESPONSE_heatmap.jpg b/vignettes/figures_PA/heatmaps/jpg/top_genes/HALLMARK_INTERFERON_GAMMA_RESPONSE_heatmap.jpg
new file mode 100644
index 0000000..12a390a
Binary files /dev/null and b/vignettes/figures_PA/heatmaps/jpg/top_genes/HALLMARK_INTERFERON_GAMMA_RESPONSE_heatmap.jpg differ
diff --git a/vignettes/figures_PA/multiplot_PA.jpg b/vignettes/figures_PA/multiplot_PA.jpg
new file mode 100644
index 0000000..1b0cc70
Binary files /dev/null and b/vignettes/figures_PA/multiplot_PA.jpg differ
diff --git a/vignettes/figures_PA/splot_PA.jpg b/vignettes/figures_PA/splot_PA.jpg
new file mode 100644
index 0000000..ef4b363
Binary files /dev/null and b/vignettes/figures_PA/splot_PA.jpg differ