Learn R Programming

GPseq (version 0.5)

likelihood_ratio_tissue_generalized_poisson: Chi Square test statistic for comparison of expression levels of genes/exons across two conditions using the Generalized Poisson model

Description

This function compares the expression pattern of a given gene/exon across two given conditions or tissues. The null is that the gene is not differentially expressed across the two conditions. The input is the counts of a given gene/exon at each position in the two tissues and is modeled as a Generalized Poisson. The function outputs -2 times The Log likelihood ratio which is distributed as a Chi-Square with 1 degree of freedom. The Newton Raphson method is used to estimate the parameters in the null model and therefore the results are only applicable if the algorithm converges.

Usage

likelihood_ratio_tissue_generalized_poisson(x, lambda1, theta1, y, lambda2, theta2, w)

Arguments

x
Count vector of Gene/Exon in condition 1
lambda1
Lambda parameter for the Generalized Poisson for the Gene/Exon counts in Condition 1
theta1
Theta parameter for the Generalized Poisson for the Gene/Exon counts in Condition 2
y
Count vector of Gene/Exon in condition 2
lambda2
Lambda parameter for the Generalized Poisson for the Gene/Exon counts in condition 1
theta2
Theta parameter for the Generalized Poisson for the Gene/Exon counts in condition 2
w
Normalizing factor of condition 1 compared to condition 2

Value

~Describe the value returned If it is a LIST, use
mark
1 if the Newton Raphson algorithm converges. The test statistic is only valid if mark = 1
Gptest
Chi Square Statistic = -2 * Log Likelihood Ratio

References

Consul, P. C. (1989) Generalized Poisson Distributions: Properties and Applications. New York: Marcel Dekker. Sudeep Srivastava, Liang Chen A two-parameter generalized Poisson model to improve the analysis of RNA-Seq data Nucleic Acids Research Advance Access published July 29,2010 doi : 10.1093/nar/gkq670

See Also

generalized_poisson_likelihood , likelihood_ratio_tissue_poisson

Examples

Run this code
set.seed(666);
x <- rpois(100,1);
y <- rpois(100,5);

outx = generalized_poisson_likelihood(x);
outy = generalized_poisson_likelihood(y);
w = runif(1,0,1);

output = likelihood_ratio_tissue_generalized_poisson(x,outx$lambda,outx$theta,y,outy$lambda,outy$theta,w);

cat("Converged = ",output$mark," Test Statistic = ",output$Gptest,"\n");

Run the code above in your browser using DataLab