your-highness / normR

Normalization and difference calling for Next Generation Sequencing (NGS) data via joint multinomial modeling.
11 stars 0 forks source link

Function to get normalized #3

Closed your-highness closed 8 years ago

your-highness commented 8 years ago

From the diffr background fit a pseudo-count can be derived to calculate a normalized ChIP-seq enrichment. There should a accessible function to compute this quantity with:

p <- postierior_ct[i]
Pseu_ctrl <- sum(p[i] * count_ct[i]) / sum(p[i])
Pseu_treat <- sum(p[i] * count_treat[i]) / sum(p[i])
norm_count <- log( (count_treat[i] + pseu_treat[i]) / (count_ct[i] + pseu_ct[i]) ) / log(pseu_ct / pseu_treat)

Parameter "i" should specify the model with parameter closest to q*. This might be a problem where there is more enrichment than background, i.e. H3K27me3.

your-highness commented 8 years ago

Enrichment will be computed in src/em.cpp::normr_core(). To get enrichment, use getEnrichment() in R/NormRFit.R.