Learn R Programming

pint (version 1.22.0)

window: Form data with a selected window size for the model fitting

Description

Forms a chosen window of two data matrices to use for fit.dependency.model either iteratively picking nearest genes or picking same number of genes from both directions. sparse.window forms a window around one sample in the first data set with a number of samples from the second data set.

Usage

fixed.window(X, Y, middleIndex, windowSize) iterative.window(X, Y, middleIndex, windowSize) sparse.window(X, Y, xIndex, windowSize)

Arguments

X
First data set. In sparse.window windows will be formed around each sample in this data set.
Y
Second data set.
middleIndex
Index of middle position for window.
xIndex
Index of middle position in X for window.
windowSize
Number of genes in window. In sparse.window X has always one sample in window.

Value

List of window data:
X
window of the first data set
Y
window of the second data set
loc
location of gene
geneName
name of the gene
edge
logical; TRUE if iteration to one direction has stopped because edge of data in chromosomal arm has been found.
fail
logical; TRUE if chromosomal arm contains less than windowSize genes.

Details

Window contains windowSize nearest genes. Warning is given if windowSize genes is not found in the same chromosomal arm. Data of both data sets is normalised so that each genes data has zero mean.

See Also

Dependency model fitting: fit.dependency.model

Examples

Run this code
data(chromosome17)
window <- iterative.window(geneExp, geneCopyNum, 30, 10)
model <- fit.dependency.model(window$X, window$Y)

# Conversion from DependencyModel to GeneDependencyModel so that gene name and location can be stored
model <- as(model,"GeneDependencyModel")
setGeneName(model) <- window$geneName
setLoc(model) <- window$loc
model

window <- fixed.window(geneExp, geneCopyNum, 10, 10)
model <- fit.dependency.model(window$X, window$Y)
model

Run the code above in your browser using DataLab