-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: improve spia script and report (#83)
These changes come from implementing spia in a GFOLD-based workflow here: https://github.com/dlaehnemann/rna-seq-conservative-fold-change-without-replicates This was modeled on the spia implementation here, and led to some cleanup of the `spia.R` script, to the removal of unnecessary report tables that didn't add any value and to some improvements of the spia reporting table.
- Loading branch information
1 parent
bff8d6b
commit 4b3cc16
Showing
5 changed files
with
137 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
**Pathway enrichment** performed with SPIA, using the model ``{{ snakemake.config["diffexp"]["models"][snakemake.wildcards.model]["full"] }}``. | ||
|
||
The table contains the following columns (also see the `SPIA docs <https://rdrr.io/bioc/SPIA/man/spia.html>`_): | ||
``pSize`` is the number of genes on the pathway; ``NDE`` is the number of DE genes per pathway; ``tA`` is the observed total perturbation accumulation in the pathway; ``pNDE`` is the probability to observe at least NDE genes on the pathway using a hypergeometric model; ``pPERT`` is the probability to observe a total accumulation more extreme than tA only by chance; ``pG`` is the p-value obtained by combining pNDE and pPERT; ``pGFdr`` and ``pGFWER`` are the False Discovery Rate and respectively Bonferroni adjusted global p-values; and the ``Status`` gives the direction in which the pathway is perturbed (``activated`` or ``inhibited``). KEGGLINK gives a web link to the KEGG website that displays the pathway image with the differentially expressed genes highlighted in red. | ||
The table contains the following columns that have been renamed for descriptive titles (also see the `SPIA docs <https://rdrr.io/bioc/SPIA/man/spia.html>`_; for renamed columns, original spia column names are mentioned in parentheses): | ||
**Name** of the pathway; | ||
**number of genes on the pathway** (``pSize``); | ||
**number of DE genes per pathway** where DE signifies "differentially expressed" (``NDE``); | ||
**total perturbation accumulation** (``tA``); | ||
**Combined FDR** where FDR signifies "false discovery rate" (``pGFdr``); | ||
**Status** of the pathway, inhibited vs. activated. | ||
|
||
The following columns (available from spia output), are hidden in this table in favour of the combined FDR as an overall assessment of the reliability of a pathway's perturbation. | ||
You can access them per pathway by clicking on the leading ``+`` symbol of a row: | ||
**p-value for at least NDE genes** where NDE signifies "n differentially expressed" (``pNDE``); | ||
**p-value to observe a total accumulation** (``pPERT``); | ||
**Combined p-value** (``pG``); | ||
**Combined Bonferroni p-values** (``pGFWER``); | ||
**pathway id** provided by the pathway database used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,181 +1,68 @@ | ||
name: ?f"Pathway impact analysis for model {wildcards.model}" | ||
name: ?f"spia pathway impact analysis for model {wildcards.model}" | ||
datasets: | ||
spia_table: | ||
path: ?input.spia_table | ||
offer-excel: true | ||
separator: "\t" | ||
spia_table_activated: | ||
path: ?input.spia_table_activated | ||
offer-excel: true | ||
separator: "\t" | ||
spia_table_inhibited: | ||
path: ?input.spia_table_inhibited | ||
offer-excel: true | ||
separator: "\t" | ||
default-view: spia_table | ||
views: | ||
spia_table: | ||
dataset: spia_table | ||
desc: | | ||
The table contains the following columns pSize is the number of genes on the pathway; NDE is the number of DE genes per pathway; tA is the observed total perturbation accumulation in the pathway; pNDE is the probability to observe at least NDE genes on the pathway using a hypergeometric model; pPERT is the probability to observe a total accumulation more extreme than tA only by chance; pG is the p-value obtained by combining pNDE and pPERT; pGFdr and pGFWER are the False Discovery Rate and respectively Bonferroni adjusted global p-values; and the Status gives the direction in which the pathway is perturbed (activated or inhibited). | ||
?f"spia pathway impact analysis for model {wildcards.model}" | ||
page-size: 25 | ||
render-table: | ||
columns: | ||
Name: | ||
display-mode: normal | ||
link-to-url: | ||
reactome: | ||
url: "http://reactome.org/PathwayBrowser/#/{Ids}" | ||
pathway: | ||
?if params.pathway_db == "reactome": | ||
url: "http://reactome.org/PathwayBrowser/#/{pathway id}" | ||
?elif params.pathway_db == "panther": | ||
url: "https://www.pantherdb.org/pathway/pathwayDiagram.jsp?catAccession={pathway id}" | ||
# we should add all the pathway databases that bioconductor-graphite enables (see its `pathwayDatabases()` function) | ||
?else: # not sure what a good fallback would be here | ||
url: "http://reactome.org/PathwayBrowser/#/{pathway id}" | ||
number of genes on the pathway: | ||
plot: | ||
heatmap: | ||
scale: linear | ||
range: | ||
- white | ||
- "#186904" | ||
- "#F7F7F7" | ||
- "#B2182B" | ||
number of DE genes per pathway: | ||
plot: | ||
heatmap: | ||
scale: linear | ||
range: | ||
- white | ||
- "#186904" | ||
- "#F7F7F7" | ||
- "#B2182B" | ||
p-value for at least NDE genes: | ||
display-mode: hidden | ||
display-mode: detail | ||
total perturbation accumulation: | ||
plot: | ||
heatmap: | ||
scale: linear | ||
range: | ||
- "#e6550d" | ||
- "white" | ||
- "#6baed6" | ||
domain: | ||
- -1 | ||
- 0 | ||
- 1 | ||
- "#B2182B" | ||
- "#F7F7F7" | ||
- "#2166AC" | ||
domain-mid: 0 | ||
p-value to observe a total accumulation: | ||
display-mode: hidden | ||
display-mode: detail | ||
Combined p-value: | ||
display-mode: hidden | ||
display-mode: detail | ||
Combined FDR: | ||
plot: | ||
bars: | ||
scale: linear | ||
Combined Bonferroni p-values: | ||
display-mode: hidden | ||
display-mode: detail | ||
Status: | ||
plot: | ||
heatmap: | ||
scale: ordinal | ||
color-scheme: accent | ||
Ids: | ||
display-mode: hidden | ||
spia_table_activated: | ||
dataset: spia_table_activated | ||
desc: | | ||
The table (sorted by "Status:Activated") contains the following columns pSize is the number of genes on the pathway; NDE is the number of DE genes per pathway; tA is the observed total perturbation accumulation in the pathway; pNDE is the probability to observe at least NDE genes on the pathway using a hypergeometric model; pPERT is the probability to observe a total accumulation more extreme than tA only by chance; pG is the p-value obtained by combining pNDE and pPERT; pGFdr and pGFWER are the False Discovery Rate and respectively Bonferroni adjusted global p-values; and the Status gives the direction in which the pathway is perturbed (activated). | ||
page-size: 25 | ||
render-table: | ||
columns: | ||
Name: | ||
display-mode: normal | ||
link-to-url: | ||
reactome: | ||
url: "http://reactome.org/PathwayBrowser/#/{Ids}" | ||
number of genes on the pathway: | ||
plot: | ||
heatmap: | ||
scale: linear | ||
range: | ||
- white | ||
- "#186904" | ||
number of DE genes per pathway: | ||
plot: | ||
heatmap: | ||
scale: linear | ||
range: | ||
- white | ||
- "#186904" | ||
p-value for at least NDE genes: | ||
display-mode: hidden | ||
total perturbation accumulation: | ||
plot: | ||
heatmap: | ||
scale: linear | ||
range: | ||
- "#e6550d" | ||
- "white" | ||
- "#6baed6" | ||
domain: | ||
- -1 | ||
- 0 | ||
- 1 | ||
p-value to observe a total accumulation: | ||
display-mode: hidden | ||
Combined p-value: | ||
display-mode: hidden | ||
Combined FDR: | ||
plot: | ||
bars: | ||
scale: linear | ||
Combined Bonferroni p-values: | ||
display-mode: hidden | ||
Status: | ||
display-mode: normal | ||
Ids: | ||
display-mode: hidden | ||
spia_table_inhibited: | ||
dataset: spia_table_inhibited | ||
desc: | | ||
The table (sorted by "Status:Inhibited") contains the following columns pSize is the number of genes on the pathway; NDE is the number of DE genes per pathway; tA is the observed total perturbation accumulation in the pathway; pNDE is the probability to observe at least NDE genes on the pathway using a hypergeometric model; pPERT is the probability to observe a total accumulation more extreme than tA only by chance; pG is the p-value obtained by combining pNDE and pPERT; pGFdr and pGFWER are the False Discovery Rate and respectively Bonferroni adjusted global p-values; and the Status gives the direction in which the pathway is perturbed (inhibited). | ||
page-size: 25 | ||
render-table: | ||
columns: | ||
Name: | ||
display-mode: normal | ||
link-to-url: | ||
reactome: | ||
url: "http://reactome.org/PathwayBrowser/#/{Ids}" | ||
number of genes on the pathway: | ||
plot: | ||
heatmap: | ||
scale: linear | ||
range: | ||
- white | ||
- "#186904" | ||
number of DE genes per pathway: | ||
plot: | ||
heatmap: | ||
scale: linear | ||
range: | ||
- white | ||
- "#186904" | ||
p-value for at least NDE genes: | ||
display-mode: hidden | ||
total perturbation accumulation: | ||
plot: | ||
heatmap: | ||
scale: linear | ||
range: | ||
- "#e6550d" | ||
- "white" | ||
- "#6baed6" | ||
domain: | ||
- -1 | ||
- 0 | ||
- 1 | ||
p-value to observe a total accumulation: | ||
display-mode: hidden | ||
Combined p-value: | ||
display-mode: hidden | ||
Combined FDR: | ||
plot: | ||
bars: | ||
scale: linear | ||
Combined Bonferroni p-values: | ||
display-mode: hidden | ||
Status: | ||
display-mode: normal | ||
Ids: | ||
display-mode: hidden | ||
pathway id: | ||
display-mode: detail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.