TCA v1.0.0

0

Monthly downloads

0th

Percentile

Tensor Composition Analysis

Tensor Composition Analysis (TCA) allows the deconvolution of two-dimensional data (features by observations) coming from a mixture of sources into a three-dimensional matrix of signals (features by observations by sources). TCA further allows to test the features in the data for different statistical relations with an outcome of interest while modeling source-specific effects (TCA regression); particularly, it allows to look for statistical relations between source-specific signals and an outcome. For example, TCA can deconvolve bulk tissue-level DNA methylation data (methylation sites by individuals) into a tensor of cell-type-specific methylation levels for each individual (methylation sites by individuals by cell types) and it allows to detect cell-type-specific relations (associations) with an outcome of interest. For more details see Rahmani et al. (2018) <DOI:10.1101/437368>.

Readme

Tensor Composition Analysis (TCA)

Tensor Composition Analysis (TCA) allows the deconvolution of two-dimensional data (features by observations) coming from a mixture of sources into a three-dimensional matrix of signals (features by observations by sources). TCA further allows to test the features in the data for different statistical relations with an outcome of interest while modeling source-specific effects (TCA regression); particularly, it allows to look for statistical relations between source-specific signals and an outcome.

In the context of DNA methylation data, TCA can deconvolve tissue-level bulk methylation (methylation sites by individuals) into a tensor of cell-type-specific methylation levels for each individual (methylation sites by individuals by cell types) and it allows to detect cell-type-specific relations (associations) with an outcome of interest. For more details see Rahmani et al. (2019)1.

TCA is available in both R and Matlab. Note that the Matlab version was used for deriving the results in the publication describing TCA1.

R version

Travis build status

The R package of TCA will soon be available on CRAN

The full documentation of the TCA R package can be found here.

You can also find a full working example of TCA in this vignette about cell-type-specific resolution epigenetics using TCA in R.

Matlab version

Tne Matlab version of TCA was implemented and tested using Matlab R2015b.

Usage

TCA requires cell-type proportion estimates for the samples in the data. These can be obtained by either using the reference-based model by Houseman et al. 20122 (see an implementation here) or using the semi-supervised model by Rahmani et al. 20183 (does not require reference data; see an implementation here).

There are two main functions in this distribution. A full documentation of the input arguments and output values of these functions is provided in the headers of these function.

  • TCA_EWAS.m - for performing cell-type-specific EWAS under the TCA model.

  • TCA.m - for estimating cell-type-specific methylation levels (in case only these estimates are desired rather than performing a cell-type-specific EWAS).

Demo

We provide small simulated demo data, wherein the phenotype is associated with the last site in the data matrix. For performing EWAS on the demo files following the TCA model, execute in matlab the following commands from the 'demo' directory:

% <matlab code>
% Add the .m files to the path
addpath '../'
% Read the data files
y = dlmread('demo_y.txt');  % phenotype
X = dlmread('demo_X.txt');  % methylation matrix (individuals by sites)
W = dlmread('demo_W.txt');  % proportions matrix (individuals by cell types)
% Fit the parameters of the TCA model
[W,mus_hat,sigmas_hat,tau_hat] = TCA_fit_model(X, W);
% Perform EWAS under the TCA model with cell-type-specific effects
pvals = TCA_EWAS(y, X, W, mus_hat, sigmas_hat, tau_hat);

License

Both the R and Matlab versions of TCA are available under the GPL-3 license.

Author

This software was developed by Elior Rahmani (elior.rahmani@gmail.com).

Bug reports

Please open an issue for reporting bugs. If you are reporting bugs with the R version, please make sure to set the argument 'debug' to TRUE and attach your log. For both the R and Matlab versions, please make sure to attach the error message you get.


1. Rahmani et al. "Cell-type-specific resolution epigenetics without the need for cell sorting or single-cell biology." Nature Communications, in press (2019).

2. Houseman et al. "DNA methylation arrays as surrogate measures of cell mixture distribution." BMC bioinformatics (2012).

3. Rahmani et al. "BayesCCE: a Bayesian framework for estimating cell-type composition from DNA methylation without the need for methylation reference." Genome biology (2018).

Functions in TCA

Name Description
tensor Extracting hidden 3D signals from 2D input
tcasub Subsetting features from a TCA model
refactor Sparse principal component analysis using ReFACTor
test_data Generate test data
tcareg Fitting a TCA regression model
tca Fitting the TCA model
No Results!

Vignettes of TCA

Name
figs/fig1.png
figs/fig2.png
tca-vignette.Rmd
No Results!

Last month downloads

Details

Type Package
License GPL-3
Encoding UTF-8
LazyData true
RoxygenNote 6.1.1
URL https://www.biorxiv.org/content/10.1101/437368v1
BugReports https://github.com/cozygene/TCA/issues
VignetteBuilder knitr
NeedsCompilation no
Packaged 2019-05-20 19:21:28 UTC; eliorrahmani
Repository CRAN
Date/Publication 2019-05-22 14:10:03 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/TCA)](http://www.rdocumentation.org/packages/TCA)