CalcScore: Calculate consistency score

Description Usage Arguments Value Examples

View source: R/CalcScore.R

Description

Calculate consistency score

Usage

1
CalcScore(EdgeFrom,EdgeTo,interaction,AdjMat=NULL,ncomp=NULL,data,neigen=NULL)

Arguments

EdgeFrom

A character vector of gene symbols of one end of the edges. This parameter is ignored if AdjMat is specified.

EdgeTo

A character vector of gene symbols of the other end of the edges. This parameter is ignored if AdjMat is specified.

interaction

A numeric vector with components of 1 and -1 to denote activation and inhibition for the edges. This parameter is ignored if AdjMat is specified.

AdjMat

The signed undirected adjacency matrix for the pathway topology.

ncomp

The pre-specified number of sub-graphs used to calculate the consistency score. Default is using all sub-graphs.

data

A data frame of gene expression levels, with rows for profile genes and columns for perturbed pathway genes/proteins (column names are the perturbed gene/protein symbols).

neigen

The maximum number of eigen sub-spaces used to calculate gene scores. Default is using all eigen sub-spaces.

Value

The consistency score is returned as a list with the length of ncomp (if specified) or the number of sub-graphs in the pathway graph. Each element of the list is either NULL or a data frame. There are three reasons to cause the returned consistency score to be NULL: 1) There is a conflict in the topology; 2) Not sufficient data to calculate the consistency score (less than 2 perturbed genes/proteins connected in the graph); 3) pre-specified neigen is greater than the number of nodes in the graph. The data frame of the non-null score has two columns for the profile gene annotations (rowname of data) and the consistency scores, respectively.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# load data
downloadLINCS("LincsCGS")
Data <- LincsCGS$MCF7

# obtain edge information of a pathway
Edges <- AllEdges[AllEdges$Pathway=="hsa04150",]

# calculate consistency score by specifying edge information
CalcScore(EdgeFrom=Edges$GeneSymbol_a,EdgeTo=Edges$GeneSymbol_b,interaction=Edges$Interaction,data=Data,neigen=1)

# calculate consistency score by specifying adjacency matrix
AdjMat <- CalcAdj(EdgeFrom=Edges$GeneSymbol_a,EdgeTo=Edges$GeneSymbol_b,interaction=Edges$Interaction)
CalcScore(AdjMat=AdjMat,data=Data,neigen=1)

uc-bd2k/paslincs documentation built on May 28, 2020, 8:20 a.m.