R/genePertScore.R
rank_gene_pert.RdRank genes by single-sample gene-wise raw perturbation scores to compare genes' contributions to pathway perturbation.
rank_gene_pert(genePertScore, gsTopology)List of gene-wise raw perturbation score matrices generated using function raw_gene_pert()
List of pathway topology matrices generated using function retrieve_topology()
A list where each element is a matrix corresponding to a pathway. Each column of an element corresponds to a sample, and each row corresponds to a pathway gene.
Ranking is performed within each sample each pathway. If in a given pathway, both positive and negative gene-wise perturbation scores exist, positive and negative scores are ranked separately, where the larger a positive rank, the more the gene contributed to the pathway's activation, and the smaller a negative rank, the more the gene contributed to the pathways' inhibition. When there's a tie in two gene's perturbation score within a sample, the mean of the indices is used.
Tarca AL, Draghici S, Khatri P, Hassan SS, Mittal P, Kim JS, Kim CJ, Kusanovic JP, Romero R. A novel signaling pathway impact analysis. Bioinformatics. 2009 Jan 1;25(1):75-82.
#compute weighted single sample logFCs
data(metadata_example)
data(logCPM_example)
ls <- weight_ss_fc(logCPM_example, metadata = metadata_example,
factor = "patient", control = "Vehicle")
# extract all the KEGG pathways
gsTopology <- retrieve_topology(database = "kegg")
# compute raw gene-wise perturbation scores
genePertScore <- raw_gene_pert(ls$logFC, gsTopology)
# rank genes by gene-wise perturbation scores within each sample
# to compare their contributions to pathway perturbation
geneRank <- rank_gene_pert(genePertScore, gsTopology)