Learn R Programming

rsgcc (version 1.0.6)

cor.pair: compute the correlation between two genes

Description

This function can compute the correlation of a pair of genes with Gini correlation and four other correlation methods. The signficance level (p-value) of computed correlation can be estimated with the permutation test method.

Usage

cor.pair(idxvec, GEMatrix, rowORcol = c("row", "col"), cormethod = c("GCC", "PCC", "SCC", "KCC", "BiWt"), pernum = 0, sigmethod = c("two.sided", "one.sided"))

Arguments

idxvec
a numer vector containing two elements for the index of genes or samples in GEMatrix (e.g., c(1,2) ).
GEMatrix
a data matrix containing numeric variables. Example: rows correspond to genes and columns to samples. This parameter is the same as the "GEMatrix" defined for cor.matrix.
rowORcol
a character string ("row" or "col") indicating gene expression data will be extracted by rows or columns for correlation calculation. "row": correlation between two genes. "col": correlaiton between two samples.
cormethod
a character string that specifies the correlation method to be used for correlation calculation.
pernum
the number of permutation test used for calcluating statistical significance level (i.e., p-value) of correlations.
sigmethod
a character string ("two-sided" or "one-sided") specifying the method used to compute p-value for permutation test.

Value

A list with the following components:
gcc.rankx
a Gini correlation produced by using the rank information of the first gene (i.e., the first element in idxvec).
gcc.ranky
a Gini correlation produced by using the rank information of the second gene (i.e., the second element in idxvec).
gcc.rankx.pvalue
p-value of gcc.rankx.
gcc.ranky.pvalue
p-value of gcc.ranky.
cor
the correlation produced by "PCC", "SCC", "KCC" or "BiWt".
pvalue
the p-value of cor.

See Also

onegcc, cor.matrix, gcc.corfinal.

Examples

Run this code

   data(rsgcc)        #load the sample data in rsgcc package
   x <- rnaseq[1:4,]  #construct a GEMatrix with the RNA-Seq data of the first four genes

   #compute correlation between the 1st and 4th genes
   corpair <- cor.pair(c(1,4), GEMatrix = x, rowORcol = "row", 
                       cormethod = "GCC", pernum = 0, 
                       sigmethod = "two.sided")  
## Not run: 
#    #compute correlation between the 1st and 4th genes, 
#    #the p-value of correlation will be estimated with 2,000 permuation test.
#    corpair <- cor.pair(c(1,4), GEMatrix = x, rowORcol = "row", 
#                        cormethod = "GCC", pernum = 2000, 
#                        sigmethod = "two.sided")  
# 
#    #compute correlation between the 1st and 4th samples
#    corpair <- cor.pair(c(1,4), GEMatrix = x, rowORcol = "col", 
#                        cormethod = "GCC", pernum = 0, 
#                        sigmethod = "two.sided")  
# ## End(Not run)

Run the code above in your browser using DataLab