Note that an updated version of this package, including Python 3 support, is maintained by the Tsai Lab: https://github.com/tsailabSJ/guideseq
This repo (aryeelab/guideseq) contains experimental features.
The guideseq package implements our data preprocessing and analysis pipeline for GUIDE-Seq data. It takes raw sequencing reads (FASTQ) and a parameter manifest file (.yaml) as input and produces a table of annotated off-target sites as output.
Tsai SQ, Zheng Z, Nguyen NT, Liebers M, Topkar VV, Thapar V, Wyvekens N, Khayter C, Iafrate AJ, Le LP, Aryee MJ, Joung JK. GUIDE-seq enables genome-wide profiling of off-target cleavage by CRISPR-Cas nucleases. Nat Biotechnol. 2015 Feb;33(2):187-197
Tsai SQ, Topkar VV, Joung JK, Aryee MJ. Open-source guideseq software for analysis of GUIDE-seq data. Nat Biotechnol. 2016 May 6;34(5):483
The package implements a pipeline consisting of a read preprocessing module followed by an off-target identification module. The preprocessing module takes raw reads (FASTQ) from a pooled multi-sample sequencing run as input. Reads are demultiplexed into sample-specific FASTQs and PCR duplicates are removed using unique molecular index (UMI) barcode information.
The individual pipeline steps are:
bwa
alignment toolbedtools
genome arithmetic utility# It's recommended (but not essential) to set up a conda environment to manage dependencies
conda create -n guideseq python=3.8
conda activate guideseq
git clone --recursive https://github.com/aryeelab/guideseq
cd guideseq
pip install -r requirements.txt
python setup.py install
guideseq.py -h
## Please install BWA and bedtools if you choose this option
brew
on OSX or apt-get
on Ubuntu/Debian), or you can download it from the project page and compile it from source.brew
or apt-get
), or you can download it from the project page and compile it from source.For both bwa and bedtools, make sure you know the path to the respective executables, as they need to be specified in the pipeline manifest file.
guideseq.py all -m test_manifest.yaml
To run the full guideseq analysis pipeline, you must first create a manifest YAML file that describes all pipeline inputs. Once you have done so, you can simply run
guideseq.py all -m /path/to/manifest.yaml
to run the entire pipeline. Below are specific instructions detailing how to write the manifest file.
If you wish to run an example on our abridged test data, you can simply run
cd guideseq/test
guideseq.py all -m test_manifest.yaml
from the guideseq root directory. The test_manifest
assumes that both the bwa
and bedtools
executables are in your system PATH. You will see the pipeline results outputted to the test/output
folder.
When running the end-to-end analysis functionality of the guideseq package, a number of inputs are required. To simplify the formatting of these inputs and to encourage reproducibility, these parameters are inputted into the pipeline via a manifest formatted as a YAML file. YAML files allow easy-to-read specification of key-value pairs. This allows us to easily specify our parameters. The following fields are required in the manifest:
reference_genome
: The absolute path to the reference genome FASTA file.output_folder
: The absolute path to the folder in which all pipeline outputs will be saved.bwa
: The absolute path to the bwa
executablebedtools
: The absolute path to the bedtools
executablePAM
: PAM sequence (optional), default is NGG.search_radius
: Search radius for search. Set to 10 for Cas9 and 75 for Cpf1.max_mismatches
: The maximum number of mismatches allowed to report a sequence-matched off-targetundemultiplexed
: The absolute paths to the undemultiplexed paired end sequencing files. The required parameters are:
forward
: The absolute path to the FASTQ file containing the forward reads.reverse
: The absolute path to the FASTQ file containing the reverse reads.index1
: The absolute path to the FASTQ file containing the forward index reads.index2
: The absolute path to the FASTQ file containing the reverse index reads.An example undemultiplexed
field:
undemultiplexed:
forward: ../test/data/undemux.r1.fastq.gz
reverse: ../test/data/undemux.r2.fastq.gz
index1: ../test/data/undemux.i1.fastq.gz
index2: ../test/data/undemux.i2.fastq.gz
samples
: A nested field containing the details of each sample. At least two samples must be specified: a "control" sample (to be used to filter out background off-target sites) and at least one treatment sample. The required parameters are:
target
: The sample targetsitesbarcode1
: The forward barcodebarcode2
: The reverse barcodedescription
: A description of the sampleAn example samples
field:
samples:
control:
target:
barcode1: CTCTCTAC
barcode2: CTCTCTAT
description: Control
[SAMPLENAME]:
target: GAGTCCGAGCAGAAGAAGAANGG
barcode1: TAGGCATG
barcode2: TAGATCGC
description: EMX1
Below is an example of a full manifest file. Feel free to copy it and replace the parameters with your own experiment data. Remember that you can input more than just one treatment sample (e.g. the "EMX1" data below).
reference_genome: test/test_genome.fa
output_folder: test/output
bwa: bwa
bedtools: bedtools
PAM: NGG
demultiplex_min_reads: 1000
window_size: 75
max_mismatches: 7
undemultiplexed:
forward: test/data/undemultiplexed/undemux.r1.fastq.gz
reverse: test/data/undemultiplexed/undemux.r2.fastq.gz
index1: test/data/undemultiplexed/undemux.i1.fastq.gz
index2: test/data/undemultiplexed/undemux.i2.fastq.gz
samples:
control:
target:
barcode1: CTCTCTAC
barcode2: CTCTCTAT
description: Control
EMX1:
target: GAGTCCGAGCAGAAGAAGAANGG
barcode1: TAGGCATG
barcode2: TAGATCGC
description: EMX_site1
When running the full pipeline, the results of each step are outputted to the output_folder
in a separate folder for each step. The output folders and their respective contents are as follows:
output_folder/demultiplexed
: Contains the four undemultiplexed reads files (forward, reverse, index1, index2) for each sample.output_folder/umitagged
: Contains the two umitgged reads files (forward, reverse) for each sample.output_folder/consolidated
: Contains the two consolidated reads files (forward, reverse) for each sample.output_folder/aligned
: Contains an alignment .sam
file for each sample.output_folder/identified
: Contains a tab-delimited .txt
file for each sample with an identified off-target in each row.output_folder/filtered
: Contains a tab-delimited .txt
file for each sample containing the identified DSBs that are background sites (not off-targets)output_folder/visualization
: Contains a .svg
vector image representing an alignment of all detected off-targets to the targetsite for each sample.The final detected off-target sites are placed in the output_folder/identified
folder, with one .txt
file for each sample specified in the manifest. The fields that are populated in each row of these off-target files are specified below:
.txt
Fields:BED Chromosome
: Window chromosomeBED Min.Position
: Window 0-based start positionBED Max.Position
: Window 0-based end positionBED Name
: Name of window Filename
: The name of the current .SAM
file used in analysis.WindowIndex
: Index number of windowChromosome
: Chromosome corresponding to position with maximum reads in window (matches BED Chromosome
)Position
: Position with maximum number of reads in windowSequence
: The window sequence, starting 25 bp upstream and ending 25 bp downstream of Chromosome:Position
+.mi
: Number of forward reads with distinct molecular indices-.mi
: Number of reverse reads with distinct molecular indicesbi.sum.mi
: Sum of the +.mi
and -.mi
fields (GUIDE-seq Read Count)bi.geometric_mean.mi
: Geometric mean of the +.mi
and -.mi
fields+.total
: Total number of forward mapping reads -.total
: Total number of reverse mapping reads total.sum
: Sum of +.total
and -.total
fieldstotal.geometric_mean
: Geometric mean of the +.total
and -.total
fieldsprimer1.mi
: Number of reads amplified by forward primer with distinct molecular indicesprimer2.mi
: Number of reads amplified by reverse primer with distinct molecular indicesprimer.geometric_mean
: Geometric mean of the primer1.mi
and primer2.mi
fieldsposition.stdev
: Standard deviation of positions within genomic windowOff-Target Sequence
: Off-target sequence derived from genome referenceMismatches
: Number of mismatches between the intended target sequence and the off-target sequenceLength
: Length of the target sequenceBED off-target Chromosome
: Off-target chromosomeBED off-target start
: Off-target 0-based start positionBED off-target end
: Off-target 0-based end positionBED off-target name
: Off-target nameBED Score
: Field to conform to standard BED formatStrand
: Indicates the strand of detected off-target site. +
for forward strand and -
for reverse strandCells
: Cell typeTarget site
: Targetsite nameTarget Sequence
: Intended target site sequence (including PAM)The key fields for interpreting this output and identifying off-target sites are: BED off-target Chromosome
, BED off-target start
, BED off-target end
, BED off-target name
, BED off-target strand
, Off-Target Sequence
, bi.sum.mi
The outputted visualizations are in the .svg
vector format, which is an open image standard that can be viewed in any modern web browser (e.g. Google Chrome, Apple Safari, Mozilla Firefox), and can be viewed and edited in any vector editing application (e.g. Adobe Illustrator). Because the output visualizations are vector images, they can be scaled up or down infinitely without a loss in quality, and can also be edited as shapes with ease. This makes the images produced by the guideseq package ideal for posters, presentations, and papers.
In addition to end-to-end pipeline analysis functionality, the guideseq package also allows for every step fo the analysis to be run individually. Here we have detailed the required inputs and expected outputs of each step. For each step, we have included a "runnable example" command that can be executed from the guideseq root directory to run that step on the included sample data. These "runnable example" snippets put their output in the test/output
folder.
demultiplex
Pooled Multi-Sample Sequencing (Manifest Required)output_folder/consolidated
folder.-m or --manifest
: Specify the path to the manifest YAML filepython guideseq/guideseq.py demultiplex -m test/test_manifest.yaml
umitag
Readsoutput_folder/undemultiplexed
(where output_folder
is specified in the manifest), 'tag' the reads by adding the UMI barcode sequence to the FASTQ read name header in preparation for the subsequent PCR duplicate read consolidation step. The forward and reverse files for each sample in the manifest are outputted to the output_folder/umitagged
folder.--read1
: Path to the forward demultiplexed reads file (FASTQ)--read2
: Path to the reverse demultiplexed reads file (FASTQ)--index1
: Path to the index1 demultiplexed reads file (FASTQ)--index2
: Path to the index2 demultiplexed reads file (FASTQ)--outfolder
: Path to the folder in which the output files will be savedRunnable Example:
python guideseq/guideseq.py umitag --read1 test/data/demultiplexed/EMX1.r1.fastq \
--read2 test/data/demultiplexed/EMX1.r2.fastq \
--index1 test/data/demultiplexed/EMX1.i1.fastq \
--index2 test/data/demultiplexed/EMX1.i2.fastq \
--outfolder test/output/
consolidate
PCR Duplicatesoutfolder
.--read1
: Path to the forward umitagged reads file (FASTQ)--read2
: Path to the reverse umitagged reads file (FASTQ)--outfolder
: Path to the folder in which the output files will be saved--min_quality
: The minimum quality of a read for it to be considered in the consolidation--min_frequency
: The minimum frequency of a read for the position to be consolidatedRunnable Example:
python guideseq/guideseq.py consolidate --read1 test/data/umitagged/EMX1.r1.umitagged.fastq \
--read2 test/data/umitagged/EMX1.r2.umitagged.fastq \
--outfolder test/output/
align
Sites to Genomebwa
package. Outputs an alignment .sam
file to the outfolder
.--bwa
: Path to the bwa
executable--genome
: Path to the reference genome FASTA file--read1
: Path to the consolidated forward read FASTQ file--read2
: Path to the consolidated reverse read FASTQ file--outfolder
: Path to the folder in which the output files will be savedRunnable Example:
python guideseq/guideseq.py align --bwa bwa --genome test/test_genome.fa\
--read1 test/data/consolidated/EMX1.r1.consolidated.fastq\
--read2 test/data/consolidated/EMX1.r2.consolidated.fastq\
--outfolder test/output/
identify
Off-target Site Candidates.txt
file containing the identified off-target sites.--aligned
: Path to the site-specific alignment .sam
file.--genome
: Path to the reference genome FASTA file.--outfolder
: Path to the folder in which the output files will be saved.--target_sequence
: The sequence targeted in the sample (blank for control sample)--description
: Specify additional information about the sample.Runnable Example:
python guideseq/guideseq.py identify --aligned test/data/aligned/EMX1.sam\
--genome test/test_genome.fa --outfolder test/output/\
--target_sequence GAGTCCGAGCAGAAGAAGAANGG --description EMX1
filter
Background DSB Sites.txt
files for a treatment and control samples, output a .txt
file in the same format as outputted by the identify
step containing the sites filtered out as false-positives.--bedtools
: Path to the bedtools
executable--identified
: Path to the .txt
file outputted by the identify
step for a treatment sample.--background
: Path to the .txt
file outputted by the identify
step for a control sample.--outfolder
: Path to the folder in which the output files will be saved.Runnable Example:
python guideseq/guideseq.py filter --bedtools bedtools\
--identified test/data/identified/EMX1_identifiedOfftargets.txt\
--background test/data/identified/control_identifiedOfftargets.txt\
--outfolder test/output/
visualize
Detected Off-Target Sites.txt
file, output an alignment visualization of the off-target sites.--infile
: Path to the input .txt.
off-targets file--outfolder
: Path to the outputted folder containing the outputted .svg
graphic--title
: Specify the title of the visualization, to be printed at the top of the graphic. Useful for posters and presentations.Runnable Example:
python guideseq/guideseq.py visualize --infile test/data/identified/EMX1_identifiedOfftargets.txt\
--outfolder test/output/ --title EMX1
If you already have demultiplexed data, you can run the pipeline on the data by running each step after demultiplexing individually, as described in the "Running Analysis Steps Individually" section above. Be sure to run the individual steps in the following orders:
umitag
consolidate
align
identify
filter
visualize
Yes. If your reads do not have UMIs, you can run the pipeline on previously demultiplexed data as described in the "Running Analysis Steps Individually" section above, starting with the align
step. Note that we have not analyzed such data ourselves! We suspect that PCR duplication bias may affect the quantitative interpretion of GUIDE-Seq read counts, but have not explored this.
The guideseq package requires a reference genome for read mapping. You can use any genome of your choosing, but for all of our testing and original GUIDE-seq analyses (Tsai et al. Nature Biotechnol 2015) we use hg19 (download). Be sure to (g)unzip the FASTA file before use if it is compressed.
The guideseq package requires index reads from the MiSeq sequencing run for read consolidation. The default MiSeq Reporter settings do not generate index (I1, I2) reads. This feature can be enabled by adding the line
<add key="CreateFastqForIndexReads" value="1">
to the Miseq Reporter.exe.config
file located in the Miseq Reporter installation folder. The default installation folder is C:\Illumina\MiSeqReporter
. After modifying the config file it should look like this:
<appSettings>
... [LEAVE EXISTING LINES UNCHANGED] ...
<add key="CreateFastqForIndexReads" value="1">
</appSettings>
The MiSeq Reporter service needs to be restarted for the change to take effect. Future runs of the GenerateFASTQ workflow (and probably other workflows) will generate I1 and I2 reads in addition to R1 and R2. All four of these reads files will be needed for guideseq analysis.
See page 29 of the Miseq Reporter User Guide for further instructions.