Title: | BWA-based alignment of CRISPR gRNA spacer sequences |
---|---|
Description: | Provides a user-friendly interface to map on-targets and off-targets of CRISPR gRNA spacer sequences using bwa. The alignment is fast, and can be performed using either commonly-used or custom CRISPR nucleases. The alignment can work with any reference or custom genomes. Currently not supported on Windows machines. |
Authors: | Jean-Philippe Fortin [aut, cre] |
Maintainer: | Jean-Philippe Fortin <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.11.0 |
Built: | 2024-12-19 03:24:15 UTC |
Source: | https://github.com/bioc/crisprBwa |
Return BWA alignments for a list of short sequences for a prebuilt BWA index.
runBwa(sequences, bwa_index = NULL, n_mismatches = 3)
runBwa(sequences, bwa_index = NULL, n_mismatches = 3)
sequences |
Character vector of DNA sequences. |
bwa_index |
String specifying path to the BWA index. |
n_mismatches |
Integer specifying maximum number of mismatches allowed between the query sequences and the index sequences. |
runBwa
can be used to map short DNA sequences
to a reference genome. To search for sequences while imposing
constraints on PAM sequences (such as gRNA spacer sequences), see
runCrisprBwa
instead.
A data.frame of the alignments with the following columns:
query
— string specifying query DNA sequence
chr
- string specifying chromosome name
pos
- string specifying genomic coordinate of the start
of the target DNA sequence
strand
- string specifying strand ("+" or "-")
n_mismatches
- integer specifying number of mismatches
between query and target sequences
Jean-Philippe Fortin
link{runCrisprBwa}
to map gRNA spacer sequences.
fasta <- system.file(package="crisprBwa", "example/chr12.fa") outdir <- tempdir() index <- file.path(outdir, "chr12") Rbwa::bwa_build_index(fasta, index_prefix=index) seqs <- c("GGAAGTTG", "GTGGACAC", "GTGTGCAA") aln <- runBwa(seqs, n_mismatches=1, bwa_index=index)
fasta <- system.file(package="crisprBwa", "example/chr12.fa") outdir <- tempdir() index <- file.path(outdir, "chr12") Rbwa::bwa_build_index(fasta, index_prefix=index) seqs <- c("GGAAGTTG", "GTGGACAC", "GTGTGCAA") aln <- runBwa(seqs, n_mismatches=1, bwa_index=index)
Return bwa alignments for a list of gRNA spacer sequences.
runCrisprBwa( spacers, bwa_index = NULL, bsgenome = NULL, crisprNuclease = NULL, canonical = TRUE, ignore_pam = FALSE, n_mismatches = 0, force_spacer_length = FALSE, verbose = TRUE )
runCrisprBwa( spacers, bwa_index = NULL, bsgenome = NULL, crisprNuclease = NULL, canonical = TRUE, ignore_pam = FALSE, n_mismatches = 0, force_spacer_length = FALSE, verbose = TRUE )
spacers |
Character vector of DNA sequences corresponding to gRNA spacer sequences. Must all be of equal length. |
bwa_index |
Path to the bwa index to be used for alignment. |
bsgenome |
BSgenome object. |
crisprNuclease |
|
canonical |
Should only canonical PAM sequences be considered? TRUE by default. |
ignore_pam |
If TRUE, will return all matches regardless of PAM sequence. FALSE by default. |
n_mismatches |
Integer specifying maximum number of mismatches allowed between spacer and protospacer sequences. |
force_spacer_length |
Should the spacer length be overwritten in the crisprNuclease object? FALSE by default. |
verbose |
Should messages be printed to the consolde? TRUE by default. |
runCrisprBwa
is similar to runBwa
, with the
addition of imposing constraints on PAM sequences such that the query
sequences are valid protospacer sequences in the searched genome.
runBwa returns spacer alignment data, including genomic coordinates and sequence.
Jean-Philippe Fortin
link{runBwa}
to map general DNA sequences.
# Building BWA index first: fasta <- system.file(package="crisprBwa", "example/chr12.fa") outdir <- tempdir() index <- file.path(outdir, "chr12") Rbwa::bwa_build_index(fasta, index_prefix=index) # Aligning Cas9 gRNA library(BSgenome.Hsapiens.UCSC.hg38) seqs <- c("AGCTGTCCGTGGGGGTCCGC", "CCCCTGCTGCTGTGCCAGGC") data(SpCas9, package="crisprBase") bsgenome <- BSgenome.Hsapiens.UCSC.hg38 results <- runCrisprBwa(seqs, bsgenome=bsgenome, bwa_index=index, n_mismatches=2, crisprNuclease=SpCas9)
# Building BWA index first: fasta <- system.file(package="crisprBwa", "example/chr12.fa") outdir <- tempdir() index <- file.path(outdir, "chr12") Rbwa::bwa_build_index(fasta, index_prefix=index) # Aligning Cas9 gRNA library(BSgenome.Hsapiens.UCSC.hg38) seqs <- c("AGCTGTCCGTGGGGGTCCGC", "CCCCTGCTGCTGTGCCAGGC") data(SpCas9, package="crisprBase") bsgenome <- BSgenome.Hsapiens.UCSC.hg38 results <- runCrisprBwa(seqs, bsgenome=bsgenome, bwa_index=index, n_mismatches=2, crisprNuclease=SpCas9)