Published in


Dash Apps that Analyze RNA Sequencing Data for Drug & Vaccine Development

📌 To learn more about Dash, Dash Bio, and Pileup.js, watch our webinar recorded on May 20 with Alyssa Morrow, bioinformatics PhD Candidate at UC Berkeley.

Author: Alyssa Morrow

Dash RNA-Seq exploration app

Vaccines are powering the world’s news cycles in 2021. You may have heard professionals explaining terms like “spike proteins” or “herd immunity”. You may have even heard, in high school, that the mitochondria is the powerhouse of the cell. Put simply, biology and the field of bioinformatics has never been more crucial to the advancement of humanity.

The mitochondria may be the powerhouse of the cell, but what makes cells different? How can we measure those differences? And how are leading experts leveraging these tools to power medical breakthroughs?

In this blog post, we’ll show you how experts use Dash and Pileup.js to explore differentially expressed genes of cells that have been subject to different conditions.

Your body’s skin cells and neurons have the same DNA, but there are many additional factors that define the roles of cells within your body.

Live Mouse Skin Cell Imaging, Copyright: Jonathan Palero

One of the ways that skin cells and neurons can perform such vastly different functions is through the expression of different genes. Genes are encoded in our DNA, and can be transcribed from our DNA to ultimately make proteins. However, before proteins are made, these genes can express themselves at different levels.These levels of gene expression, for all of the tens of thousands of genes in a cell, is referred to as the transcriptome.

So if the transcriptome can help us determine how cells develop differently, then what does it look like? The transcriptome is made up of many molecules of RNA, including messenger RNA, or mRNA for short. mRNA is transcribed from genes. Therefore, the number of mRNA molecules that we can count in a given cell give us an idea of the level of expression for different genes. These mRNA molecules are eventually translated into amino acid sequences, which ultimately make proteins. The quantity and variety of proteins that are available in a cell ultimately help it perform a specific function, whether it be producing melanin, stimulating an electric current, or fighting off those suspicious sniffles.

Because the transcriptome varies so much between cells, it can tell us with precision how cells are different. We can use information about the transcriptome to determine exactly how skin cells differ from neuron cells (for example).

So, how do we measure and track the transcriptome? RNA sequencing (“RNA-seq”) is a technique that allows us to measure the quantity of mRNA in a biological sample. RNA-seq gives us an idea of the level of expression for each gene. We then use these different levels of expression for all known genes and compare them between different types of cells.

RNA-seq can be used to answer many important questions about the transcriptome, and can be broadly used to answer important questions in biological, clinical, and drug development research:

  • In biological research, we might investigate the effect of knocking out, or removing, the expression of a specific gene.
  • In a clinical setting, we might identify genes that either inhibit or activate signaling pathways that are mis-regulated in cancer.
  • Finally, RNA-seq can be used in drug development, where we can monitor how the transcriptome changes after drug interference.

However, before we can analyze RNA-seq, we must first process the data. First, we must align sequenced reads to the genome, using tools such as STAR or Rsubread [1], [2]. Once these reads are aligned, individual genes can be quantified using tools for transcript quantification, such as RSEM [3]. Other quantification tools such as kallisto [4] allow genes to be quantified without the need for alignment . These quantification tools allow for the collection of count data that indicate the level of expression for each gene in an RNA-seq sample, and, ultimately, all known genes.

One common task in the analysis of count data from RNA-seq is the detection of genes that are differentially expressed between two conditions. As mentioned above, example analyses that evaluate changes in gene expression include:

  • Comparison of gene expression between a CRISPR knockout and a corresponding control
  • Identification of genes that are differentially expressed between a tumor sample and a healthy control sample
  • Identification of changes in gene expression that result from the interference of a drug

In order to detect genes that differ between conditions, many tools, such as DeSeq2 and edgeR [5], [6], are able to determine the magnitude of which a given gene changes expression between two conditions. This magnitude is referred to as the effect size. Although these tools allow for initial identification of genes that are different between two conditions, visualization of RNA-seq data can help us better identify genes that are truly differentially expressed in our dataset (true positives).

In today’s example, we have borrowed from the CRUK CI Bioinformatics Core tutorial, which demonstrates how to process, align, and quantify RNA-seq samples from a mouse mammary dataset (SRA accession SRP045534). For the purposes of today’s tutorial, we assume that the samples have already been processed, and we would now like to analyze results to identify genes that are differentially expressed between two conditions. Here, we are particularly interested in identifying differentially expressed genes between two different cell types. Specifically, we will evaluate changes in gene expression between basal (B) and luminal (LUM) cell types in mouse mammary cells.

Visualizing and selecting differentially expressed genes with Dash Bio

First, we would like to visualize differentially expressed genes between our conditions of interest. Here we’ll use the VolcanoPlot from Dash Bio to read and visualize differentially expressed genes. A volcano plot visualizes the effect size of gene expression between two conditions on the x-axis, compared to the statistical significance of that gene (measured in -log10(p-value)) on the y-axis. You can read more about interactive volcano plots in this blog post.

Depending on the dataset, we may want to vary the threshold in which we consider a gene to be significant. Sometimes, we consider genes with an absolute effect size, or log2 fold change, greater than 1, to be of interest. By using a RangeSlider, we can vary the threshold in which we consider a gene to be strongly differentially expressed, and see which genes we gain or lose from updating this threshold.

Visualizing RNA-seq data with Pileup.js

To visualize aligned reads from our RNA-seq data in a genome browser, we use Dash and the Pileup.js Dash component (if you haven’t used Dash for Python, R or Julia, please see Introduction to Dash). The Pileup.js component is just one of the many open-source components available in Dash Bio. We can use Dash so that any selected gene in our volcano plot will be automatically visualized in the Pileup.js component as it is selected. Shown below, we can view various genes, which have varying levels of differential expression between the basal and luminal cell types.

We can first explore the number of RNA-seq reads that are aligned to a given gene by looking at a coverage track in pileup.js, which shows us the counts of reads at every region in the genome. For some genes, the counts may be very different between conditions. However, for other genes, the counts may be very similar, thus possibly identifying a false positive in our dataset. We can also use our visualization of RNA-seq data to confirm that reads aligned to a given gene actually belong there. Sometimes, reads can align to a gene, but may not actually belong there. This is similar to if you tried to put a puzzle piece in the wrong spot of a puzzle: it would stick out like a sore thumb! Luckily, we can use pileup tracks to visualize RNA-seq reads. Reads that have many mismatches (shown in red, green. blue, and yellow ticks), may not be well aligned. This suggests that these genes are hard to evaluate, and may need additional attention.

We may not be only interested in visualizing RNA-seq data within our Pileup.js component, but may also want to view different types of data that we have collected from a set of conditions. It is often the case that we may have other datasets collected from a set of conditions that we would like to visualize alongside our RNA-seq data. For example, we may have matching ATAC-seq, DNase-seq, or ChIP-seq data that we would like to visualize. In these cases, we may be interested in how these datasets change between conditions in regions surrounding differentially expressed genes. In these cases, we can simply replace RNA-seq data in the Pileup.js component with any other file of interest.

Using the Pileup.js Dash component for your own analysis

In this tutorial, we leveraged the Pileup.js component to visualize RNA-seq data. Dash Bio also supports Igv.js (, which similarly allows visualization of multiple types of genomic data in a genome browser format. Igv.js supports additional file formats that are not supported in pileup.js, including bigwig, cram, and tdf files. Although both Pileup.js and Igv.js can be used interchangeably, we find that pileup.js works well when your data may not be stored in traditional bioinformatics based file formats. Pileup.js supports the visualization of data through JSON. This makes it easier for users to convert and visualize data that may be stored in a dataframe or matrix, instead of bioinformatics based formats such as bam files, bed files, or vcf files. A comparison of cases in which you can use Igv.js and Pileup.js are shown in the table below.

The example below shows how we can load in a JSON file, containing alignment information in GA4GH format, into a Pileup.js component. Creating a Dash app with the Pileup genome viewer is as simple as this:

In summary, the Pileup.js component supports the following types of visualizations:

  • Genome coverage
  • Genes
  • Features
  • Variants
  • Genotypes
  • Alignments
  • Ideograms

See our documentation to learn more about how to use the Igv.js and Pileup.js components to visualize your own genomic data.

If you would like to learn more about how this works in practice, watch this recorded webinar ➡️



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store