logit_seq: logit_seq

View source: R/MODULE_4_TER_BASE.R

logit_seqR Documentation

logit_seq

Description

Function to perform the logistic regression test for differential translational efficiency

Usage

logit_seq(x, design, model, feature_list = NULL, long_output = FALSE)

Arguments

x

Input data frame where each column contains RNA or RPF counts from a single sample. Rows are genes/transcripts.

design

Design matrix of the experiment describing samples and their attributes. i-th row in the design matrix corresponds to the i-th column in the input data frame.

model

Regression equation modeling the odds ratio of RPF/RNA counts against the selected design variables (sample attributes)

feature_list

(Optional) A vector containing IDs of genes/transcripts. Must have the same length as the row number of input data frame.

Details

The response variable is always the read type which should be a factor variable with two levels: "RNA" and "RPF". Translational efficiency of each sample if formulated as the odds of RPF vs. RNA reads. The change in translational efficiency between samples or based on unit values of any predictor (design variable) is given by the exponentiated regression coefficient. Exponentiated intercept gives the TE for the sample with all the attributes at the reference level. If the predcitor variable is categorical, its levels are sorted alphabetically, the first level is set to reference and all other levels are compared to it. The reference level can be manually changed using the relevel() function of R.

Value

A matrix containing the output of the regression. If long output is requested, four values are reported for each predictor in the regression 'model' including the intercept: regression coefficient (beta), standard deviation of the estimated beta, z-score and Wald-test p-value. If long output is not specified, only regression coefficients and p-values are reported. Gene/transcript IDs provided by the 'feature_list' argument is added to the output matrix as row names.

Examples

Test the effect of lung metastasis on translational efficiency:
fit1_LMCN <- Ribolog::logit_seq(rr_LMCN.v2[,-1], sample_attributes_LMCN, read_type ~ lung_metastasis, as.vector(rr_LMCN.v2$transcript))
Test the effects of lung metastasis and cell line origin on translational efficiency:
fit2_LMCN <- Ribolog::logit_seq(rr_LMCN.v2[,-1], sample_attributes_LMCN, read_type ~ lung_metastasis + cell_line_origin, as.vector(rna.rpf.combined.m5$transcript))
Test the effects of lung metastasis, cell line origin and their interaction on translational efficiency:
fit3_LMCN <- Ribolog::logit_seq(rr_LMCN.v2[,-1], sample_attributes_LMCN, read_type ~ lung_metastasis * cell_line_origin, as.vector(rna.rpf.combined.m5$transcript))
Test the effect of cell line on translational efficiency (cell line "CN34" is used as reference because it comes first alphabetically):
fit4_LMCN <- Ribolog::logit_seq(rr_LMCN.v2[,-1], sample_attributes_LMCN, read_type ~ cell_line, as.vector(rr_LMCN.v2$transcript))
Test the effect of cell line on translational efficiency with cell line "MDA" set as reference:
sample_attributes_LMCN$cell_line <- relevel(sample_attributes_LMCN$cell_line, ref = "MDA")
fit5_LMCN <- Ribolog::logit_seq(rr_LMCN.v2[,-1], sample_attributes_LMCN, read_type ~ cell_line, as.vector(rr_LMCN.v2$transcript))

goodarzilab/Ribolog documentation built on Oct. 7, 2022, 10:14 p.m.