1 Introduction

The crisprViz package enables the graphical interpretation of GuideSet objects from the crisprDesign package by plotting guide RNA (gRNA) cutting locations against their target gene or other genomic region.

This vignette walks through several use cases that demonstrate the range of and how to use plotting functions in the crisprViz package. This vignette also uses our core gRNA design package crisprDesignto manipulate GuideSet objects in conjunction with plotting in the process of gRNA design.

Visit our crisprVerse tutorial page to learn more about how to design gRNAs for different applications.

2 Installation and getting started

2.1 Software requirements

2.1.1 OS Requirements

This package is supported for macOS, Linux and Windows machines. Packages were developed and tested on R version 4.2.

2.2 Installation from Bioconductor

crisprViz can be installed from Bioconductor using the following commands in a fresh R session:


3 Use cases

All examples in this vignette will use human genome assembly hg38 from the BSgenome.Hsapiens.UCSC.hg38 package and gene model coordinates from Ensembl release 104. We begin by loading the necessary packages.


3.1 Visualizing the best gRNAs for a given gene

Suppose we want to design the four best gRNAs using the SpCas9 CRISPR nuclease to knockout the human KRAS gene. To have the greatest impact on gene function we want to prioritize gRNAs that have greater isoform coverage, and target closer to the 5’ end of the CDS.

Let’s load a precomputed GuideSet object containing all possible gRNAs targeting the the CDS of KRAS, and a GRangesList object describing the gene model for KRAS.

data("krasGuideSet", package="crisprViz")
data("krasGeneModel", package="crisprViz")
length(krasGuideSet) # number of candidate gRNAs
## [1] 52

For how to design such gRNAs, see the crisprDesign package. Before we plot all of our candidate gRNAs, let’s first generate a simple plot with a few gRNAs to familiarize ourselves with some plot components and options.


There are a few things to note here.

  • The ideogram track and genome axis track are at the top of our plot and give us coordinate information.
  • Our targetGene KRAS is plotted next, using coordinates from the provided gene model krasGeneModel, followed by our spacer subset. The name of each track is given on the left.
  • The strand information for each track is included in the label: <- for reverse strand and -> for forward strand.
  • While we can identify which exon each spacer targets (which may be sufficient), the plot window is too large to provide further information.
  • The plot only shows the 3’ end of KRAS, rather than the entire gene.

This last point is important: the default plot window is set by the spacers’ ranges in the input GuideSet object. We can manually adjust this window by using the from, to, extend.left, and extend.right arguments. Here is the same plot adjusted to show the whole KRAS gene, which also reveals an additional isoform that is not targeted by any spacer in this example subset.

from <- min(start(krasGeneModel$transcripts))
to <- max(end(krasGeneModel$transcripts))

As calculated above, there are a total of 52 candidate gRNAs targeting the CDS of KRAS. Including all of them could crowd the plot space, making it difficult to interpret. To alleviate this we can hide the gRNA labels by setting the showGuideLabels argument to FALSE.