Learn R Programming

snQTL (version 0.2)

get_diffnet_from_exp: The differential matrix

Description

Given observations from two populations X and Y, compute the differential matrix $$D = N(Y) - N(X)$$ where N() is the covariance matrix, or the weighted adjacency matrices defined as $$N_{ij} = |corr(i, j)|^beta$$ for some constant beta > 0, 1 <= i, j <= p. Let N represent the regular correlation matrix when beta=0, and covariance matrix when beta<0.

Usage

get_diffnet_from_exp(X, Y, adj.beta = -1, trans = FALSE, location = NULL)

Value

The p-by-p differential matrix \(D = N(Y) - N(X)\).

Arguments

X

n1-by-p matrix for samples from the first population. Rows are samples/observations, while columns are the features.

Y

n2-by-p matrix for samples from the second population. Rows are samples/observations, while columns are the features.

adj.beta

Power to transform correlation matrices to weighted adjacency matrices by \(N_{ij} = |r_ij|^adj.beta\) where \(r_ij\) represents the Pearson's correlation. When adj.beta=0, the correlation marix is used. When adj.beta<0, the covariance matrix is used. The default value is adj.beta=-1.

trans

logic variable, whether to only consider the trans-correlation (between genes from two different chromosomes or regions); see "details"

location

vector, the (chromosome) locations for items