Title: | HiPathia: High-throughput Pathway Analysis |
---|---|
Description: | Hipathia is a method for the computation of signal transduction along signaling pathways from transcriptomic data. The method is based on an iterative algorithm which is able to compute the signal intensity passing through the nodes of a network by taking into account the level of expression of each gene and the intensity of the signal arriving to it. It also provides a new approach to functional analysis allowing to compute the signal arriving to the functions annotated to each pathway. |
Authors: | Marta R. Hidalgo [aut, cre], José Carbonell-Caballero [ctb], Francisco Salavert [ctb], Alicia Amadoz [ctb], Çankut Cubuk [ctb], Joaquin Dopazo [ctb] |
Maintainer: | Marta R. Hidalgo <[email protected]> |
License: | GPL-2 |
Version: | 3.7.0 |
Built: | 2024-11-18 03:57:36 UTC |
Source: | https://github.com/bioc/hipathia |
Annotates functions from a database to each pathway
annotate_paths(metaginfo, dbannot)
annotate_paths(metaginfo, dbannot)
metaginfo |
Pathways object |
dbannot |
Either a string indicating which precomputed annotation to use ("uniprot" for Uniprot Keywords or "GO" for Gene Ontology terms), or a dataframe with the annotation of the genes to the functions. First column are gene symbols, second column the functions. |
Object of annotations from pathways to functions
#@examples #pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", #"hsa04012")) #annotate_paths(pathways, "GO")
#@export
A dataset containing a matrix with the Gene expression of 40 samples from the BRCA-US project from The Cancer Genome Atlas (TCGA), and their experimental design, containing 20 "Tumor" samples 20 "Normal" samples.
data(brca)
data(brca)
SummarizedExperiment. The assay is a matrix with 40 columns and
18638 rows. Row names are Entrez IDs and column names are the TCGA
identifyers of the samples. The colData() is a data.frame with 1 column and
40 rows, including the experimental design of the 40 samples from the BRCA-US
project from TCGA. Field group
is the type of sample, either "Tumor"
or "Normal".
The gene expression matrix includes 40 samples. The data has been log-transformed and normalized with TMM.
SummarizedExperiment including a matrix with 40 columns and 18638 rows. Row names are Entrez IDs and column names are the TCGA identifyers of the samples.
Gene expression of 40 samples from the BRCA-US project from The Cancer Genome Atlas (TCGA).
data(brca_data)
data(brca_data)
Matrix with 40 columns and 18638 rows. Row names are Entrez IDs and column names are the TCGA identifyers of the samples.
Gene expression matrix with 40 samples taken from the BRCA-US project from The Cancer Genome Atlas (TCGA). The data has been log-transformed and normalized with TMM.
Matrix with 40 columns and 18638 rows. Row names are Entrez IDs and column names are the TCGA identifyers of the samples.
Experimental design of the gene expression matrix brca_data
with
40 samples taken from the BRCA-US project from The Cancer Genome Atlas
(TCGA). 20 samples are "Tumor" samples and 20 samples are "Normal" samples.
data(brca_design)
data(brca_design)
Dataframe with 1 column and 40 rows, including the experimental
design of the 40 samples from the BRCA-US project from TCGA. Field
group
is the type of sample, either "Tumor" or "Normal".
Dataframe with 1 column and 40 rows, including the experimental
design of the 40 samples from the BRCA-US project from TCGA. Field
group
is the type of sample, either "Tumor" or "Normal".
Comparison object returned by hipathia::do_wilcoxon
function, after
calling
comp <- do_wilcoxon(path_vals, sample_group, g1 = "Tumor", g2 =
"Normal")
path_names <- get_path_names(pathways, rownames(comp))
comp <- cbind(path_names, comp)
data(comp)
data(comp)
Table with 1868 rows and 5 columns
Pathway comparison result
Saves the results of a Wilcoxon comparison for the Hipathia pathway values into a folder, and creates a HTML from which to visualize the results on top of the pathways. The results are stored into the specified folder. If this folder does not exist, it will be created. The parent folder must exist.
create_report( comp, metaginfo, output_folder = NULL, path = NULL, node_colors = NULL, group_by = "pathway", conf = 0.05, verbose = FALSE )
create_report( comp, metaginfo, output_folder = NULL, path = NULL, node_colors = NULL, group_by = "pathway", conf = 0.05, verbose = FALSE )
comp |
Comparison object as given by the |
metaginfo |
Pathways object as returned by the |
output_folder |
Name of the folder in which the report will be stored. |
path |
Absolute path to the parent directory in which 'output_folder' will be saved. If it is not provided, it will be created in a temp folder. |
node_colors |
List of colors with which to paint the nodes of the
pathways, as returned by the
|
group_by |
How to group the subpathways to be visualized. By default they are grouped by the pathway to which they belong. Available groupings include "uniprot", to group subpathways by their annotated Uniprot functions, "GO", to group subpathways by their annotated GO terms, and "genes", to group subpathways by the genes they include. Default is set to "pathway". |
conf |
Level of significance. By default 0.05. |
verbose |
Boolean, whether to show details about the results of the execution |
Saves the results and creates a report to visualize them through
a server in the specified output_folder
. Returns the folder where
the report has been stored.
data(comp) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) report <- create_report(comp, pathways, "save_results") ## Not run: data(results) data(brca) sample_group <- colData(brca)[,1] colors_de <- node_color_per_de(results, pathways, sample_group, "Tumor", "Normal") report_colors <- create_report(comp, pathways, "save_results", node_colors = colors_de) ## End(Not run)
data(comp) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) report <- create_report(comp, pathways, "save_results") ## Not run: data(results) data(brca) sample_group <- colData(brca)[,1] colors_de <- node_color_per_de(results, pathways, sample_group, "Tumor", "Normal") report_colors <- create_report(comp, pathways, "save_results", node_colors = colors_de) ## End(Not run)
Compares the gene expression, pathway activation level and the function activation level of the
DAcomp( hidata, groups, expdes, g2 = NULL, path.method = "wilcoxon", node.method = "limma", fun.method = "wilcoxon", order = FALSE, paired = FALSE, adjust = TRUE, conf.level = 0.05, sel_assay = 1 )
DAcomp( hidata, groups, expdes, g2 = NULL, path.method = "wilcoxon", node.method = "limma", fun.method = "wilcoxon", order = FALSE, paired = FALSE, adjust = TRUE, conf.level = 0.05, sel_assay = 1 )
hidata |
Either a SummarizedExperiment object or a matrix, returned by
function |
groups |
Either a character indicating the name of the column in colData
including the classes to compare, or a character vector with the class to
which each sample belongs.
Samples must be ordered as in |
expdes |
String, either an equation expression to pas to |
g2 |
String, label of the second group to be compared, if not specified
in |
path.method |
String, method to be used when comparing pathways.
Options include |
node.method |
String, method to be used when comparing nodes.
Options include |
fun.method |
String, method to be used when comparing functions.
Options include |
order |
Boolean, whether to order the results table by the
|
paired |
Boolean, whether the samples to be compared are paired.
If TRUE, function |
adjust |
Boolean, whether to adjust the p.value with Benjamini-Hochberg FDR method. Default is TRUE. |
conf.level |
Numeric, cut off for significance. Default is 0.05. |
sel_assay |
Character or integer, indicating the assay to be normalized in the SummarizedExperiment. Default is 1. |
List including comparison results for nodes, pathways and functions, if present.
data(hidata) comp <- DAcomp(hidata, groups = "group", expdes = "Tumor", g2 = "Normal")
data(hidata) comp <- DAcomp(hidata, groups = "group", expdes = "Tumor", g2 = "Normal")
Comparison object returned by hipathia::DAcomp
function, after
calling
DAdata <- DAcomp(hidata, "group", g1 = "Tumor", g2 = "Normal")
data(DAdata)
data(DAdata)
List object with 4 entries: Nodes includes a matrix with 6826 rows and 8 columns Paths includes a matrix with 1876 rows and 13 columns Uni.terms includes a matrix with 142 rows and 6 columns GO.terms includes a matrix with 1654 rows and 6 columns
List of tibbles with the comparison results
Table and plot of total number of altered and not altered nodes, paths and functions (Uniprot keywords and/or GO terms, if present).
DAoverview(DAdata, conf.level = 0.05, adjust = TRUE, colors = "hiro")
DAoverview(DAdata, conf.level = 0.05, adjust = TRUE, colors = "hiro")
DAdata |
List of comparison results, returned by function |
conf.level |
Numeric, cut off for significance. Default is 0.05. |
adjust |
Boolean, whether to adjust the p.value with Benjamini-Hochberg FDR method. Default is TRUE. |
colors |
String with the color scheme or vector of colors to be used.
See |
Plot and tibble including the number of total, altered, UP- and DOWN-regulated features for nodes, paths and functions if present.
data(DAdata) DAoverview(DAdata)
data(DAdata) DAoverview(DAdata)
Saves the results of a DAdata comparison for the Hipathia pathway values into a folder, and creates a HTML from which to visualize the results on top of the pathways. The results are stored into the specified folder. If this folder does not exist, it will be created. The parent folder must exist.
DAreport( DAdata, pathways, conf.level = 0.05, adjust = TRUE, group_by = "pathway", colors = "classic", output_folder = NULL, path = NULL, verbose = TRUE )
DAreport( DAdata, pathways, conf.level = 0.05, adjust = TRUE, group_by = "pathway", colors = "classic", output_folder = NULL, path = NULL, verbose = TRUE )
DAdata |
List of comparison results, returned by function |
pathways |
Pathways object as returned by the |
conf.level |
Level of significance. By default 0.05. |
adjust |
Boolean, whether to adjust the p.value with Benjamini-Hochberg FDR method. Default is TRUE. |
group_by |
How to group the subpathways to be visualized. By default they are grouped by the pathway to which they belong. Available groupings include "uniprot", to group subpathways by their annotated Uniprot functions, "GO", to group subpathways by their annotated GO terms, and "genes", to group subpathways by the genes they include. Default is set to "pathway". |
colors |
String with the color scheme or vector of colors to be used.
See |
output_folder |
Name of the folder in which the report will be stored. |
path |
Absolute path to the parent directory in which 'output_folder' will be saved. If it is not provided, it will be created in a temp folder. |
verbose |
Boolean, whether to show details about the results of the execution |
Saves the results and creates a report to visualize them through
a server in the specified output_folder
. Returns the folder where
the report has been stored.
data(DAdata) data(pathways) DAreport(DAdata, pathways)
data(DAdata) data(pathways) DAreport(DAdata, pathways)
n
altered pathways, taking into account the
number of altered .Lists and plots the top n
altered pathways, taking into account the
number of altered .
DAsummary( DAdata, n = 10, conf.level = 0.05, adjust = TRUE, ratio = FALSE, colors = "hiro", order.by = "number" )
DAsummary( DAdata, n = 10, conf.level = 0.05, adjust = TRUE, ratio = FALSE, colors = "hiro", order.by = "number" )
DAdata |
List of comparison results, returned by function |
n |
Number of top features to show. |
conf.level |
Numeric, cut off for significance. Default is 0.05. |
adjust |
Boolean, whether to adjust the p.value with Benjamini-Hochberg FDR method. Default is TRUE. |
ratio |
Boolean, whether to plot the ratio of significant paths with respect to the total paths in the pathway. Default is FALSE. |
colors |
String with the color scheme or vector of colors to be used.
See |
order.by |
String, how to order table of results. Available options
include |
Plot and tibble including top n
altered pathways.
data(DAdata) DAsummary(DAdata)
data(DAdata) DAsummary(DAdata)
n
altered nodes, paths and functions (Uniprot
keywords and/or GO terms, if present).Lists and plots the top n
altered nodes, paths and functions (Uniprot
keywords and/or GO terms, if present).
DAtop(DAdata, n = 10, conf.level = 0.05, adjust = TRUE, colors = "hiro")
DAtop(DAdata, n = 10, conf.level = 0.05, adjust = TRUE, colors = "hiro")
DAdata |
List of comparison results, returned by function |
n |
Number of top features to show. |
conf.level |
Numeric, cut off for significance. Default is 0.05. |
adjust |
Boolean, whether to adjust the p.value with Benjamini-Hochberg FDR method. Default is TRUE. |
colors |
String with the color scheme or vector of colors to be used.
See |
Plot and list of tables including top n
altered features for
nodes, paths and functions if present.
data(DAdata) DAtop(DAdata)
data(DAdata) DAtop(DAdata)
Color palettes to be used in plots.
define_colors(colors, no.col = NULL)
define_colors(colors, no.col = NULL)
colors |
String with the color scheme or vector of colors to be used.
Available predefined options include: |
no.col |
String with the color given to non-significant nodes, if not
given in parameter |
Plot and list of tables including top n
altered features for
nodes, paths and functions if present.
define_colors("hiro")
define_colors("hiro")
Performs a Principal Components Analysis
do_pca(data, sel_assay = 1, cor = FALSE)
do_pca(data, sel_assay = 1, cor = FALSE)
data |
SummarizedExperiment or matrix of values to be analyzed. Samples must be represented in the columns. |
sel_assay |
Character or integer, indicating the assay to be normalized in the SummarizedExperiment. Default is 1. |
cor |
A logical value indicating whether the calculation should use the correlation matrix or the covariance matrix. (The correlation matrix can only be used if there are no constant variables.) |
do_pca
returns a list with class princomp
.
data(path_vals) pca_model <- do_pca(path_vals[seq_len(ncol(path_vals)),])
data(path_vals) pca_model <- do_pca(path_vals[seq_len(ncol(path_vals)),])
Performs a Wilcoxon test for the values in sel_vals
comparing
conditions g1
and g2
do_wilcoxon( data, group, g1, g2, paired = FALSE, adjust = TRUE, sel_assay = 1, order = FALSE )
do_wilcoxon( data, group, g1, g2, paired = FALSE, adjust = TRUE, sel_assay = 1, order = FALSE )
data |
Either a SummarizedExperiment object or a matrix, containing the values. Columns represent samples. |
group |
Either a character indicating the name of the column in colData
including the classes to compare, or a character vector with the class to
which each sample belongs.
Samples must be ordered as in |
g1 |
String, label of the first group to be compared |
g2 |
String, label of the second group to be compared |
paired |
Boolean, whether the samples to be compared are paired.
If TRUE, function |
adjust |
Boolean, whether to adjust the p.value with Benjamini-Hochberg FDR method |
sel_assay |
Character or integer, indicating the assay to be normalized in the SummarizedExperiment. Default is 1. |
order |
Boolean, whether to order the results table by the
|
Dataframe with the result of the comparison
data(path_vals) data(brca_design) sample_group <- brca_design[colnames(path_vals),"group"] comp <- do_wilcoxon(path_vals, sample_group, g1 = "Tumor", g2 = "Normal")
data(path_vals) data(brca_design) sample_group <- brca_design[colnames(path_vals),"group"] comp <- do_wilcoxon(path_vals, sample_group, g1 = "Tumor", g2 = "Normal")
Experimental design matrix once expression matrix brca_data
has been
translated to Entrez geens with translate_matrix
and normalized using
normalize_data
.
data(exp_data)
data(exp_data)
Matrix with 40 columns and 3184 rows. Row names are Entrez IDs and column names are the TCGA identifyers of the samples.
To create the data, the following functions have been called:
trans_data <- translate_matrix(brca_data, "hsa")
exp_data <- normalize_data(trans_data)
Matrix with 40 columns and 3184 rows. Row names are Entrez IDs and column names are the TCGA identifyers of the samples.
Translates the GO IDs to readable and comprensible names.
get_go_names(names, species, maxchar = NULL, disambiguate = FALSE)
get_go_names(names, species, maxchar = NULL, disambiguate = FALSE)
names |
Character vector with the GO IDs to be translated. |
species |
Species of the samples. |
maxchar |
Integer, describes the number of maximum characters to be shown. By default no filter is applied. |
disambiguate |
Boolean, whether to return unique strings by disambiguating with numbers. |
A character vector including the readable names of the GO IDs, in the same order as provided.
data(go_vals) get_go_names(rownames(go_vals), "hsa")
data(go_vals) get_go_names(rownames(go_vals), "hsa")
Get highest common GO ancestor of GO annotations
get_highest_sig_ancestor( go_terms, go_comp, metaginfo, unique = TRUE, pval = 0.05 )
get_highest_sig_ancestor( go_terms, go_comp, metaginfo, unique = TRUE, pval = 0.05 )
go_terms |
GO terms for which the highest common ancestors are to be looked for. |
go_comp |
Wilcoxon comparison of the matrix of GO values as returned
by |
metaginfo |
Pathways object |
unique |
Boolean, whether to return only one highest significant GO ancestor or all of them. By default, TRUE. |
pval |
P-value cut-off. Default values is set to 0.05. |
highest common ancestors
#@export
Translates the node IDs to readable and comprensible names.
The names of the nodes are encoded as "pathway: name", where "pathway" is the pathway to which the node belongs and "node" is the name of the node. Nodes may include more genes than the one depicted in the name.
get_node_names(metaginfo, names, maxchar = NULL)
get_node_names(metaginfo, names, maxchar = NULL)
metaginfo |
Pathways object |
names |
Character vector with the subpathway IDs to be translated |
maxchar |
Integer, describes the number of maximum characters to be shown. By default no filter is applied. |
A character vector including the readable names of the subpathways IDs, in the same order as provided.
data(results) pathways_list <- c("hsa03320", "hsa04012") pathways <- load_pathways(species = "hsa", pathways_list) node_vals <- get_nodes_data(results) translated_names <- get_node_names(pathways, rownames(node_vals))
data(results) pathways_list <- c("hsa03320", "hsa04012") pathways <- load_pathways(species = "hsa", pathways_list) node_vals <- get_nodes_data(results) translated_names <- get_node_names(pathways, rownames(node_vals))
This function returns the object with the levels of activation of each node for each sample. Rows represent the nodes and columns represent the samples. Each cell is the value of activation of a node in a sample.
Rownames are the IDs of the nodes In order to transform IDs into
readable names, use get_node_names
.
Effector subpathways are subgraphs of a pathway including all the paths leading to an effector protein. Effector proteins are defined as final nodes in the graph. Each effector protein (final node) in a pathway defines its own effector subpathway as the nodes and edges in a path leading to it.
Decomposed subpathways are subgraphs of a pathway including all the paths starting in a receptor protein and ending in an effector protein. Receptor proteins are defined as initial nodes and effector proteins are defined as final nodes in the graph. Each effector subpathway can be decomposed in as many decomposed subpathways as initial nodes it includes.
get_nodes_data(results, matrix = FALSE)
get_nodes_data(results, matrix = FALSE)
results |
Results object as returned by |
matrix |
Boolean, if TRUE the function returns a matrix object, if FALSE (as default) returns a SummarizedExperiment object. |
Object, either a SummarizedExperiment or a matrix, with the levels of activation of each decomposed subpathway for each sample.
data(results) path_vals <- get_paths_data(results)
data(results) path_vals <- get_paths_data(results)
Translates the subpathway IDs to readable and comprensible names.
For effector subpathways, the names of the subpathways are encoded as "pathway: effector_protein", where "pathway" is the pathway to which the subpathway belongs and "effector_protein" is the name of the last node in the subpathway.
For decomposed subpathways, the names of the subpathways are encoded as "pathway: receptor_protein - effector_protein", where "pathway" is the pathway to which the subpathway belongs, "receptor_protein" is the name of the initial node of the subpathway and "effector_protein" is the name of the last node in the subpathway.
get_path_names(metaginfo, names, maxchar = NULL)
get_path_names(metaginfo, names, maxchar = NULL)
metaginfo |
Pathways object |
names |
Character vector with the subpathway IDs to be translated |
maxchar |
Integer, describes the number of maximum characters to be shown. By default no filter is applied. |
A character vector including the readable names of the subpathways IDs, in the same order as provided.
data(path_vals) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) translated_names <- get_path_names(pathways, rownames(path_vals))
data(path_vals) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) translated_names <- get_path_names(pathways, rownames(path_vals))
This function returns the object with the levels of activation of each subpathway for each sample. Rows represent the subpathways and columns represent the samples. Each cell is the value of activation of a subpathway in a sample.
Rownames are the IDs of the subpathways. In order to transform IDs into
readable names, use get_path_names
.
Effector subpathways are subgraphs of a pathway including all the paths leading to an effector protein. Effector proteins are defined as final nodes in the graph. Each effector protein (final node) in a pathway defines its own effector subpathway as the nodes and edges in a path leading to it.
Decomposed subpathways are subgraphs of a pathway including all the paths starting in a receptor protein and ending in an effector protein. Receptor proteins are defined as initial nodes and effector proteins are defined as final nodes in the graph. Each effector subpathway can be decomposed in as many decomposed subpathways as initial nodes it includes.
get_paths_data(results, matrix = FALSE)
get_paths_data(results, matrix = FALSE)
results |
Results object as returned by |
matrix |
Boolean, if TRUE the function returns a matrix object, if FALSE (as default) returns a SummarizedExperiment object. |
Object, either a SummarizedExperiment or a matrix, with the levels of activation of each decomposed subpathway for each sample.
data(results) path_vals <- get_paths_data(results)
data(results) path_vals <- get_paths_data(results)
Returns functions related to a pathway
get_pathway_functions( pathigraph, dbannot, entrez2hgnc, use_last_nodes = TRUE, unique = TRUE )
get_pathway_functions( pathigraph, dbannot, entrez2hgnc, use_last_nodes = TRUE, unique = TRUE )
pathigraph |
Pathway object |
dbannot |
Dataframe with the annotation of the genes to the functions. First column are gene symbols, second column the functions. |
entrez2hgnc |
Relation between Entrez and HGNC genes. |
use_last_nodes |
Boolean, whether to annotate functions to the last nodes of the pathways or not. If FALSE, functions will refer to all the nodes of the pathway. |
unique |
Boolean, whether to return the first function for each path. |
List of annotations from pathways to functions
Get functional annotation of the pathways, either for a particular annotation or a stored one.
get_pathways_annotations(pathway_names, metaginfo, dbannot, collapse = FALSE)
get_pathways_annotations(pathway_names, metaginfo, dbannot, collapse = FALSE)
pathway_names |
Character vector of the names of the pathways |
metaginfo |
Pathways object |
dbannot |
Either a string indicating which precomputed annotation to use ("uniprot" for Uniprot Keywords or "GO" for Gene Ontology terms), or a dataframe with the annotation of the genes to the functions. First column are gene symbols, second column the functions. |
collapse |
Boolean, whether to collapse all functions of the same path in a single character string. |
2-columns matrix with the annotations of each pathway ID in the
annotation dbannot
.
pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) pathway_names <- c("P-hsa03320-37", "P-hsa03320-61", "P-hsa03320-46", "P-hsa03320-57", "P-hsa03320-64", "P-hsa03320-47", "P-hsa03320-65") ## Not run: get_pathways_annotations(pathway_names, pathways, "GO") get_pathways_annotations(pathway_names, pathways, "uniprot")
pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) pathway_names <- c("P-hsa03320-37", "P-hsa03320-61", "P-hsa03320-46", "P-hsa03320-57", "P-hsa03320-64", "P-hsa03320-47", "P-hsa03320-65") ## Not run: get_pathways_annotations(pathway_names, pathways, "GO") get_pathways_annotations(pathway_names, pathways, "uniprot")
Lists the IDs of the pathways included in the pathways object
metaginfo
get_pathways_list(metaginfo)
get_pathways_list(metaginfo)
metaginfo |
Pathways object |
List of the pathway IDs included in the pathways object
pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) pathways_list <- get_pathways_list(pathways)
pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) pathways_list <- get_pathways_list(pathways)
Computes a summary of the results, summarizing the number and proportion of up- and down-regulated subpathways in each pathway.
get_pathways_summary(comp, metaginfo, conf = 0.05)
get_pathways_summary(comp, metaginfo, conf = 0.05)
comp |
Comparison data frame as returned by the |
metaginfo |
Pathways object |
conf |
Level of significance of the comparison for the adjusted p-value. Default is 0.05. |
Table with the summarized information for each of the pathways.
Rows are the analized pathways. Columns are:
* num_total_paths
Number of total subpathways in which each pathway
is decomposed.
* num_significant_paths
Number of significant subpathways in the
provided comparison.
* percent_significant_paths
Percentage of significant subpathways
from the total number of subpathways in a pathway.
* num_up_paths
Number of significant up-regulated subpathways in the
provided comparison.
* percent_up_paths
Percentage of significant up-regulated subpathways
from the total number of subpathways in a pathway.
* num_down_paths
Number of significant down-regulated subpathways in
the provided comparison.
* percent_down_paths
Percentage of significant down-regulated
subpathways from the total number of subpathways in a pathway.
data(comp) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) get_pathways_summary(comp, pathways)
data(comp) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) get_pathways_summary(comp, pathways)
Matrix of Gene Ontology terms activation values for the BRCA dataset.
This matrix is computed from the Results object returned by the
hipathia
function by means of the quantify_terms
function.
data(go_vals)
data(go_vals)
Matrix with 40 columns and 1654 rows. Row names are Gene Ontology terms and column names are the TCGA identifyers of the samples.
go_vals <- quantify_terms(results, pathways, "GO")
Matrix with 40 columns and 1654 rows. Row names are Gene Ontology terms and column names are the TCGA identifyers of the samples.
Plots a heatmap with the values of the subpathways.
heatmap_plot( data, group = NULL, sel_assay = 1, colors = "classic", sample_clust = TRUE, variable_clust = FALSE, labRow = NULL, labCol = NULL, sample_colors = NULL, scale = TRUE, save_png = NULL, legend = TRUE, legend_xy = "topright", pch = 15, main = NULL )
heatmap_plot( data, group = NULL, sel_assay = 1, colors = "classic", sample_clust = TRUE, variable_clust = FALSE, labRow = NULL, labCol = NULL, sample_colors = NULL, scale = TRUE, save_png = NULL, legend = TRUE, legend_xy = "topright", pch = 15, main = NULL )
data |
Either a SummarizedExperiment or a matrix with the values to be plotted. Rows are features and columns are samples. |
group |
Either a character indicating the name of the column in
colData
including the classes to plot, or a character vector with the class to
which each sample belongs. Samples must be ordered as in |
sel_assay |
Character or integer, indicating the assay to be normalized in the SummarizedExperiment. Default is 1. |
colors |
Either a character vector with colors or a key name
indicating the color scheme to be used in the heatmap.
If a character vector is provided, it is recommended to provide at
least 3 colors. Three different predefined color schemes may be
selected by providing a key name. Options are:
* |
sample_clust |
Boolean, whether to cluster samples (columns). By default TRUE. |
variable_clust |
Boolean, whether to cluster variables (rows). By default FALSE. If TRUE, rows with 0 variance are removed. |
labRow , labCol
|
Character vectors with row and column labels to be used. By default rownames(data) or colnames(data) are used, respectively. |
sample_colors |
Named character vector of colors. The names of
the colors must be the classes in |
scale |
Boolean, whether to scale each row to the interval [0,1]. Default is TRUE. |
save_png |
Path to the file where the image as PNG will be saved. By default, the image is not saved. |
legend |
Boolean, whether to display a legend. |
legend_xy |
Position for the legend, in case |
pch |
Graphical parameter from |
main |
Main title of the image |
Heatmap of the values of the subpathways
data(brca_design) data(path_vals) sample_group <- brca_design[colnames(path_vals),"group"] heatmap_plot(path_vals, group = sample_group) heatmap_plot(path_vals, group = "group", colors = "hipathia", variable_clust = TRUE)
data(brca_design) data(path_vals) sample_group <- brca_design[colnames(path_vals),"group"] heatmap_plot(path_vals, group = sample_group) heatmap_plot(path_vals, group = "group", colors = "hipathia", variable_clust = TRUE)
Shows the first n
rows and the first n
columns of a matrix,
in case the matrix has more than n+5
rows or columns.
Otherwise, it shows all the rows or columns, respectively.
hhead(mat, n = 5, sel_assay = 1)
hhead(mat, n = 5, sel_assay = 1)
mat |
Object to be shown |
n |
Number of rows and columns |
sel_assay |
Character or integer, indicating the assay to be translated in the SummarizedExperiment. Default is 1. |
Matrix with as much as n
rows and n
columns.
mat <- matrix(rnorm(100), ncol = 10) hhead(mat) hhead(mat, 3) hhead(mat, 7)
mat <- matrix(rnorm(100), ncol = 10) hhead(mat) hhead(mat, 3) hhead(mat, 7)
Results object returned by hipathia::hipathia
function, after calling
hidata <- hipathia(brca, pathways, verbose=TRUE, uni.terms = TRUE,
GO.terms = TRUE)
data(hidata)
data(hidata)
MultiAssayExperiment object of 4 listed experiments, with the activity values of nodes, paths and functional annotations for each sample: Nodes includes a matrix with 6826 rows Paths includes a matrix with 1876 rows Uni.terms includes a matrix with 142 rows GO.terms includes a matrix with 1654 rows
Object of results, including nodes, pathways and functional information.
#@importFrom igraph
hipathia( genes_vals, metaginfo, uni.terms = FALSE, GO.terms = FALSE, sel_assay = 1, decompose = FALSE, scale = TRUE, maxnum = 100, verbose = TRUE, tol = 1e-06, test = TRUE )
hipathia( genes_vals, metaginfo, uni.terms = FALSE, GO.terms = FALSE, sel_assay = 1, decompose = FALSE, scale = TRUE, maxnum = 100, verbose = TRUE, tol = 1e-06, test = TRUE )
genes_vals |
A SummarizedExperiment or matrix with the normalized expression values of the genes. Rows represent genes and columns represent samples. Rownames() must be accepted gene IDs. |
metaginfo |
Pathways object |
uni.terms |
Boolean, whether to compute functional analysis with Uniprot keywords. |
GO.terms |
Boolean, whether to compute functional analysis with Gene Ontology terms. |
sel_assay |
Character or integer, indicating the assay to be processed
in the SummarizedExperiment. Only applied if |
decompose |
Boolean, whether to compute the values for the decomposed subpathways. By default, effector subpathways are computed. |
scale |
Boolean, whether to scale the values matrix to [0,1]. Default is TRUE. |
maxnum |
Number of maximum iterations when iterating the signal through the loops into the pathways |
verbose |
Boolean, whether to show details about the results of the execution of hipathia |
tol |
Tolerance for the difference between two iterations when iterating the signal through the loops into the pathways |
test |
Boolean, whether to test the input objects. Default is TRUE. |
A MultiAssayExperiment object with the level of activation of the
subpathways from
the pathways in pathigraphs
for the experiment
with expression values in genes_vals
.
data(exp_data) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) results <- hipathia(exp_data, pathways, verbose = TRUE) ## Not run: results <- hipathia(exp_data, pathways, decompose = TRUE, verbose = FALSE) ## End(Not run)
data(exp_data) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) results <- hipathia(exp_data, pathways, verbose = TRUE) ## Not run: results <- hipathia(exp_data, pathways, decompose = TRUE, verbose = FALSE) ## End(Not run)
Upgrades the igraph
objects in metaginfo object to the corresponding
version of the igraph
package.
igraphs_upgrade(metaginfo)
igraphs_upgrade(metaginfo)
metaginfo |
Pathways object |
The pathways object with the upgraded igraph objects
Checks whether a species is accepted
is_accepted_species(species)
is_accepted_species(species)
species |
Species of the samples. #@examples #is_accepted_species("hsa") #is_accepted_species("fca") |
Boolean, whether species
is accepted or not.
Loads annotations object
load_annofuns(db, species)
load_annofuns(db, species)
db |
Database to be used. Either "GO" or "uniprot". |
species |
Species of the samples. #@examples #load_annofuns("GO", "hsa") #load_annofuns("uniprot", "hsa") |
Annotations object
Loads functional annotations from HGNC to the selected database.
load_annots(db, species)
load_annots(db, species)
db |
Database to be used. Either "GO" or "uniprot". |
species |
Species of the samples. #@examples #load_annots("GO", "hsa") |
Functional annotations from HGNC to the selected database.
Loads table of translation from HGNC to Entrez
load_entrez_hgnc(species)
load_entrez_hgnc(species)
species |
Species of the samples. #@examples #load_entrez_hgnc("hsa") |
Table of translation from HGNC to Entrez
#@examples #load_gobp_frame()
load_gobp_frame()
load_gobp_frame()
GO graph information
#@examples #load_gobp_net()
load_gobp_net()
load_gobp_net()
GO graph
Loads object with graph information
load_mgi(species)
load_mgi(species)
species |
Species of the samples. #@examples #load_mgi("hsa") |
Graph information object
Loads the pathways object, which includes information about the pathways to be analyzed.
load_pathways(species, pathways_list = NULL)
load_pathways(species, pathways_list = NULL)
species |
Species of the samples. |
pathways_list |
Vector of the IDs of the pathways to load. By default all available pathways are load. |
The object of pathways includes information about the pathways and the
subpathways which will be analyzed. This object must be provided to some
of the functions (like hipathia
or quantify_terms
) in the
package. These functions will analyze all the pathways included in this
object. By default, all available pathways are load. In order to restrict
the analysis to a predefined set of pathways, specify the set of pathways
to load with the parameter pathways_list
.
An pathways object including
* species
Species to which the pathways are related.
* pathigraphs
List of Pathigraph objects. Each Pathigraph contains
the necessary information of a pathway for it to be analyzed
with Hipathia
.
* all_genes
List of all the genes included in the selection of
pathways stored in pathigraphs
.
* eff_norm
Vector of normalization values for effector subpathways.
* path_norm
Vector of normalization values for decomposed
subpathways.
## Not run: pathways <- load_pathways("hsa") # Loads all pathways for human pathways <- load_pathways("mmu", c("mmu03320", "mmu04024", "mmu05200")) # Loads pathways 03320, 04024 and 05200 for mouse
## Not run: pathways <- load_pathways("hsa") # Loads all pathways for human pathways <- load_pathways("mmu", c("mmu03320", "mmu04024", "mmu05200")) # Loads pathways 03320, 04024 and 05200 for mouse
Loads object with pseudo graph information
load_pseudo_mgi(species, group_by)
load_pseudo_mgi(species, group_by)
species |
Species of the samples. |
group_by |
How to group the subpathways to be visualized. By default they are grouped by the pathway to which they belong. Available groupings include "uniprot", to group subpathways by their annotated Uniprot functions, "GO", to group subpathways by their annotated GO terms, and "genes", to group subpathways by the genes they include. #@examples #load_pseudo_mgi("hsa", "uniprot") |
Pseudo graph information object
Loads table of references
load_xref(species)
load_xref(species)
species |
Species of the samples. #@examples #load_xref("hsa") |
Table of references
Creates a Pathways object from the information of a pathway stored in a SIF
file with some attributes. This pathways object can be used by function
hipathia
to analyze data.
mgi_from_sif(sif.folder, spe, entrez_symbol = NULL, dbannot = NULL)
mgi_from_sif(sif.folder, spe, entrez_symbol = NULL, dbannot = NULL)
sif.folder |
Path to the folder in which SIF and ATT files are stored. |
spe |
Species |
entrez_symbol |
Relation between Entrez (NCBI) genes and gene symbols. Data.frame with 2 columns: First column is the EntrezGene ID, second column is the gene Symbol. The genes in the nodes of the pathways should be defined by Entrez IDs in the SIF and ATT files of the pathways. In order to be more readable, gene names are used when plotting the pathways. |
dbannot |
Functional annotation of the genes in the pathways to create function nodes. |
A pathways object with the same structure of that returned by
function load_pathways
.
Plots multiple components of a PCA analysis computed with do_pca
multiple_pca_plot( fit, group = NULL, sample_colors = NULL, comps = seq_len(3), plot_variance = FALSE, legend = TRUE, cex = 2, pch = 20, main = "Multiple PCA plot", save_png = NULL )
multiple_pca_plot( fit, group = NULL, sample_colors = NULL, comps = seq_len(3), plot_variance = FALSE, legend = TRUE, cex = 2, pch = 20, main = "Multiple PCA plot", save_png = NULL )
fit |
princomp object as returned by |
group |
Vector with the group to which each sample belongs.
The samples must be ordered as in |
sample_colors |
Named character vector of colors. The names of the
colors must be the classes in |
comps |
Vector with the components to be plot |
plot_variance |
Logical, whether to plot the cumulative variance. |
legend |
Boolean, whether to plot a legend in the plot. Default is TRUE. |
cex |
Graphical parameter from |
pch |
Graphical parameter from |
main |
Main title of the image |
save_png |
Path to the file where the image as PNG will be saved. By default, the image is not saved. |
Plots multiple components of a PCA
data(path_vals) sample_group <- brca_design[colnames(path_vals),"group"] pca_model <- do_pca(path_vals[seq_len(ncol(path_vals)),]) multiple_pca_plot(pca_model, sample_group, cex = 3, plot_variance = TRUE)
data(path_vals) sample_group <- brca_design[colnames(path_vals),"group"] pca_model <- do_pca(path_vals[seq_len(ncol(path_vals)),]) multiple_pca_plot(pca_model, sample_group, cex = 3, plot_variance = TRUE)
Computes the colors of the nodes depending on the sign and p.value from the provided file. Significant up- and down-regulated nodes are depicted with the selected color, with a gradient towards the non-significant color depending on the value of the p-value. Smaller p-values give rise to purer colors than higher p-values.
node_color( comp, metaginfo, group_by = "pathway", colors = "classic", conf = 0.05, adjust = TRUE )
node_color( comp, metaginfo, group_by = "pathway", colors = "classic", conf = 0.05, adjust = TRUE )
comp |
Comparison file as returned by |
metaginfo |
Object of pathways. |
group_by |
How to group the subpathways to be visualized. By default they are grouped by the pathway to which they belong. Available groupings include "uniprot", to group subpathways by their annotated Uniprot functions, "GO", to group subpathways by their annotated GO terms, and "genes", to group subpathways by the genes they include. Default is set to "pathway". |
colors |
Either a character vector with 3 colors (indicating, in this order, down-regulation, non-significance and up-regulation colors) or a key name indicating the color scheme to be used. Options are: |
conf |
Level of significance of the comparison for the adjusted p-value. |
adjust |
Boolean, whether to adjust the p.value from the comparison. Default is TRUE. |
List of color vectors, named by the pathways to which they belong. The color vectors represent the differential expression of the nodes in each pathway.
classic
ColorBrewer blue, white and colorBrewer red.
hipathia
Hipathia predefined color scheme:
Green, white and orange.
By default classic
color scheme is applied.
data(results) data(brca) pathways_list <- c("hsa03320", "hsa04012") pathways <- load_pathways(species = "hsa", pathways_list) comp <- do_wilcoxon(results[["nodes"]], "group", "Tumor", "Normal") colors_de <- node_color(comp, pathways)
data(results) data(brca) pathways_list <- c("hsa03320", "hsa04012") pathways <- load_pathways(species = "hsa", pathways_list) comp <- do_wilcoxon(results[["nodes"]], "group", "Tumor", "Normal") colors_de <- node_color(comp, pathways)
Performs a Limma differential expression on the nodes and computes the colors of the nodes depending on it_ Significant up- and down-regulated nodes are depicted with the selected color, with a gradient towards the non-significant color depending on the value of the p-value. Smaller p-values give rise to purer colors than higher p-values.
node_color_per_de( results, metaginfo, group, expdes, g2 = NULL, group_by = "pathway", colors = "classic", conf = 0.05, adjust = TRUE )
node_color_per_de( results, metaginfo, group, expdes, g2 = NULL, group_by = "pathway", colors = "classic", conf = 0.05, adjust = TRUE )
results |
Object of results as provided by the |
metaginfo |
Object of pathways_ |
group |
Character indicating the column in which the group variable is
stored, in case the object provided to |
expdes |
String, either the comparison to be performed or the label of the first group to be compared. |
g2 |
String, label of the second group to be compared. Only necessary in case expdes is the name of the first group, not the comparison. |
group_by |
How to group the subpathways to be visualized. By default they are grouped by the pathway to which they belong. Available groupings include "uniprot", to group subpathways by their annotated Uniprot functions, "GO", to group subpathways by their annotated GO terms, and "genes", to group subpathways by the genes they include. Default is set to "pathway". |
colors |
Either a character vector with 3 colors (indicating, in this order, down-regulation, non-significance and up-regulation colors) or a key name indicating the color scheme to be used. Options are: |
conf |
Level of significance of the comparison for the adjusted p-value. |
adjust |
Boolean, whether to adjust the p.value from the comparison. Default is TRUE. |
List of color vectors, named by the pathways to which they belong. The color vectors represent the differential expression of the nodes in each pathway.
classic
ColorBrewer blue, white and colorBrewer red.
hipathia
Hipathia predefined color scheme:
Green, white and orange.
By default classic
color scheme is applied.
data(results) data(brca) pathways_list <- c("hsa03320", "hsa04012") pathways <- load_pathways(species = "hsa", pathways_list) colors_de <- node_color_per_de(results, pathways, "group", "Tumor - Normal") colors_de <- node_color_per_de(results, pathways, "group", "Tumor", "Normal")
data(results) data(brca) pathways_list <- c("hsa03320", "hsa04012") pathways <- load_pathways(species = "hsa", pathways_list) colors_de <- node_color_per_de(results, pathways, "group", "Tumor - Normal") colors_de <- node_color_per_de(results, pathways, "group", "Tumor", "Normal")
hipathia
Transforms the rank of the SummarizedExperiment or matrix of gene expression
to [0,1] in order
to be processed by hipathia
. The transformation may be performed
in two different ways. If percentil = FALSE
, the transformation
is a re-scaling of the rank of the matrix. If percentil = TRUE
,
the transformation is performed assigning to each cell its percentil in
the corresponding distribution. This option is recommended for
distributions with very long tails.
normalize_data( data, sel_assay = 1, by_quantiles = FALSE, by_gene = FALSE, percentil = FALSE, truncation_percentil = NULL )
normalize_data( data, sel_assay = 1, by_quantiles = FALSE, by_gene = FALSE, percentil = FALSE, truncation_percentil = NULL )
data |
Either a SummarizedExperiment or a matrix of gene expression. |
sel_assay |
Character or integer, indicating the assay to be normalized in the SummarizedExperiment. Default is 1. |
by_quantiles |
Boolean, whether to normalize the data by quantiles. Default is FALSE. |
by_gene |
Boolean, whether to transform the rank of each row of the matrix to [0,1]. Default is FALSE. |
percentil |
Boolean, whether to take as value the percentil of each sample in the corresponding distribution. |
truncation_percentil |
Real number p in [0,1]. When provided, values beyond percentil p are truncated to the value of percentil p, and values beyond 1-p are truncated to percentil 1-p. By default no truncation is performed. |
This transformation may be applied either to the whole matrix
(by setting by_gene = FALSE
), which we strongly recommend, or to
each of the rows (by setting by_gene = TRUE
), allowing each gene
to have its own scale.
A previous quantiles normalization may be applied by setting
by_quantiles = TRUE
. This is recommended for noisy data.
For distributions with extreme outlayer values, a percentil p
may be given to the parameter truncation_percentil
. When provided,
values beyond percentil p are truncated to the value of percentil p, and
values beyond 1-p are truncated to percentil 1-p. This step is performed
before any other tranformation. By default no truncation is performed.
Matrix of gene expression whose values are in [0,1].
data("brca_data") trans_data <- translate_data(brca_data, "hsa") exp_data <- normalize_data(trans_data) exp_data <- normalize_data(trans_data, by_quantiles = TRUE, truncation_percentil=0.95)
data("brca_data") trans_data <- translate_data(brca_data, "hsa") exp_data <- normalize_data(trans_data) exp_data <- normalize_data(trans_data, by_quantiles = TRUE, truncation_percentil=0.95)
Due to the nature of the Hipathia method, the length of a pathway may influence its signal rank. In order to compare signal values among subpathways, we strongly recommend to normalize the matrix with this normalization.
normalize_paths(path_vals, metaginfo)
normalize_paths(path_vals, metaginfo)
path_vals |
SummarizedExperiment or matrix of the pathway values |
metaginfo |
Pathways object |
This function removes the bias caused by the length of the subpathways by dividing by the value obtained from running the method with a basal value of 0.5 at each node.
SummarizedExperiment or matrix of normalized pathway values,
depending on the class of path_vals
.
data(path_vals) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) path_normalized <- normalize_paths(path_vals, pathways)
data(path_vals) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) path_normalized <- normalize_paths(path_vals, pathways)
Matrix of pathway activation values for the BRCA dataset. This matrix is
extracted from the Results object returned by the hipathia
function
by means of the get_paths_matrix
function.
data(path_vals)
data(path_vals)
Matrix with 40 columns and 1868 rows. Row names are Pathway IDs and column names are the TCGA identifyers of the samples.
path_vals <- get_paths_matrix(results)
Matrix with 40 columns and 1868 rows. Row names are Pathway IDs and column names are the TCGA identifyers of the samples.
Create table of results with the comparison of the paths together with the GO functional annotation and the highest significant GO ancestor (HSGOA).
paths_to_go_ancestor(pathways, comp_paths, comp_go, pval = 0.05)
paths_to_go_ancestor(pathways, comp_paths, comp_go, pval = 0.05)
pathways |
Pathways object |
comp_paths |
Wilcoxon comparison of the matrix of pathways values
as returned by |
comp_go |
Wilcoxon comparison of the matrix of GO values as
returned by |
pval |
P-value cut-off. Default values is set to 0.05. |
The table returns in each row: the name of a pathway and its Wilcoxon comparison information (direction, adjusted p-value), the GO term to which the path is related (not necessarily unique), the Wilcoxon comparison informationfor this GO (direction, adjusted p-value), the HSGOA of this GO and its Wilcoxon comparison information (direction, adjusted p-value).
The HSGOA is computed as the GO term with minimum level from all the
significant (with respect to value pval
) ancestors of a GO.
The level of a GO term is computed as the number of nodes in the shortest
path from this GO term to the term "GO:0008150". The ancestors of a node
are defined as all the nodes from which a path can be defined from the
ancestor to the node.
Table of comparisons with Highest common ancestors
data(comp) data(go_vals) data(brca_design) data(path_vals) sample_group <- brca_design[colnames(path_vals),"group"] comp_go <- do_wilcoxon(go_vals, sample_group, g1 = "Tumor", g2 = "Normal") ## Not run: pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) table <- paths_to_go_ancestor(pathways, comp, comp_go) ## End(Not run)
data(comp) data(go_vals) data(brca_design) data(path_vals) sample_group <- brca_design[colnames(path_vals),"group"] comp_go <- do_wilcoxon(go_vals, sample_group, g1 = "Tumor", g2 = "Normal") ## Not run: pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) table <- paths_to_go_ancestor(pathways, comp, comp_go) ## End(Not run)
Plots the layout of a pathway, coloring the significant subpathways
in different colors depending on whether they are significantly up- or
down-regulated. Nodes may be also colored providing a suitable list of
colors for each node. Function node_color_per_de
assigns colors to the nodes depending on their differential expression.
pathway_comparison_plot( comp, metaginfo, pathway, conf = 0.05, node_colors = NULL, colors = "classic" )
pathway_comparison_plot( comp, metaginfo, pathway, conf = 0.05, node_colors = NULL, colors = "classic" )
comp |
Comparison data frame as returned by the |
metaginfo |
Pathways object. |
pathway |
Name of the pathway to be plotted. |
conf |
Level of significance of the comparison for the adjusted p-value. Default is 0.05. |
node_colors |
List, named by the pathway name, including the color of each node for each pathway. |
colors |
Either a character vector with 3 colors (indicating, in this order, down-regulation, non-significance and up-regulation colors) or a key name indicating the color scheme to be used. Options are: |
Image in which a pathway is ploted. Edges are colored so that the UP- and DOWN-activated subpathways are identified.
classic
ColorBrewer blue, white and colorBrewer red.
hipathia
Hipathia predefined color scheme: Green, white and orange.
By default classic
color scheme is applied.
data(comp) pathways_list <- c("hsa03320", "hsa04012") pathways <- load_pathways(species = "hsa", pathways_list) pathway_comparison_plot(comp, metaginfo = pathways, pathway = "hsa03320") ## Not run: data(results) data(brca) colors_de <- node_color_per_de(results, pathways, group, "Tumor", "Normal") pathway_comparison_plot(comp, metaginfo = pathways, pathway = "hsa04012", node_colors = colors_de) ## End(Not run)
data(comp) pathways_list <- c("hsa03320", "hsa04012") pathways <- load_pathways(species = "hsa", pathways_list) pathway_comparison_plot(comp, metaginfo = pathways, pathway = "hsa03320") ## Not run: data(results) data(brca) colors_de <- node_color_per_de(results, pathways, group, "Tumor", "Normal") pathway_comparison_plot(comp, metaginfo = pathways, pathway = "hsa04012", node_colors = colors_de) ## End(Not run)
Pathways object returned by hipathia::load_pathways
function, after
calling
pathways <- load_pathways(species = "hsa",
pathways_list = c("hsa03320", "hsa04012"))
data(pathways)
data(pathways)
Pathways object
Pathways object including pathways has03320 and hsa04012.
Plots two components of a PCA computed with do_pca
pca_plot( fit, group = NULL, sample_colors = NULL, cp1 = 1, cp2 = 2, legend = TRUE, legend_xy = "bottomleft", cex = 2, pch = 20, mgp = c(3, 1, 0), main = "PCA plot", save_png = NULL )
pca_plot( fit, group = NULL, sample_colors = NULL, cp1 = 1, cp2 = 2, legend = TRUE, legend_xy = "bottomleft", cex = 2, pch = 20, mgp = c(3, 1, 0), main = "PCA plot", save_png = NULL )
fit |
princomp object as returned by |
group |
Vector with the group to which each sample belongs.
The samples must be ordered as in |
sample_colors |
Named character vector of colors. The names of
the colors must be the classes in |
cp1 |
Integer, number of the component in the X-axis. Default is 1, the first component. |
cp2 |
Integer, number of the component in the Y-axis. Default is 2, the second component. |
legend |
Boolean, whether to plot a legend in the plot. Default is TRUE. |
legend_xy |
Situation of the legend in the plot. Available options are: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". |
cex |
Graphical parameter from |
pch |
Graphical parameter from |
mgp |
Graphical parameter from |
main |
Title of the graphics |
save_png |
Path to the file where the image as PNG will be saved. By default, the image is not saved. |
Plots two components of a PCA
data(path_vals) sample_group <- brca_design[colnames(path_vals),"group"] pca_model <- do_pca(path_vals[seq_len(ncol(path_vals)),]) pca_plot(pca_model, sample_group)
data(path_vals) sample_group <- brca_design[colnames(path_vals),"group"] pca_model <- do_pca(path_vals[seq_len(ncol(path_vals)),]) pca_plot(pca_model, sample_group)
Plots a pathway with or without the comparison information, using the visNetwork library.
plotVG( name, pathways, DAdata = NULL, colors = "hiro", conf = 0.05, adjust = TRUE, main = "Pathway", submain = "", no.col = "BlanchedAlmond", height = "800px" )
plotVG( name, pathways, DAdata = NULL, colors = "hiro", conf = 0.05, adjust = TRUE, main = "Pathway", submain = "", no.col = "BlanchedAlmond", height = "800px" )
name |
KEGG ID of the pathway to plot. |
pathways |
Pathways object. |
DAdata |
List of comparison results, returned by function |
colors |
String with the color scheme or vector of colors to be used.
See |
conf |
Numeric, cut off for significance. Default is 0.05. |
adjust |
Boolean, whether to adjust the p.value with Benjamini-Hochberg FDR method. Default is TRUE. |
main |
Title of the plot. |
submain |
Subtitle of the plot. |
no.col |
String with the color given to non-significant nodes. |
height |
Height of the plot. Default is "800px". |
Plot of the pathway.
data(pathways) plotVG("hsa03320", pathways) data(DAdata) plotVG("hsa04012", pathways, DAdata)
data(pathways) plotVG("hsa03320", pathways) data(DAdata) plotVG("hsa04012", pathways, DAdata)
Computes the level of activation of the functions related to the previously computed subpathways
quantify_terms( results, metaginfo, dbannot, out_matrix = FALSE, normalize = TRUE )
quantify_terms( results, metaginfo, dbannot, out_matrix = FALSE, normalize = TRUE )
results |
List of results as returned by the |
metaginfo |
Pathways object |
dbannot |
Either a string indicating which precomputed annotation to use ("uniprot" for Uniprot Keywords or "GO" for Gene Ontology terms), or a dataframe with the annotation of the genes to the functions. First column are gene symbols, second column the functions. |
out_matrix |
Boolean, whther the output object should be a matrix object. Default is FALSE, returning a SummarizedExperiment object. |
normalize |
Boolean, whether to normalize the matrix of pathway
values with |
Matrix with the level of activation of the functions in
dbannot
data(results) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) go_values <- quantify_terms(results, pathways, "GO") uniprot_values <- quantify_terms(results, pathways, "uniprot")
data(results) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) go_values <- quantify_terms(results, pathways, "GO") uniprot_values <- quantify_terms(results, pathways, "uniprot")
Results object returned by hipathia::hipathia
function, after calling
results <- hipathia(exp_data, pathways, verbose=TRUE)
data(results)
data(results)
Object of results, including pathways information.
Object of results, including pathways information.
Saves results to a folder. In particular, it saves the matrix of subpathway values, a table with the results of the provided comparison, the accuracy of the results and the .SIF and attributes of the pathways.
save_results(results, comp, metaginfo, output_folder = NULL, path = NULL)
save_results(results, comp, metaginfo, output_folder = NULL, path = NULL)
results |
Results object as returned by the |
comp |
Comparison as returned by the |
metaginfo |
Pathways object |
output_folder |
Name of the folder in which the results will be stored. |
path |
Absolute path to the parent directory in which 'output_folder' will be saved. If it is not provided, it will be created in a temp folder. |
Creates a folder in disk in which all the information to browse the pathway results is stored.
data(results) data(comp) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) save_results(results, comp, pathways, "output_results")
data(results) data(comp) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) save_results(results, comp, pathways, "output_results")
Performs a test for each pathway checking if the number of significant paths is significant, compared to not having any of the paths as significant.
top_pathways(comp)
top_pathways(comp)
comp |
Comparison data frame as returned by the |
Table with the names of the pathways and their p-value for the Fisher test comparing the proportion of significant subpaths vs. 0.
data(comp) top_pathways(comp)
data(comp) top_pathways(comp)
Translates the IDs in the rownames of a SummarizedExperiment to Entrez IDs. For accepted IDs to be transformed see the DOCUMENTATION.
translate_data(data, species, sel_assay = 1, verbose = TRUE)
translate_data(data, species, sel_assay = 1, verbose = TRUE)
data |
Either a SummarizedExperiment object or a matrix of gene expression. |
species |
Species of the samples. |
sel_assay |
Character or integer, indicating the assay to be translated in the SummarizedExperiment. Default is 1. |
verbose |
Boolean, whether to show details about the results of the execution. |
Either a SummarizedExperiment or a matrix (depending on the input type) of gene expression with Entrez IDs as rownames.
data("brca_data") trans_data <- translate_data(brca_data, "hsa")
data("brca_data") trans_data <- translate_data(brca_data, "hsa")
Translates the IDs in the rownames of a matrix to Entrez IDs. For accepted IDs to be transformed see the DOCUMENTATION.
translate_matrix(exp, species, verbose = TRUE)
translate_matrix(exp, species, verbose = TRUE)
exp |
Matrix of gene expression. |
species |
Species of the samples. |
verbose |
Boolean, whether to show details about the results of the execution. |
Matrix of gene expression with Entrez IDs as rownames.
Visualize a HiPathia report
visualize_report(output_folder, port = 4000)
visualize_report(output_folder, port = 4000)
output_folder |
Folder in which results to visualize are stored |
port |
Port to use |
The instructions to visualize a HiPathia report in a web browser
data(comp) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) report <- create_report(comp, pathways, "save_results") visualize_report(report) ## Not run: data(results) data(brca) sample_group <- colData(brca)[,1] colors_de <- node_color_per_de(results, pathways, sample_group, "Tumor", "Normal") report <- create_report(comp, pathways, "save_results", node_colors = colors_de) visualize_report(report) visualize_report(report, port = 5000) ## End(Not run)
data(comp) pathways <- load_pathways(species = "hsa", pathways_list = c("hsa03320", "hsa04012")) report <- create_report(comp, pathways, "save_results") visualize_report(report) ## Not run: data(results) data(brca) sample_group <- colData(brca)[,1] colors_de <- node_color_per_de(results, pathways, sample_group, "Tumor", "Normal") report <- create_report(comp, pathways, "save_results", node_colors = colors_de) visualize_report(report) visualize_report(report, port = 5000) ## End(Not run)