weitrix: calibrate precision weights for diverse data types in a matrix, explore and test weighted or sparse data
Creators: name: Harrison, Paul
Publisher: name: F1000 Research Limited
Year: 2020

description: The Bioconductor package “weitrix” is a general set of tools for working with a matrix of measurements of varying precision, or where many measurements are missing. Some motivating examples: Poly(A) tails have been sequenced using PAT-Seq (Harrison et al., 2015). Measurements are the average tail length for each gene in each biological sample. Accuracy depends on the number of reads available, and may also vary with the mean tail length. 3’-end focussed RNA-Seq (single-cell or bulk) has identified alternative sites of cleavage and polyadenylation. For each gene the tendency to use upstrand or downstrand sites is quantified. Accuracy depends on the number of reads available, and the typical distribution of site usage. Gene expression levels have been measured using RNA-Seq (single-cell or bulk) or microarray. There is a mean-variance relationship. The first step when using weitrix is always to produce calibrated weights representing precision of measurement. The meaning of these weights is the same as for the base R “lm” function and for the limma package. Calibration follows a three step process: Perform an initial linear model fit for each row, possibly with some initial set of weights. Principal components can be used if a suitable model formula isn’t available. Fit the squared residuals of the entire dataset using a gamma GLM with log link function. The calibrated weights are then the inverse of the predictions of the fitted model. Possible predictors of measurement accuracy are specified in linear model formula syntax, and may include the prediction from the initial fit, initial weights, and any rowData or colData variables. Spline curves or polynomial functions of the predictors may be used. Visually confirm the quality of the calibrated weights by plotting weighted residuals against suspected predictors of measurement accuracy. No trend in the variance of the weighted residuals should remain. The standard deviation of each measurement is the inverse square root of the weight. The calibration accounts for both technical and biological variation. This process is similar to the voom method (Law et al., 2014), but with much greater flexibility in the information that can be used. It is also similar to a normal-gamma Double GLM (Smyth, 1989, and dglm package).<br><br>Once calibrated weights are obtained, weitrix provides a set of tools to explore and test any dataset: Find principal components of variation. This often directly reveals experimental and batch effects in a dataset or the most common patterns of variation between cells. It can also be used as input to non-linear dimensionality reduction or used to impute missing data. Test for rows with variability confidently larger than measurement noise. This is a quick model-free way to identify interesting genes. Test for rows with confidently large differences between two or more groups (or for any linear model contrasts). These tests are new applications of the Topconfects method for producing multiple-testing corrected confidence bounds (Harrison et al., 2019). In combination with the topconfects package, weitrix provides an end-to-end workflow based around measurement and estimation accuracy and confident effect sizes.<br><br>Weights can also be used with limma for a traditional analysis. weitrix can use DelayedArray matrix representations and BiocParallel parallel processing, allowing it to be used with large datasets.<br><br><b>References</b><br><br>Harrison, P. F., Pattison, A. D., Powell, D. R., and Beilharz, T. H. (2019). Topconfects: a package for confident effect sizes in differential expression analysis provides a more biologically useful ranked gene list. <i>Genome Biology</i>, <i>20</i>(1), 67. https://doi.org/10.1186/s13059-019-1674-7<br><br>Harrison, P. F., Powell, D. R., Clancy, J. L., Preiss, T., Boag, P. R., Traven, A., Seemann, T., and Beilharz, T. H. (2015). PAT-seq: a method to study the integration of 3’-UTR dynamics with gene expression in the eukaryotic transcriptome. <i>RNA</i>, <i>21</i>(8), 1502–1510. https://doi.org/10.1261/rna.048355.114<br><br>Law, C. W., Chen, Y., Shi, W., and Smyth, G. K. (2014). voom: precision weights unlock linear model analysis tools for RNA-seq read counts. <i>Genome Biology</i>, <i>15</i>(2), R29. https://doi.org/10.1186/gb-2014-15-2-r29<br><br>Smyth, G. K. (1989). Generalized Linear Models with Varying Dispersion. <i>Journal of the Royal Statistical Society: Series B (Methodological)</i>, <i>51</i>(1), 47–60. https://doi.org/10.1111/j.2517-6161.1989.tb01747.x