DCARS: DCARS

Description Usage Arguments Value Examples

View source: R/DCARS.R

Description

The DCARS function performs testing for differential correlation across ranked samples.

Usage

1
2
3
4
5
6
7
DCARS(dat, xname, yname, W = NULL, rangeMin = 0, wcormin = 0,
  statmin = 0, weightedConcordanceFunction = weightedPearson,
  weightedConcordanceFunctionW = "vector",
  extractTestStatisticOnly = FALSE, extractWcorSequenceOnly = FALSE,
  plot = FALSE, niter = 100,
  extractPermutationTestStatistics = FALSE, verbose = FALSE,
  forceBlock = FALSE, WcorSequenceSummaryFun = sd, ...)

Arguments

dat

a genes x samples gene expression rank matrix, should be already converted to ranks with first column lowest survival and last column highest survival

xname

name of row of dat to test together with yname

yname

name of row of dat to test together with xname

W

weight matrix for weighted correlations,

rangeMin

minimum range of weighted correlation vector to include for permutation testing

wcormin

minimum absolute value weighted correlation vector to include for permutation testing

statmin

minimum value DCARS test statistic to include for permutation testing

weightedConcordanceFunction

concordance function to use, defaults to weighted Pearson correlation. User can provide their own function, with arguments fun(x,y,w).

weightedConcordanceFunctionW

either "vector" or "matrix", determining if the function given in weightedConcordanceFunction argument takes in a single vector as input for w, or a matrix.

extractTestStatisticOnly

if TRUE, extract only the DCARS test statistic without permutation testing

plot

if TRUE plot observed weighted correlatin vector

niter

number of iterations for permutation testing

extractPermutationTestStatistics

if TRUE, extract only the DCARS test statistic without permutation testing

verbose

if TRUE, print updates

forceBlock

if TRUE, this converts all positive values in weight matrix W to 1, and calculates weighted correlation on the resulting subset. Default FALSE

WcorSequenceSummaryFun

Function that defines how the local weighted correlations are summarised, default is the function sd for standard deviation.

...

additional arguments passing on to weightMatrix()

extractWcorSequence

if TRUE, extract only the weighted correlation vector without permutation testing

Value

either single value (p-value or test statistic), vector (local weighted correlation), or list (combination of above) depending on the input parameters.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
data(STRING)
data(SKCM)
SKCM_rank = t(apply(SKCM,1,rank))

# highly significantly DCARS gene pair: SKP1 and SKP2
# calculates p-value based on permutation
DCARS(SKCM_rank,"SKP1","SKP2",plot=TRUE)
# extract only the test statistic
DCARS(SKCM_rank,"SKP1","SKP2", extractTestStatisticOnly = TRUE)

# not significantly DCARS gene pair: EIF3C and EIF5B
# calculates p-value based on permutation
DCARS(SKCM_rank,"EIF3C","EIF5B",plot=TRUE)
# extract only the test statistic
DCARS(SKCM_rank,"EIF3C","EIF5B", extractTestStatisticOnly = TRUE)

# build weight matrix
W = weightMatrix(ncol(SKCM_rank), type = "triangular", span = 0.5, plot = TRUE)

# extract DCARS test statistics
SKCM_stats = DCARSacrossNetwork(SKCM_rank,edgelist = STRING,
                                W = W, extractTestStatisticOnly = TRUE,
                                verbose = FALSE)
sort(SKCM_stats,decreasing=TRUE)[1:10]

shazanfar/DCARS documentation built on Oct. 14, 2020, 11:11 a.m.