Read mapping and expression quantification
The following describes how reads are mapped, categorized, and assigned when quantifying gene and transcript expression:
- Reads are mapped to references determined by the selected reference type:
- Genome annotated with genes and transcripts. Reads are mapped to the provided Reference sequence and to reference sequences extracted for the annotated transcripts in the mRNA track, including splice variants. When Calculate expression for genes without transcripts is checked, genes without annotated transcripts are treated as one exon spanning the full gene, and a reference sequence is also extracted from the Gene track for those genes.
For example, for a gene with two splice variants (figure 34.38), one reference sequence is extracted for each splice variant, with the exons joined at the exon-exon junctions (figure 34.39).
Figure 34.38: A gene with three exons and two splice variants.
Figure 34.39: The reference sequences extracted for the two splice variants, with the exons joined at the exon-exon junctions. - Genome annotated with genes only. Reads are mapped to the provided Reference sequence and to reference sequences extracted for the annotated genes in the Gene track.
- One reference sequence per transcript. Reads are mapped to the provided Reference sequence.
- Genome annotated with genes and transcripts. Reads are mapped to the provided Reference sequence and to reference sequences extracted for the annotated transcripts in the mRNA track, including splice variants. When Calculate expression for genes without transcripts is checked, genes without annotated transcripts are treated as one exon spanning the full gene, and a reference sequence is also extracted from the Gene track for those genes.
- For paired reads, paired distances are estimated using transcript-level reference sequences. Introns are therefore excluded from the distance measurement, reflecting the transcripts from which the read pairs were generated.
- A pair is considered broken when the reads map outside the estimated paired distance, map in an unsupported orientation, or only one read in the pair maps. See General notes on handling paired data for additional details.
- Reads that map to more distinct genomic locations than specified by Maximum number of hits for a read are left unmapped. For example, distinct locations are determined as follows:
- If two genes overlap, mappings to the same shared genomic location count as one hit. The read is assigned to one of the genes using the EM estimation algorithm.
- If an exon is shared by several transcripts, mappings to the same genomic location count as one hit. For example, a read mapping within the first exon in figure 34.38 matches both extracted transcripts, but counts as one hit.
- If alternative splicing allows a read to map to the same genomic region in different ways, each distinct mapping counts as a hit.
- If two genes overlap, mappings to the same shared genomic location count as one hit. The read is assigned to one of the genes using the EM estimation algorithm.
- Reads mapping outside genes are counted as intergenic and do not contribute to expression values. The expected read orientation does not apply to these reads. If a read maps equally well to a gene and an intergenic region, it is assigned to the gene.
- Mapped reads are categorized and assigned to genes and transcripts, as relevant. Reads that map to more than one gene or transcript are distributed using the EM estimation algorithm.
- When Genome annotated with genes and transcripts is selected, gene expression values are calculated by summing the counts of the transcripts belonging to each gene.
- When reads have been annotated with and/or grouped by UMIs by tools of the Biomedical Genomics Analysis plugin:
- Reads mapping to the same gene with the same UMI sequence are grouped, including reads that were grouped before running this tool.
- Expression values in gene- and transcript-level expression tracks are based on the number of distinct UMIs rather than the number of reads.
- The report includes distinct UMI fragment counts and raw read fragment counts. The distribution of biotypes is based on distinct UMIs.
Expression measures
Exons are defined as follows, depending on the selected reference type:
- Genome annotated with genes and transcripts. The provided mRNA track defines the exons. For genes without annotated transcripts, an exon is the full gene when Calculate expression for genes without transcripts is checked.
- Genome annotated with genes only. Each gene in the provided Gene track is considered an exon.
- One reference sequence per transcript. Each sequence in the provided Reference sequence is considered an exon.
RPKM (Reads Per Kilobase of exon model per Million mapped reads) [Mortazavi et al., 2008] is calculated as:
- For a gene-level expression track, reads mapped to the feature is the value in the Total exon reads column, and feature length (KB) is the value in the Exon length column divided by 1000.
- For a transcript-level expression track, reads mapped to the feature is the value in the Total transcript reads column, and feature length (KB) is the value in the Transcript length column divided by 1000.
- Mapped reads is the total number of mapped reads, as listed in the RNA-Seq report. For paired reads, intact pairs are counted as one unless Count paired reads as two is checked.
For paired reads, when Count paired reads as two is unchecked, RPKM corresponds to FPKM (Fragments Per Kilobase of exon model per Million mapped fragments).
TPM (Transcripts Per Million) [Li et al., 2010a] is calculated as:
When 3' sequencing is selected, gene-level TPM is calculated as:
Tightly packed genes and genes in operons
Only reads that map completely within the gene boundaries are counted as mapping to the gene. Reads that extend beyond the gene boundaries are considered intergenic. This can be too conservative when genes are close to each other, organized in operons, or short, or when non-coding 5' regions are not included in the annotations. In such situations:
- Use One reference sequence per transcript and provide a list of transcript sequences. Such a list can be generated from an mRNA track, or from a gene track for bacteria, using Extract Annotations.
- For paired reads, check Count paired reads as two so that each mapped read contributes to the gene it overlaps.
The EM estimation algorithm
The EM estimation algorithm is inspired by the RSEM [Li et al., 2010a] and eXpress [Roberts and Pachter, 2013] methods. It iteratively estimates the abundance of transcripts, and assigns reads to transcripts according to these abundances. The algorithm is described here for transcripts. The same procedure is applied to genes when the reference is annotated with genes only, and to reference sequences when One reference sequence per transcript is selected.
To illustrate the interpretation of abundance, consider the following two examples.
In the first example, we have a gene with two transcripts,
and
, where
is twice as long as
(figure 34.40).
is also twice as abundant as
. This means that of the three reads in the exon shared by both transcripts, two come from
and one comes from
.
has a second exon, which generates two more reads. So
is twice as abundant as
, but because it is twice as long, it generates four times as many reads.
Figure 34.40: The longer transcript
has twice the abundance of the shorter transcript
, but four times the number of reads.
In the second example, the setup is the same, but now
is twice as abundant as
(figure 34.41). Because
is twice as long, both transcripts generate the same number of reads.
Figure 34.41: The longer transcript
has half the abundance of the shorter transcript
, but the same number of reads.
To estimate the transcript abundances, we carry out an expectation-maximization procedure. Before explaining the procedure, we define the concept of a transcript set: the set of transcripts to which a read can map. In the above examples, the non-uniquely mapping reads can map to the transcript set
, and the uniquely mapping reads can map only to the transcript set
. The count of a transcript set is the number of reads that can map to exactly the transcripts in the set. In both examples, the count of
is 3, because 3 reads are shared between the transcripts. The count of
is 2 in the first example, and 1 in the second example.
The expectation-maximization algorithm proceeds as follows:
- The transcript abundances are initialized to the uniform distribution, that is, with
transcripts, each transcript starts with an abundance of
.
- Expectation step: the current transcript abundances are used to calculate the expected count of each transcript, that is, the number of reads expected to be assigned to it. For each transcript set that includes the transcript, the transcript is assigned a fraction of the count of the transcript set, proportional to its abundance relative to the total abundance of the transcripts in the transcript set.
- Maximization step: the currently assigned counts are used to re-compute the transcript abundances. For each transcript, the fraction of all reads currently assigned to it is divided by the transcript length, because longer transcripts are expected to generate proportionally more reads. The resulting values are then normalized so that the abundances of all transcripts sum to one.
- Repeat from the expectation step until convergence.
Below, we illustrate how the expectation-maximization algorithm converges to the expected abundances for the above two examples, where transcript 1 is
and transcript 2 is
.
Example 1: Initially: transcript 2 abundance = 0.50, count: 0.00, transcript 1 abundance = 0.50, count: 0.00 After 1 round: transcript 2 abundance = 0.54, count: 3.50, transcript 1 abundance = 0.46, count: 1.50 After 2 rounds: transcript 2 abundance = 0.57, count: 3.62, transcript 1 abundance = 0.43, count: 1.38 After 3 rounds: transcript 2 abundance = 0.59, count: 3.70, transcript 1 abundance = 0.41, count: 1.30 After 4 rounds: transcript 2 abundance = 0.60, count: 3.76, transcript 1 abundance = 0.40, count: 1.24 After 5 rounds: transcript 2 abundance = 0.62, count: 3.81, transcript 1 abundance = 0.38, count: 1.19 After 6 rounds: transcript 2 abundance = 0.62, count: 3.85, transcript 1 abundance = 0.38, count: 1.15 After 7 rounds: transcript 2 abundance = 0.63, count: 3.87, transcript 1 abundance = 0.37, count: 1.13 After 8 rounds: transcript 2 abundance = 0.64, count: 3.90, transcript 1 abundance = 0.36, count: 1.10 After 9 rounds: transcript 2 abundance = 0.64, count: 3.92, transcript 1 abundance = 0.36, count: 1.08 After 10 rounds: transcript 2 abundance = 0.65, count: 3.93, transcript 1 abundance = 0.35, count: 1.07 After 11 rounds: transcript 2 abundance = 0.65, count: 3.94, transcript 1 abundance = 0.35, count: 1.06 After 12 rounds: transcript 2 abundance = 0.65, count: 3.95, transcript 1 abundance = 0.35, count: 1.05 After 13 rounds: transcript 2 abundance = 0.66, count: 3.96, transcript 1 abundance = 0.34, count: 1.04 After 14 rounds: transcript 2 abundance = 0.66, count: 3.97, transcript 1 abundance = 0.34, count: 1.03 After 15 rounds: transcript 2 abundance = 0.66, count: 3.97, transcript 1 abundance = 0.34, count: 1.03
Example 2: Initially: transcript 2 abundance = 0.50, count: 0.00, transcript 1 abundance = 0.50, count: 0.00 After 1 round: transcript 2 abundance = 0.45, count: 2.50, transcript 1 abundance = 0.55, count: 1.50 After 2 rounds: transcript 2 abundance = 0.42, count: 2.36, transcript 1 abundance = 0.58, count: 1.64 After 3 rounds: transcript 2 abundance = 0.39, count: 2.26, transcript 1 abundance = 0.61, count: 1.74 After 4 rounds: transcript 2 abundance = 0.37, count: 2.18, transcript 1 abundance = 0.63, count: 1.82 After 5 rounds: transcript 2 abundance = 0.36, count: 2.12, transcript 1 abundance = 0.64, count: 1.88 After 6 rounds: transcript 2 abundance = 0.35, count: 2.08, transcript 1 abundance = 0.65, count: 1.92 After 7 rounds: transcript 2 abundance = 0.35, count: 2.06, transcript 1 abundance = 0.65, count: 1.94 After 8 rounds: transcript 2 abundance = 0.34, count: 2.04, transcript 1 abundance = 0.66, count: 1.96 After 9 rounds: transcript 2 abundance = 0.34, count: 2.03, transcript 1 abundance = 0.66, count: 1.97 After 10 rounds: transcript 2 abundance = 0.34, count: 2.02, transcript 1 abundance = 0.66, count: 1.98 After 11 rounds: transcript 2 abundance = 0.34, count: 2.01, transcript 1 abundance = 0.66, count: 1.99 After 12 rounds: transcript 2 abundance = 0.34, count: 2.01, transcript 1 abundance = 0.66, count: 1.99 After 13 rounds: transcript 2 abundance = 0.33, count: 2.01, transcript 1 abundance = 0.67, count: 1.99 After 14 rounds: transcript 2 abundance = 0.33, count: 2.00, transcript 1 abundance = 0.67, count: 2.00 After 15 rounds: transcript 2 abundance = 0.33, count: 2.00, transcript 1 abundance = 0.67, count: 2.00
Once the algorithm has converged, each non-uniquely mapping read is randomly assigned to one of the transcripts in its transcript set, with probabilities proportional to the abundances of these transcripts. The Total columns of the expression tracks reflect these assignments. The RPKM and TPM values are then calculated from the assigned counts, as described in Expression measures.
