1 / 93

Comparative analysis of RNA- Seq data with DESeq and DEXSeq

Comparative analysis of RNA- Seq data with DESeq and DEXSeq. Simon Anders EMBL Heidelberg. Two applications of RNA- Seq. Discovery find new transcripts find transcript boundaries find splice junctions

sagira
Download Presentation

Comparative analysis of RNA- Seq data with DESeq and DEXSeq

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Comparative analysis of RNA-Seq data with DESeq and DEXSeq Simon Anders EMBL Heidelberg

  2. Two applications of RNA-Seq Discovery • find new transcripts • find transcript boundaries • find splice junctions Comparison Given samples from different experimental conditions, find effects of the treatment on • gene expression strengths • isoform abundance ratios, splice patterns, transcript boundaries

  3. Alignment Should one align to the genome or the transcriptome? to transcriptome • easier, because no gapped alignment necessary (but: splice-aware aligners are mature by now) but: • risk to miss possible alignments! (transcription is more pervasive than annotation claims) → Alignment to genome preferred.

  4. Count data in HTS control-1 control-2 control-3 treated-1 treated-2 FBgn0000008 78 46 43 47 89 FBgn0000014 2 0 0 0 0 FBgn0000015 1 0 1 0 1 FBgn0000017 3187 1672 1859 2445 4615 FBgn0000018 369 150 176 288 383 [...] • RNA-Seq • Tag-Seq • ChIP-Seq • HiC • Bar-Seq • ...

  5. Counting rules • Count reads, not base-pairs • Count each read at most once. • Discard a read if • it cannot be uniquely mapped • its alignment overlaps with several genes • the alignment quality score is bad • (for paired-end reads) the mates do not map to the same gene

  6. Why we discard non-unique alignments gene A gene B control condition treatment condition

  7. Normalization for library size • If sample A has been sampled deeper than sample B, we expect counts to be higher. • Naive approach: Divide by the total number of reads per sample • Problem: Genes that are strongly and differentially expressed may distort the ratio of total reads.

  8. Normalization for library size • If sample A has been sampled deeper than sample B, we expect counts to be higher. • Naive approach: Divide by the total number of reads per sample • Problem: Genes that are strongly and differentially expressed may distort the ratio of total reads. • By dividing, for each gene, the count from sample A by the count for sample B, we get one estimate per gene for the size ratio or sample A to sample B. • We use the median of all these ratios.

  9. Normalization for library size

  10. Normalization for library size

  11. Normalization for library size To compare more than two samples: • Form a “virtual reference sample” by taking, for each gene, the geometric mean of counts over all samples • Normalize each sample to this reference, to get one scaling factor (“size factor”) per sample. Anders and Huber, 2010 similar approach: Robinson and Oshlack, 2010

  12. Sample-to-sample variation comparison of treatment vs control comparison of two replicates

  13. Effect size and significance Fundamental rule: • We may attribute a change in expression to a treatment only if this change is large compared to the expected noise. To estimate what noise to expect, we need to compare replicates to get a variance v. If we have m replicates, the standard error of the mean is (v/m).

  14. What do we mean by differential expression? A treatment affects some gene, which in turn affect other genes. In the end, all genes change, albeit maybe only slightly.

  15. What do we mean by differential expression? A treatment affects some gene, which in turn affect other genes. In the end, all genes change, albeit maybe only slightly. Potential stances: • Biological significance: We are only interested in changes of a certain magnitude. (effect size > some threshold) • Statistical significance: We want to be sure about the direction of the change. (effect size ≫ noise )

  16. Counting noise In RNA-Seq, noise (and hence power) depends on count level. Why?

  17. The Poisson distribution • This bag contains very many small balls, 10% of which are red. • Several experimenters are tasked with determining the percentage of red balls. • Each of them is permitted to draw 20 balls out of the bag, without looking.

  18. 3 / 20 = 15% 1 / 20 = 5% 2 / 20 = 10% 0 / 20 = 0%

  19. 7 / 100 = 7% 10 / 100 = 10% 8 / 100 = 8% 11 / 100 = 11%

  20. Poisson distribution • If p is the proportion of red balls in the bag, and we draw nballs, we expect µ=pnballs to be red. • The actual number k of red balls follows a Poisson distribution, and hence k varies around its expectation value µ with standard deviation µ.

  21. Poisson distribution • If p is the proportion of red balls in the bag, and we draw nballs, we expect µ=pnballs to be red. • The actual number k of red balls follows a Poisson distribution, and hence k varies around its expectation value µ with standard deviation µ. • Our estimate of the proportion p=k/n hence has the expected value µ/n=p and the standard error Δp =  µ/ n = p /  µ. The relative error is Δp/p = 1 /  µ.

  22. Poisson distribution: Counting uncertainty

  23. For Poisson-distributed data, the variance is equal to the mean. • Hence, no need to estimate the variance, according to many papers Really?

  24. Counting noise • Consider this situation: • Several flow cell lanes are filled with aliquots of the same prepared library. • The concentration of a certain transcript species is exactly the same in each lane. • We get the same total number of reads from each lane. • For each lane, count how often you see a read from the transcript. Will the count all be the same?

  25. Shot noise • Consider this situation: • Several flow cell lanes are filled with aliquots of the same prepared library. • The concentration of a certain transcript species is exactly the same in each lane. • We get the same total number of reads from each lane. • For each lane, count how often you see a read from the transcript. Will the count all be the same? • Of course not. Even for equal concentration, the counts will vary. This theoretically unavoidable noise is called shot noise.

  26. Shot noise • Shot noise: The variance in counts that persists even if everything is exactly equal. (Same as the evenly falling rain on the paving stones.) • Stochastics tells us that shot noise follows a Poisson distribution. • The standard deviation of shot noise can be calculated: it is equal to the square root of the average count.

  27. Sample-to-sample noise Now consider • Several lanes contain samples from biological replicates. • The concentration of a given transcript varies around a mean value with a certain standard deviation. • This standard deviation cannot be calculated, it has to be estimated from the data.

  28. Differential expression: Two questions Assume you use RNA-Seq to determine the concentration of transcripts from some gene in different samples. What is your question? • 1. “Is the concentration in one sample different from the expression in another sample?” or • 2. “Can the difference in concentration between treated samples and control samples be attributed to the treatment?”

  29. Fisher’s exact test between two samples Example data: fly cell culture, knock-down of pasilla (Brooks et al., Genome Res., 2011) knock-down sample T2 versus control sample U3 red: significant genes according to Fisher test (at 10% FDR)

  30. Fisher’s exact test between two samples Example data: fly cell culture, knock-down of pasilla (Brooks et al., Genome Res., 2011) knock-down sample T2 versus control sample U3 control sample U2 versus control sample U3 red: significant genes according to Fisher test (at 10% FDR)

  31. The negative binomial distribution A commonly used generalization of the Poisson distribution with two parameters

  32. The NB from a hierarchical model • Biological sample with • mean µ and variance v • Poisson distribution with • mean q and variance q. • Negative binomial with • mean µand variance q+v.

  33. Testing: Generalized linear models Two sample groups, treatment and control. Assumption: • Count value for a gene in sample j is generated by NB distribution with mean s j μjand dispersion α. Null hypothesis: • All samples have the same μj. Alternative hypothesis: • Mean is the same only within groups: log μj = β0+ xjβT xj= 0 for if j is control sample xj= 1for if j is treatment sample

  34. Testing: Generalized linear models log μj = β0+ xjβT xj= 0 for if j is control sample xj= 1 for if j is treatment sample Calculate the coefficients βthat fit best the observed data. Is the value for βT significantly different from null? Can we reject the null hypothesis that it is merely cause by noise? The Wald test gives us a p value.

  35. p values The p value from the Wald test indicates the probability that the observed difference between treatment and control (as indicated by βT), or an even stronger one, is observed even though the there is no true treatment effect.

  36. Multiple testing • Consider: A genome with 10,000 genes • We compare treatment and control. Unbeknownst to us, the treatment had no effect at all. • How many genes will have p < 0.05?

  37. Multiple testing • Consider: A genome with 10,000 genes • We compare treatment and control. Unbeknownst to us, the treatment had no effect at all. • How many genes will have p < 0.05? • 0.05 × 10,000 = 500 genes.

  38. Multiple testing • Consider: A genome with 10,000 genes • We compare treatment and control • Now, the treatment is real. • 1,500 genes have p < 0.05. • How many of these are false positives?

  39. Multiple testing • Consider: A genome with 10,000 genes • We compare treatment and control • Now, the treatment is real. • 1,500 genes have p < 0.05. • How many of these are false positives? • 500 genes, i.e., 33%

  40. Dispersion • A crucial input to the GLM procedure and the Wald test is the estimated strength of within-group variability. • Getting this right is the hard part.

  41. Replication at what level? • Prepare several libraries from the same sample (technical replicates). • controls for measurement accuracy • allows conclusions about just this sample

  42. Replication at what level? • Prepare several samples from the same cell-line (biological replicates). • controls for measurement accuracy and variations in environment an the cells’ response to them. • allows for conclusions about the specific cell line

  43. Replication at what level? • Derive samples from different individuals (independent samples). • controls for measurement accuracy, variations in environment and variations in genotype. • allows for conclusions about the species

  44. How much replication? Two replicates permit to • globally estimate variation Sufficiently many replicates permit to • estimate variation for each gene • randomize out unknown covariates • spot outliers • improve precision of expression and fold-change estimates

  45. Estimation of variability is the bottleneck Example: A gene differs by 20% between samples within a group (CV=0.2) What fold change gives rise to p=0.0001? (assuming normality and use of z or t test, resp.)

  46. Estimation of variability is the bottleneck Example: A gene differs by 20% between samples within a group (CV=0.2) What fold change gives rise to p=0.0001? (assuming normality and use of z or t test, resp.)

  47. Shrinkage estimation of variability Core assumption: Genes of similar expression strength have similar sample-to-sample variance. Under this assumption, we can estimate variance with more precision. Comparison of normalized counts between two replicate samples (Drosophila cell culture, treated with siRNA, data by Brooks et al., 2011) Baldi & Long (2001); Lönnsted & Speed (2002); Smyth (2004); Robinson, McCarthy & Smyth (2010); Wu et al (2013);…

  48. Shrinkage estimation of variability

  49. Dispersion • Minimum variance of count data: v = μ (Poisson) • Actual variance: v = μ + αμ ² • α : “dispersion” α = (μ - v) / μ ² (squared coefficient of variation of extra-Poisson variability)

  50. Shrinkage estimation of variability

More Related