WaveQTL_preprocess: Preprocess functional data for a WaveQTL software.

Description Usage Arguments Value

View source: R/WaveQTL_preprocess_funcs.R

Description

This function preprocesses functional data for a wavelet-based approach implemented in a WaveQTL software. If library.read.depth is provided, the function standardizes the functional data by the library read depth to account for different read depths across individuals. Then, the function decomposes the (standardized) functional data into wavelet coefficients (WCs) using a wavethresh R package and normalizes the WCs. If Covariates are provided, the function corrects the WCs for the Covariates during the normalization. See the description of the function Normalize.WCs for details of normalization. Users can specify which type of wavelet transform should be applied by using filter.number and family in input arguments. They are arguments to the function wd in the R package wavethresh; See their manual for details. For now, the function doesn't allow users to specify the level of wavelet decomposition and uses the maximum level decomposition. In addition to wavelet transform, this function filters out some WCs that are computed based on very low counts. The function considers WCs as low count if the total counts used in their computation were less than or equal to ‘meanR.thresh’ per individual on average.

Usage

1
2
3
WaveQTL_preprocess(Data, library.read.depth = NULL, Covariates = NULL,
  meanR.thresh = 2, no.QT = FALSE, filter.number = 1,
  family = "DaubExPhase")

Arguments

Data

matrix (or a vector when N = 1) with N (# of samples) by T (# of bps in a region); This matrix contains original functional data to be decomposed; Here, T should be a power of 2.

library.read.depth

default= NULL a vector of length N (# of samples); i-th element contains library read depth for i-th sample.

Covariates

default = NULL; a matrix (or a vector if M = 1) with N by M (# of covariates) containing covariates to correct for.

meanR.thresh

If average reads across individuals <= meanR.thresh, those WCs are filtered out.

no.QT

TRUE or FALSE; default=FALSE; if no.QT == FALSE, perform quantile transform during normalization (often for testing); if no.QT == TRUE, just correct WCs for covariates (often for effect size estimation).

filter.number

default=1; argument to the function wd in the R package wavethresh; See their manual for details.

family

default="DaubExPhase"; argument to the function wd in the R package wavethresh; See their manual for details.

Value

WCs a matrix with N (# of samples) by T (# of bps in a region); n-th row contains WCs for n-th sample; WCs are ordered from low resolution WC to high resolution WC; For example, with a Haar wavelet transform, the first column contains WC (precisely speaking, scaling coefficient) that corresponds to sum of data in the region. The second column contains WC that contrasts the data in the first half vs second half of the region. The last column contains WC that contrasts the data in the (T-1)-th bp vs T-th bp.

filtered.WCs a vector of length T; t-th element indicates whether t-th WC in output (WCs) filtered (0) or not (1).


jean997/cfdrSims documentation built on May 18, 2019, 11:43 p.m.