Title: | Base functions and classes for CRISPR gRNA design |
---|---|
Description: | Provides S4 classes for general nucleases, CRISPR nucleases, CRISPR nickases, and base editors.Several CRISPR-specific genome arithmetic functions are implemented to help extract genomic coordinates of spacer and protospacer sequences. Commonly-used CRISPR nuclease objects are provided that can be readily used in other packages. Both DNA- and RNA-targeting nucleases are supported. |
Authors: | Jean-Philippe Fortin [aut, cre] |
Maintainer: | Jean-Philippe Fortin <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.11.0 |
Built: | 2024-10-30 05:34:58 UTC |
Source: | https://github.com/bioc/crisprBase |
Annotate mismatches between spacer and protospacer sequences.
annotateMismatches(spacers, protospacers, rnase = FALSE)
annotateMismatches(spacers, protospacers, rnase = FALSE)
spacers |
A character vector specifying spacer sequences (gRNA). |
protospacers |
A character vector specifying protospacer sequences (target DNA). |
rnase |
Is it for an RNAse? FALSE by default. If TRUE, spacers and protospacers are expected to be the reverse complement of each other. |
A data.frame storing spacer and protospacer columns, as well as number of mismatches, and positions for the different mismatches, if any. Positions are relative to the 5' end of the spacer sequences. For RNAses (e.g. CasRx), this means that a mismatch at position 1 corresponds to the last nucleotide of the protospacer sequence.
Jean-Philippe Fortin
spacers <- c("CCGGAGCGAGTTGCAGTAAGCAG", "GCCGGAGCGAGTTGCAGTAAGCA", "GGCCGGAGCGAGTTGCAGTAAGC") protospacers=c("CTGCTTACTGCAACTCGCTCTGG", "TGCTTAATGCAACCCGCTCCGGC", "GCTTACTGCAACTCGCTCCGGCC") ann <- annotateMismatches(spacers, protospacers, rnase=TRUE)
spacers <- c("CCGGAGCGAGTTGCAGTAAGCAG", "GCCGGAGCGAGTTGCAGTAAGCA", "GGCCGGAGCGAGTTGCAGTAAGC") protospacers=c("CTGCTTACTGCAACTCGCTCTGG", "TGCTTAATGCAACCCGCTCCGGC", "GCTTACTGCAACTCGCTCCGGCC") ann <- annotateMismatches(spacers, protospacers, rnase=TRUE)
CrisprNuclease object for the Wildtype Acidaminococcus Cas12a (AsCas12a) nuclease.
data(AsCas12a, package="crisprBase")
data(AsCas12a, package="crisprBase")
CrisprNuclease object.
The AsCas12a nuclease recognizes TTTV PAM sequences. Spacer sequences must be located downstream of PAM sequences.
An S4 class to represent a base editor
baseEditorName(object) baseEditorName(object) <- value editingWeights(object, ...) editingWeights(object) <- value editingStrand(object, ...) editingStrand(object) <- value BaseEditor( CrisprNuclease, baseEditorName = NA_character_, editingStrand = c("original", "opposite"), editingWeights = NULL ) ## S4 method for signature 'BaseEditor' show(object) ## S4 method for signature 'BaseEditor' baseEditorName(object) ## S4 replacement method for signature 'BaseEditor' baseEditorName(object) <- value ## S4 method for signature 'BaseEditor' editingWeights(object, substitutions = NULL) ## S4 replacement method for signature 'BaseEditor' editingWeights(object) <- value ## S4 method for signature 'BaseEditor' editingStrand(object) ## S4 replacement method for signature 'BaseEditor' editingStrand(object) <- value
baseEditorName(object) baseEditorName(object) <- value editingWeights(object, ...) editingWeights(object) <- value editingStrand(object, ...) editingStrand(object) <- value BaseEditor( CrisprNuclease, baseEditorName = NA_character_, editingStrand = c("original", "opposite"), editingWeights = NULL ) ## S4 method for signature 'BaseEditor' show(object) ## S4 method for signature 'BaseEditor' baseEditorName(object) ## S4 replacement method for signature 'BaseEditor' baseEditorName(object) <- value ## S4 method for signature 'BaseEditor' editingWeights(object, substitutions = NULL) ## S4 replacement method for signature 'BaseEditor' editingWeights(object) <- value ## S4 method for signature 'BaseEditor' editingStrand(object) ## S4 replacement method for signature 'BaseEditor' editingStrand(object) <- value
object |
BaseEditor object. |
value |
Value to replaced with. |
... |
Additional arguments for class-specific methods |
CrisprNuclease |
A CrisprNuclease object. |
baseEditorName |
String specifying base editor name. |
editingStrand |
String indicating which strand with respect to the target protospacer sequence will be edited. Must be either "original" or "opposite". "original" by default. |
editingWeights |
Numeric matrix of editing weights. Column names must be indicating relative position to the PAM site. Row names must be of the form "X2Y" where "X" represents the origin base, and "Y" represents the subtituted base. For instance, "C2T" indicates the row corresponding to C to T editing. |
substitutions |
Character vector indicating which substitutions should be returned. |
A BaseEditor object
BaseEditor()
: Create a BaseEditor object
baseEditorName
Name of the base editor.
editingWeights
Matrix of editing weights.
editingStrand
String indicating which strand with respect to the target protospacer sequence will be edited. Must be either "original" or "opposite". "original" by default.
Use the constructor link{BaseEditor}
to create
a BaseEditor object.
baseEditorName
:To get the name of the base editor.
editingWeights
:To return the matrix of editing weights.
editingStrand
:To return the editing strand.
baseEditorName<-
:To change the name of the base editor.
editingWeights<-
:To change the matrix of editing weights.
editingStrand<-
:To change the editing strand.
# Creating an object for BE4max (C to T editor) # based on experimental weights ws <- c(0.7, 0.7, 0.8, 1.8, 1, 2, 1.4, 1.2, 2.3, 1.3, 2.4, 2.2, 3.4, 2.2, 2.1, 3.5, 5.8, 16.2, 31.8, 63.2, 90.3, 100, 87, 62, 31.4, 16.3, 10, 5.6, 3.3, 1.9, 1.8, 2.4, 1.7, 0.5, 0.2, 0.1) ws <- matrix(ws, nrow=1, ncol=length(ws)) rownames(ws) <- "C2T" colnames(ws) <- -36:-1 data(SpCas9, package="crisprBase") BE4max <- BaseEditor(SpCas9, baseEditorName="BE4max", editingStrand="original", editingWeights=ws) metadata(BE4max)$description_base_editor <- "BE4max cytosine base editor."
# Creating an object for BE4max (C to T editor) # based on experimental weights ws <- c(0.7, 0.7, 0.8, 1.8, 1, 2, 1.4, 1.2, 2.3, 1.3, 2.4, 2.2, 3.4, 2.2, 2.1, 3.5, 5.8, 16.2, 31.8, 63.2, 90.3, 100, 87, 62, 31.4, 16.3, 10, 5.6, 3.3, 1.9, 1.8, 2.4, 1.7, 0.5, 0.2, 0.1) ws <- matrix(ws, nrow=1, ncol=length(ws)) rownames(ws) <- "C2T" colnames(ws) <- -36:-1 data(SpCas9, package="crisprBase") BE4max <- BaseEditor(SpCas9, baseEditorName="BE4max", editingStrand="original", editingWeights=ws) metadata(BE4max)$description_base_editor <- "BE4max cytosine base editor."
BaseEditor for the cytosine base editor CRISPR/Cas9 system BE4max. Editing weights were obtained from https://doi.org/10.1016/j.cell.2020.05.037
data(BE4max, package="crisprBase")
data(BE4max, package="crisprBase")
BaseEditor object.
BaseEditor for the cytosine base editor CRISPR/Cas9 system BE4max. Editing weights were obtained from https://doi.org/10.1016/j.cell.2020.05.037.
CrisprNuclease object for the Cas13d-NLS from Ruminococcus flavefaciens strain XPD3002 nuclease (RNase).
data(CasRx, package="crisprBase")
data(CasRx, package="crisprBase")
CrisprNuclease object.
The CasRx nuclease was derived from Cas13d Ruminococcus flavefaciens string XPD3002. See 10.1016/j.cell.2018.02.033.
An S4 class to represent a CRISPR nickase.
CrisprNickase( nickaseName, nickingStrand = c("original", "opposite"), pams = NA_character_, weights = rep(1, length(pams)), metadata = list(), pam_side = NA_character_, spacer_gap = 0L, spacer_length = NA_integer_ ) ## S4 method for signature 'CrisprNickase' show(object) ## S4 method for signature 'CrisprNickase' pamLength(object) ## S4 method for signature 'CrisprNickase' spacerLength(object) ## S4 replacement method for signature 'CrisprNickase' spacerLength(object) <- value ## S4 method for signature 'CrisprNickase' pamSide(object) ## S4 replacement method for signature 'CrisprNickase' pamSide(object) <- value ## S4 method for signature 'CrisprNickase' spacerGap(object) ## S4 replacement method for signature 'CrisprNickase' spacerGap(object) <- value ## S4 method for signature 'CrisprNickase' hasSpacerGap(object) ## S4 method for signature 'CrisprNickase' targetLength(object) ## S4 method for signature 'CrisprNickase' pams(object, primary = TRUE, ignore_pam = FALSE, as.character = FALSE) ## S4 method for signature 'CrisprNickase' pamIndices(object) ## S4 method for signature 'CrisprNickase' spacerIndices(object) ## S4 method for signature 'CrisprNickase' prototypeSequence(object, primary = TRUE)
CrisprNickase( nickaseName, nickingStrand = c("original", "opposite"), pams = NA_character_, weights = rep(1, length(pams)), metadata = list(), pam_side = NA_character_, spacer_gap = 0L, spacer_length = NA_integer_ ) ## S4 method for signature 'CrisprNickase' show(object) ## S4 method for signature 'CrisprNickase' pamLength(object) ## S4 method for signature 'CrisprNickase' spacerLength(object) ## S4 replacement method for signature 'CrisprNickase' spacerLength(object) <- value ## S4 method for signature 'CrisprNickase' pamSide(object) ## S4 replacement method for signature 'CrisprNickase' pamSide(object) <- value ## S4 method for signature 'CrisprNickase' spacerGap(object) ## S4 replacement method for signature 'CrisprNickase' spacerGap(object) <- value ## S4 method for signature 'CrisprNickase' hasSpacerGap(object) ## S4 method for signature 'CrisprNickase' targetLength(object) ## S4 method for signature 'CrisprNickase' pams(object, primary = TRUE, ignore_pam = FALSE, as.character = FALSE) ## S4 method for signature 'CrisprNickase' pamIndices(object) ## S4 method for signature 'CrisprNickase' spacerIndices(object) ## S4 method for signature 'CrisprNickase' prototypeSequence(object, primary = TRUE)
nickaseName |
Name of the CRISPR nickase. |
nickingStrand |
String specifying with strand with respect to the motif sequence (5' to 3') is nicked. Must be either "original" (default) or "opposite". |
pams |
Character vector of PAM sequence motifs written from 5' to 3. If the point of cleavage has been determined, the precise site is marked with ^. Only letters in the IUPAC code are accepted. For nickases that cleave away from their recognition sequence, the cleavage sites are indicated in parentheses. See details for more information. |
weights |
Optional numeric vector specifying relative weights of the PAM sequences to specify cleavage probabilities. |
metadata |
Optional list providing global metadata information. |
pam_side |
String specifying the side of the PAM sequence sequence with respect to the protospacer sequence. Must be either '3prime' (e.g. Cas9) or '5prime' (e.g. Cas12a) |
spacer_gap |
Integer specifying the length (in nucleotides) between the spacer sequence and the PAM sequence (e.g. 0 for Cas9 and Cas12a). |
spacer_length |
Integer specifying the length of the spacer sequence |
object |
CrisprNickase object. |
value |
For |
primary |
Should only the PAM sequence with the heighest weight be returned? If no cleavage weights are stored in the CrisprNickase object, all sequences are returned. TRUE by default. |
ignore_pam |
Should all possible k-mer sequences for a given PAM length be returned, irrespetively of the PAM sequence motifs stored in the CrisprNickase object? FALSE by default. |
as.character |
Should the PAM sequences be returned as a character vector? FALSE by default. |
A CrisprNickase object
CrisprNickase()
: Create a CrisprNickase object
pam_side
String specifying the side of the PAM sequence with respect to the protospacer sequence. Must be either '3prime' (e.g. SpCas9) or '5prime' (e.g. AsCas12a)
spacer_length
Integer specifying the length of the spacer sequence
spacer_gap
Integer specifying the length (in nucleotides) between the spacer sequence and the PAM sequence (e.g. 0 for SpCas9 and AsCas12a).
Use the constructor link{CrisprNickase}
to create
a CrisprNickase object.
nickaseName
:To get the name of the CRISPR nickase.
spacerLength
:To return the length of the spacer sequence.
targetLength
:To return the length of the target sequence (protospacer + pam).
pamLength
:To return the length of the PAM sequence.
pamSide
:To return the side of the PAM sequence with respect to the spacer sequence.
spacerGap
:To return the length of the gap between the PAM and spacer sequences.
pams
:To return the list of PAM sequences.
spacerGap<-
:To change the length of the gap between the PAM and spacer sequences.
pamSide<-
:To change the side of the PAM sequence with respect to the protospacer sequence.
spacerLength<-
:To change the length of the spacer sequence.
pamIndices
:To return the relative coordinates of the PAM sequence within the protospacer sequence.
spacerIndices
:To return the relatiive coordinates of the spacer sequence within the protospacer sequence.
Cas9D10A <- CrisprNickase("Cas9D10A", nickingStrand="opposite", pams=c("(3)NGG", "(3)NAG", "(3)NGA"), weights=c(1, 0.2593, 0.0694), metadata=list(description="D10A-mutated Streptococcus pyogenes Cas9 (SpCas9) nickase"), pam_side="3prime", spacer_length=20) Cas9H840A <- CrisprNickase("Cas9H840A", nickingStrand="original", pams=c("(3)NGG", "(3)NAG", "(3)NGA"), weights=c(1, 0.2593, 0.0694), metadata=list(description="H840A-mutated Streptococcus pyogenes Cas9 (SpCas9) nickase"), pam_side="3prime", spacer_length=20)
Cas9D10A <- CrisprNickase("Cas9D10A", nickingStrand="opposite", pams=c("(3)NGG", "(3)NAG", "(3)NGA"), weights=c(1, 0.2593, 0.0694), metadata=list(description="D10A-mutated Streptococcus pyogenes Cas9 (SpCas9) nickase"), pam_side="3prime", spacer_length=20) Cas9H840A <- CrisprNickase("Cas9H840A", nickingStrand="original", pams=c("(3)NGG", "(3)NAG", "(3)NGA"), weights=c(1, 0.2593, 0.0694), metadata=list(description="H840A-mutated Streptococcus pyogenes Cas9 (SpCas9) nickase"), pam_side="3prime", spacer_length=20)
CrisprNuclease object for the RNA-targeting Csm complex from Streptococcus thermophilus
data(Csm, package="crisprBase")
data(Csm, package="crisprBase")
CrisprNuclease object.
The specific Csm complex is an RNA-targeting nuclease derived from Streptococcus thermophilus. There is no preferred PAM sequences, and the default (optimal) spacer length is 32nt. See https://doi.org/10.1038/s41587-022-01649-9.
CrisprNuclease object for the Enhanced Acidaminococcus Cas12a (AsCas12a) nuclease.
data(enAsCas12a, package="crisprBase")
data(enAsCas12a, package="crisprBase")
CrisprNuclease object.
The enAsCas12a nuclease recognizes an extended set of PAM sequences beyong the canonical TTTV sequence for AsCas12a. Spacer sequences must be located downstream of PAM sequences.
Extract PAM sequences from target sequences (protospacer + PAM) using information stored in a CrisprNuclease object.
extractPamFromTarget(targets, object)
extractPamFromTarget(targets, object)
targets |
Character vector of target sequences. |
object |
|
Character vector of PAM sequences of length equal to that of the
targets
character vector.
Jean-Philippe Fortin
data(SpCas9, AsCas12a, package="crisprBase") # Extracting PAM sequences from Cas9 protospacers: targets <- c("AGGTGCTGATTGTAGTGCTGCGG", "AGGTGCTGATTGTAGTGCTGAGG") extractPamFromTarget(targets, SpCas9) # Extracting PAM sequences from Cas12a targets: targets <- c("TTTAAGGTGCTGATTGTAGTGCTGTGT", "TTTCAGGTGCTGATTGTAGTGCTGAAA") extractPamFromTarget(targets, AsCas12a)
data(SpCas9, AsCas12a, package="crisprBase") # Extracting PAM sequences from Cas9 protospacers: targets <- c("AGGTGCTGATTGTAGTGCTGCGG", "AGGTGCTGATTGTAGTGCTGAGG") extractPamFromTarget(targets, SpCas9) # Extracting PAM sequences from Cas12a targets: targets <- c("TTTAAGGTGCTGATTGTAGTGCTGTGT", "TTTCAGGTGCTGATTGTAGTGCTGAAA") extractPamFromTarget(targets, AsCas12a)
Extract protospacer sequences from target sequences (protospacer + PAM) using information stored in a CrisprNuclease object.
extractProtospacerFromTarget(targets, object)
extractProtospacerFromTarget(targets, object)
targets |
Character vector of targets sequences. |
object |
|
Character vector of protospacer sequences of
length equal to that of the
targets
character vector.
Jean-Philippe Fortin
data(SpCas9, AsCas12a, package="crisprBase") # Extracting protospacer sequences from Cas9 targets: targets <- c("AGGTGCTGATTGTAGTGCTGCGG", "AGGTGCTGATTGTAGTGCTGAGG") extractProtospacerFromTarget(targets, SpCas9) # Extracting protospacer sequences from Cas12a targets: targets <- c("TTTAAGGTGCTGATTGTAGTGCTGTGT", "TTTCAGGTGCTGATTGTAGTGCTGAAA") extractProtospacerFromTarget(targets, AsCas12a)
data(SpCas9, AsCas12a, package="crisprBase") # Extracting protospacer sequences from Cas9 targets: targets <- c("AGGTGCTGATTGTAGTGCTGCGG", "AGGTGCTGATTGTAGTGCTGAGG") extractProtospacerFromTarget(targets, SpCas9) # Extracting protospacer sequences from Cas12a targets: targets <- c("TTTAAGGTGCTGATTGTAGTGCTGTGT", "TTTCAGGTGCTGATTGTAGTGCTGAAA") extractProtospacerFromTarget(targets, AsCas12a)
Return list of available CrisprNuclease objects in crisprBase.
getAvailableCrisprNucleases()
getAvailableCrisprNucleases()
Character vector of available CrisprNuclease
objects found
in crisprBase
.
Jean-Philippe Fortin
getAvailableCrisprNucleases()
getAvailableCrisprNucleases()
Return cut site coordinates from PAM site coordinates.
getCutSiteFromPamSite(pam_site, strand, nuclease = NULL)
getCutSiteFromPamSite(pam_site, strand, nuclease = NULL)
pam_site |
Coordinate of the first nucleotide of the PAM sequence. |
strand |
Either "+" or "-". |
nuclease |
A CrisprNuclease object. |
numeric vector of cut sites
Jean-Philippe Fortin
data(SpCas9, package="crisprBase") getCutSiteFromPamSite(pam_site=100, strand="+", nuclease=SpCas9) getCutSiteFromPamSite(pam_site=100, strand="-", nuclease=SpCas9)
data(SpCas9, package="crisprBase") getCutSiteFromPamSite(pam_site=100, strand="+", nuclease=SpCas9) getCutSiteFromPamSite(pam_site=100, strand="-", nuclease=SpCas9)
Construct a cut site GRanges from a list of PAM sites using information stored in a CrisprNuclease object.
getCutSiteRanges( gr = NULL, seqnames = NULL, pam_site = NULL, strand = NULL, nuclease = NULL )
getCutSiteRanges( gr = NULL, seqnames = NULL, pam_site = NULL, strand = NULL, nuclease = NULL )
gr |
GRanges object of width 1 specifying the coordinates of the first nucleotide of the PAM sequences. |
seqnames |
Character vector of genomic sequence names.
Ignored if |
pam_site |
Numeric vector specifying the coordinates of the
first nucleotide of the PAM sequences corresponding to the
PAM sequences. Ignored if |
strand |
Character vector specifying the strand of the PAM.
Ignored if |
nuclease |
CrisprNuclease object. |
GRanges object representing genomic coordinates of the cut sites.
Jean-Philippe Fortin
data(SpCas9, AsCas12a, package="crisprBase") library(GenomicRanges) gr <- GRanges("chr10", IRanges(start=c(100,120), width=1), strand=c("+","-")) getCutSiteRanges(gr, nuclease=SpCas9) getCutSiteRanges(gr, nuclease=AsCas12a)
data(SpCas9, AsCas12a, package="crisprBase") library(GenomicRanges) gr <- GRanges("chr10", IRanges(start=c(100,120), width=1), strand=c("+","-")) getCutSiteRanges(gr, nuclease=SpCas9) getCutSiteRanges(gr, nuclease=AsCas12a)
Return optimal editing site coordinates from PAM site coordinates.
getEditingSiteFromPamSite( pam_site, strand, baseEditor = NULL, substitution = NULL )
getEditingSiteFromPamSite( pam_site, strand, baseEditor = NULL, substitution = NULL )
pam_site |
Coordinate of the first nucleotide of the PAM sequence. |
strand |
Either "+" or "-". |
baseEditor |
A BaseEditor object. |
substitution |
String indicating which substitution should be used to estimate the optimal editing position. E.g. "C2T" will return the optimal editing position for C to T editing. |
numeric vector of editing sites.
Jean-Philippe Fortin
data(BE4max, package="crisprBase") getEditingSiteFromPamSite(pam_site=100, strand="+", baseEditor=BE4max, "C2T")
data(BE4max, package="crisprBase") getEditingSiteFromPamSite(pam_site=100, strand="+", baseEditor=BE4max, "C2T")
Construct a PAM GRanges from a list of PAM sites using information stored in a CrisprNuclease object.
getPamRanges( gr = NULL, seqnames = NULL, pam_site = NULL, strand = NULL, nuclease = NULL )
getPamRanges( gr = NULL, seqnames = NULL, pam_site = NULL, strand = NULL, nuclease = NULL )
gr |
GRanges object of width 1 specifying the coordinates of the first nucleotide of the PAM sequences. |
seqnames |
Character vector of genomic sequence names.
Ignored if |
pam_site |
Numeric vector specifying the coordinates of the
first nucleotide of the PAM sequences corresponding to the
PAM sequences. Ignored if |
strand |
Character vector specifying the strand of the PAM.
Ignored if |
nuclease |
CrisprNuclease object. |
GRanges object representing genomic coordinates of PAM sequences.
Jean-Philippe Fortin
data(SpCas9, AsCas12a, package="crisprBase") library(GenomicRanges) gr <- GRanges("chr10", IRanges(start=c(100,120), width=1), strand=c("+","-")) getPamRanges(gr, nuclease=SpCas9) getPamRanges(gr, nuclease=AsCas12a)
data(SpCas9, AsCas12a, package="crisprBase") library(GenomicRanges) gr <- GRanges("chr10", IRanges(start=c(100,120), width=1), strand=c("+","-")) getPamRanges(gr, nuclease=SpCas9) getPamRanges(gr, nuclease=AsCas12a)
Construct a protospacer GRanges from a list of PAM sites using information stored in a CrisprNuclease object.
getProtospacerRanges( gr = NULL, seqnames = NULL, pam_site = NULL, strand = NULL, nuclease = NULL, spacer_len = NULL )
getProtospacerRanges( gr = NULL, seqnames = NULL, pam_site = NULL, strand = NULL, nuclease = NULL, spacer_len = NULL )
gr |
GRanges object of width 1 specifying the coordinates of the first nucleotide of the PAM sequences. |
seqnames |
Character vector of genomic sequence names.
Ignored if |
pam_site |
Numeric vector specifying the coordinates of the
first nucleotide of the PAM sequences corresponding to the
protospacers. Ignored if |
strand |
Character vector specifying the strand of the protospacer.
Ignored if |
nuclease |
CrisprNuclease object. |
spacer_len |
Non-negative integer to overwrite the default spacer length stored in the CrisprNuclease object. s |
GRanges object representing genomic coordinates of protospacer sequences.
Jean-Philippe Fortin
data(SpCas9, AsCas12a, package="crisprBase") library(GenomicRanges) gr <- GRanges("chr10", IRanges(start=c(100,120), width=1), strand=c("+","-")) getProtospacerRanges(gr, nuclease=SpCas9) getProtospacerRanges(gr, nuclease=AsCas12a)
data(SpCas9, AsCas12a, package="crisprBase") library(GenomicRanges) gr <- GRanges("chr10", IRanges(start=c(100,120), width=1), strand=c("+","-")) getProtospacerRanges(gr, nuclease=SpCas9) getProtospacerRanges(gr, nuclease=AsCas12a)
Construct a target (protospacer + PAM) GRanges from a list of PAM sites using information stored in a CrisprNuclease object.
getTargetRanges( gr = NULL, seqnames = NULL, pam_site = NULL, strand = NULL, nuclease = NULL, spacer_len = NULL )
getTargetRanges( gr = NULL, seqnames = NULL, pam_site = NULL, strand = NULL, nuclease = NULL, spacer_len = NULL )
gr |
GRanges object of width 1 specifying the coordinates of the first nucleotide of the PAM sequences. |
seqnames |
Character vector of genomic sequence names.
Ignored if |
pam_site |
Numeric vector specifying the coordinates of the
first nucleotide of the PAM sequences corresponding to the
targets. Ignored if |
strand |
Character vector specifying the strand of the target.
Ignored if |
nuclease |
CrisprNuclease object. |
spacer_len |
Non-negative integer to overwrite the default spacer length stored in the CrisprNuclease object. |
GRanges object representing genomic coordinates of the target sequences.
Jean-Philippe Fortin
data(SpCas9, AsCas12a, package="crisprBase") library(GenomicRanges) gr <- GRanges("chr10", IRanges(start=c(100,120), width=1), strand=c("+","-")) getTargetRanges(gr, nuclease=SpCas9) getTargetRanges(gr, nuclease=AsCas12a)
data(SpCas9, AsCas12a, package="crisprBase") library(GenomicRanges) gr <- GRanges("chr10", IRanges(start=c(100,120), width=1), strand=c("+","-")) getTargetRanges(gr, nuclease=SpCas9) getTargetRanges(gr, nuclease=AsCas12a)
CrisprNuclease object for the MAD7 nuclease (Cas12a-like nuclease)
data(MAD7, package="crisprBase")
data(MAD7, package="crisprBase")
CrisprNuclease object.
The MAD7 nuclease recognizes YTTV PAM sequences. Spacer sequences must be located downstream of PAM sequences.
Return motif string representations of recognition sites.
Return length of the recognition sites sequences.
motifs(object, ...) motifLength(object, ...) nucleaseName(object) targetType(object) weights(object, ...) nucleaseName(object) <- value targetType(object) <- value weights(object) <- value cutSites(object, ...) isCutting(object) isRnase(object) isDnase(object) Nuclease( nucleaseName, targetType = c("DNA", "RNA"), motifs = NULL, cutSites = NULL, weights = rep(1, length(motifs)), metadata = list() ) ## S4 method for signature 'Nuclease' show(object) ## S4 method for signature 'Nuclease' nucleaseName(object) ## S4 replacement method for signature 'Nuclease' nucleaseName(object) <- value ## S4 method for signature 'Nuclease' targetType(object) ## S4 replacement method for signature 'Nuclease' targetType(object) <- value ## S4 method for signature 'Nuclease' weights(object, expand = FALSE) ## S4 replacement method for signature 'Nuclease' weights(object) <- value ## S4 method for signature 'Nuclease' isCutting(object) ## S4 method for signature 'Nuclease' isRnase(object) ## S4 method for signature 'Nuclease' isDnase(object) ## S4 method for signature 'Nuclease' motifs( object, primary = FALSE, strand = c("+", "-"), expand = FALSE, as.character = FALSE ) ## S4 method for signature 'Nuclease' motifLength(object) ## S4 method for signature 'Nuclease' cutSites(object, strand = c("+", "-", "both"), combine = TRUE, middle = FALSE)
motifs(object, ...) motifLength(object, ...) nucleaseName(object) targetType(object) weights(object, ...) nucleaseName(object) <- value targetType(object) <- value weights(object) <- value cutSites(object, ...) isCutting(object) isRnase(object) isDnase(object) Nuclease( nucleaseName, targetType = c("DNA", "RNA"), motifs = NULL, cutSites = NULL, weights = rep(1, length(motifs)), metadata = list() ) ## S4 method for signature 'Nuclease' show(object) ## S4 method for signature 'Nuclease' nucleaseName(object) ## S4 replacement method for signature 'Nuclease' nucleaseName(object) <- value ## S4 method for signature 'Nuclease' targetType(object) ## S4 replacement method for signature 'Nuclease' targetType(object) <- value ## S4 method for signature 'Nuclease' weights(object, expand = FALSE) ## S4 replacement method for signature 'Nuclease' weights(object) <- value ## S4 method for signature 'Nuclease' isCutting(object) ## S4 method for signature 'Nuclease' isRnase(object) ## S4 method for signature 'Nuclease' isDnase(object) ## S4 method for signature 'Nuclease' motifs( object, primary = FALSE, strand = c("+", "-"), expand = FALSE, as.character = FALSE ) ## S4 method for signature 'Nuclease' motifLength(object) ## S4 method for signature 'Nuclease' cutSites(object, strand = c("+", "-", "both"), combine = TRUE, middle = FALSE)
object |
Nuclease object. |
... |
Additional arguments for class-specific methods |
value |
New value to pass to the setter functions. |
nucleaseName |
Name of the nuclease. |
targetType |
String specifying target type ("DNA" or "RNA"). |
motifs |
Character vector of recognition sequence motifs written from 5' to 3' written in Rebase convention. If the point of cleavage has been determined, the precise site is marked with ^. Only letters in the IUPAC code are accepted. For nucleases that cleave away from their recognition sequence, the cleavage sites are indicated in parentheses. See details for more information. |
cutSites |
Matrix with 2 rows (+ and - strand, respectively)
specifying the cleavage coordinates relative to the first
nucleotide of the motif sequence. Each column corresponds
to a motif specified in the |
weights |
Optional numeric vector specifying relative weights for the recognition motifs to specify cleavage probabilities. |
metadata |
Optional list providing global metadata information. |
expand |
Should sequences be expanded to only contain ATCG nucleotides? FALSE by default. |
primary |
Should only the motif with the highest weight be returned? FALSE by default. Only relevant if weights are stored in the Nuclease object. |
strand |
Strand to allow reverse complementation of the motif. "+" by default. |
as.character |
Should the motif sequences be returned as a character vector? FALSE by default. |
combine |
Should only unique values be considered? TRUE by default. |
middle |
For staggered cuts, should the middle point between the cut on the forward strand and the cut on the reverse strand be considered as the cut site? FALSE by default. |
A Nuclease object
Nuclease()
: Create a Nuclease object
nucleaseName
Name of the nuclease.
targetType
Character string indicationg target type ("DNA" or "RNA").
motifs
DNAStringSet of recognition sequence motifs written from 5' to 3'.
cutSites
Matrix with 2 rows (+ and - strand, respectively)
specifying the cleavage coordinates relative to the first
nucleotide of the motif sequence. Each column corresponds
to a motif specified in the motifs
slot.
weights
Optional numeric vector specifying relative weights for the motifs corresponding to cleavage probabilities.
metadata
Optional string providing a description of the nuclease.
Use the constructor link{Nuclease}
to create a Nuclease object.
nucleaseName
:To get the name of the nuclease.
targetType
:To get the target type ("DNA" or "RNA").
metadata
:To get the metadata list of the nuclease.
motifs
:To get the recognition mofif nucleotide sequences.
weights
:To get nuclease weights.
cutSites
:To get nuclease cut sites.
See the CrisprNuclease for CRISPR-specific nucleases.
EcoRI <- Nuclease("EcoRI", motifs=c("G^AATTC"), metadata=list(description="EcoRI restriction enzyme"))
EcoRI <- Nuclease("EcoRI", motifs=c("G^AATTC"), metadata=list(description="EcoRI restriction enzyme"))
An S4 class to represent a nickase
nickaseName(object) nickaseName(object) <- value nickingStrand(object) nickingStrand(object) <- value Nickase( nickaseName, nickingStrand = c("original", "opposite"), motifs = NULL, cutSites = NULL, weights = rep(1, length(motifs)), metadata = list() ) ## S4 method for signature 'Nickase' show(object) ## S4 method for signature 'Nickase' nickaseName(object) ## S4 replacement method for signature 'Nickase' nickaseName(object) <- value ## S4 method for signature 'Nickase' nickingStrand(object) ## S4 replacement method for signature 'Nickase' nickingStrand(object) <- value ## S4 method for signature 'Nickase' weights(object, expand = FALSE) ## S4 replacement method for signature 'Nickase' weights(object) <- value ## S4 method for signature 'Nickase' isCutting(object) ## S4 method for signature 'Nickase' motifs( object, primary = FALSE, strand = c("+", "-"), expand = FALSE, as.character = FALSE ) ## S4 method for signature 'Nickase' motifLength(object) ## S4 method for signature 'Nickase' cutSites(object, combine = TRUE)
nickaseName(object) nickaseName(object) <- value nickingStrand(object) nickingStrand(object) <- value Nickase( nickaseName, nickingStrand = c("original", "opposite"), motifs = NULL, cutSites = NULL, weights = rep(1, length(motifs)), metadata = list() ) ## S4 method for signature 'Nickase' show(object) ## S4 method for signature 'Nickase' nickaseName(object) ## S4 replacement method for signature 'Nickase' nickaseName(object) <- value ## S4 method for signature 'Nickase' nickingStrand(object) ## S4 replacement method for signature 'Nickase' nickingStrand(object) <- value ## S4 method for signature 'Nickase' weights(object, expand = FALSE) ## S4 replacement method for signature 'Nickase' weights(object) <- value ## S4 method for signature 'Nickase' isCutting(object) ## S4 method for signature 'Nickase' motifs( object, primary = FALSE, strand = c("+", "-"), expand = FALSE, as.character = FALSE ) ## S4 method for signature 'Nickase' motifLength(object) ## S4 method for signature 'Nickase' cutSites(object, combine = TRUE)
object |
Nickase object. |
value |
New value to pass to the setter functions. |
nickaseName |
Name of the nickase. |
nickingStrand |
String specifying with strand with respect to the motif sequence (5' to 3') is nicked. Must be either "original" (default) or "opposite". |
motifs |
Character vector of recognition sequence motifs written from 5' to 3' written in Rebase convention. If the point of cleavage has been determined, the precise site is marked with ^. Only letters in the IUPAC code are accepted. For nickases that cleave away from their recognition sequence, the cleavage sites are indicated in parentheses. See details for more information. |
cutSites |
Vector specifying the cleavage coordinates relative
to the first nucleotide of the motif sequence. Each column corresponds
to a motif specified in the |
weights |
Optional numeric vector specifying relative weights for the recognition motifs to specify cleavage probabilities. |
metadata |
Optional list providing global metadata information. |
expand |
Should sequences be expanded to only contain ATCG nucleotides? FALSE by default. |
primary |
Should only the motif with the highest weight be returned? FALSE by default. Only relevant if weights are stored in the Nickase object. |
strand |
Strand to allow reverse complementation of the motif. "+" by default. |
as.character |
Should the motif sequences be returned as a character vector? FALSE by default. |
combine |
Should only unique values be considered? TRUE by default. |
A Nickase object
Nickase()
: Create a Nickase object
nickaseName
Name of the nickase
motifs
DNAStringSet of recognition sequence motifs written from 5' to 3'.
nickingStrand
String specifying with strand with respect to the motif sequence (5' to 3') is nicked. Must be either "original" (default) or "opposite".
cutSites
Vector specifying the cleavage coordinates relative
to the first nucleotide of the motif sequence.
Each column corresponds to a motif specified in the motifs
slot.
weights
Optional numeric vector specifying relative weights for the motifs corresponding to cleavage probabilities.
metadata
Optional string providing a description of the nickase.
Use the constructor link{Nickase}
to create a Nickase object.
nickaseName
:To get the name of the nickase.
nickingStrand
:To get the nicking strand.
metadata
:To get the metadata list of the nickase
motifs
:To get the recognition mofif nucleotide sequences.
weights
:To get nickase weights.
cutSites
:To get nickase cut sites.
See the CrisprNickase for CRISPR-specific nickases.
Nb.BsmI <- Nickase("Nb.BsmI", motifs=c("GAATG^C"), nickingStrand="opposite", metadata=list(description="Nb.BsmI nicking enzyme."))
Nb.BsmI <- Nickase("Nb.BsmI", motifs=c("GAATG^C"), nickingStrand="opposite", metadata=list(description="Nb.BsmI nicking enzyme."))
Quick plot to visualize editing weights from a BaseEditor object.
plotEditingWeights( baseEditor, discardEmptyRows = TRUE, substitutions = NULL, ... )
plotEditingWeights( baseEditor, discardEmptyRows = TRUE, substitutions = NULL, ... )
baseEditor |
A |
discardEmptyRows |
Should rows that have all weight equal to 0 be discarded? TRUE by default. |
substitutions |
Character vector specifying substitutions to be plotted. If NULL (default), all substitutions are shown. |
... |
Additional arguments to be passed to |
Nothing. A plot is generated as a side effect.
if (interactive()){ data(BE4max, package="crisprBase") plotEditingWeights(BE4max) }
if (interactive()){ data(BE4max, package="crisprBase") plotEditingWeights(BE4max) }
List of Nuclease objects representing common restriction enzymes from REBASE database.
data(restrictionEnzymes, package="crisprBase")
data(restrictionEnzymes, package="crisprBase")
List of Nuclease objects.
List of Nuclease objects representing common restriction enzymes from REBASE database.
CrisprNuclease object for the wildtype Staphylococcus aureus Cas9 (SaCas9) nuclease.
data(SaCas9, package="crisprBase")
data(SaCas9, package="crisprBase")
CrisprNuclease object.
The AsCas9 nuclease recognizes NNGRRT PAM sequences. Spacer sequences must be located upstream of PAM sequences. Editing weights were obtained from doi:10.1038/nature14299.
An S4 class to represent a CRISPR nuclease.
spacerLength(object, ...) targetLength(object, ...) pamLength(object, ...) spacerGap(object) hasSpacerGap(object) spacerGap(object) <- value spacerLength(object) <- value pamSide(object, ...) pamSide(object) <- value pams(object, ...) pamIndices(object, ...) spacerIndices(object, ...) prototypeSequence(object, ...) CrisprNuclease( nucleaseName, targetType = c("DNA", "RNA"), pams = NA_character_, weights = rep(1, length(pams)), metadata = list(), pam_side = NA_character_, spacer_gap = 0L, spacer_length = NA_integer_ ) ## S4 method for signature 'CrisprNuclease' show(object) ## S4 method for signature 'CrisprNuclease' pamLength(object) ## S4 method for signature 'CrisprNuclease' spacerLength(object) ## S4 replacement method for signature 'CrisprNuclease' spacerLength(object) <- value ## S4 method for signature 'CrisprNuclease' pamSide(object) ## S4 replacement method for signature 'CrisprNuclease' pamSide(object) <- value ## S4 method for signature 'CrisprNuclease' spacerGap(object) ## S4 replacement method for signature 'CrisprNuclease' spacerGap(object) <- value ## S4 method for signature 'CrisprNuclease' hasSpacerGap(object) ## S4 method for signature 'CrisprNuclease' targetLength(object) ## S4 method for signature 'CrisprNuclease' pams(object, primary = TRUE, ignore_pam = FALSE, as.character = FALSE) ## S4 method for signature 'CrisprNuclease' pamIndices(object) ## S4 method for signature 'CrisprNuclease' spacerIndices(object) ## S4 method for signature 'CrisprNuclease' prototypeSequence(object, primary = TRUE)
spacerLength(object, ...) targetLength(object, ...) pamLength(object, ...) spacerGap(object) hasSpacerGap(object) spacerGap(object) <- value spacerLength(object) <- value pamSide(object, ...) pamSide(object) <- value pams(object, ...) pamIndices(object, ...) spacerIndices(object, ...) prototypeSequence(object, ...) CrisprNuclease( nucleaseName, targetType = c("DNA", "RNA"), pams = NA_character_, weights = rep(1, length(pams)), metadata = list(), pam_side = NA_character_, spacer_gap = 0L, spacer_length = NA_integer_ ) ## S4 method for signature 'CrisprNuclease' show(object) ## S4 method for signature 'CrisprNuclease' pamLength(object) ## S4 method for signature 'CrisprNuclease' spacerLength(object) ## S4 replacement method for signature 'CrisprNuclease' spacerLength(object) <- value ## S4 method for signature 'CrisprNuclease' pamSide(object) ## S4 replacement method for signature 'CrisprNuclease' pamSide(object) <- value ## S4 method for signature 'CrisprNuclease' spacerGap(object) ## S4 replacement method for signature 'CrisprNuclease' spacerGap(object) <- value ## S4 method for signature 'CrisprNuclease' hasSpacerGap(object) ## S4 method for signature 'CrisprNuclease' targetLength(object) ## S4 method for signature 'CrisprNuclease' pams(object, primary = TRUE, ignore_pam = FALSE, as.character = FALSE) ## S4 method for signature 'CrisprNuclease' pamIndices(object) ## S4 method for signature 'CrisprNuclease' spacerIndices(object) ## S4 method for signature 'CrisprNuclease' prototypeSequence(object, primary = TRUE)
object |
CrisprNuclease object. |
... |
Additional arguments for class-specific methods |
value |
For |
nucleaseName |
Name of the CRISPR nuclease. |
targetType |
String specifying target type ("DNA" or "RNA"). |
pams |
Character vector of PAM sequence motifs written from 5' to 3. If the point of cleavage has been determined, the precise site is marked with ^. Only letters in the IUPAC code are accepted. For nucleases that cleave away from their recognition sequence, the cleavage sites are indicated in parentheses. See details for more information. |
weights |
Optional numeric vector specifying relative weights of the PAM sequences to specify cleavage probabilities. |
metadata |
Optional list providing global metadata information. |
pam_side |
String specifying the side of the PAM sequence sequence with respect to the protospacer sequence. Must be either '3prime' (e.g. Cas9) or '5prime' (e.g. Cas12a) |
spacer_gap |
Integer specifying the length (in nucleotides) between the spacer sequence and the PAM sequence (e.g. 0 for Cas9 and Cas12a). |
spacer_length |
Integer specifying the length of the spacer sequence |
primary |
Should only the PAM sequence with the heighest weight be returned? If no cleavage weights are stored in the CrisprNuclease object, all sequences are returned. TRUE by default. |
ignore_pam |
Should all possible k-mer sequences for a given PAM length be returned, irrespetively of the PAM sequence motifs stored in the CrisprNuclease object? FALSE by default. |
as.character |
Should the PAM sequences be returned as a character vector? FALSE by default. |
A CrisprNuclease object
CrisprNuclease()
: Create a CrisprNuclease object
pam_side
String specifying the side of the PAM sequence with respect to the protospacer sequence. Must be either '3prime' (e.g. SpCas9) or '5prime' (e.g. AsCas12a)
spacer_length
Integer specifying the length of the spacer sequence
spacer_gap
Integer specifying the length (in nucleotides) between the spacer sequence and the PAM sequence (e.g. 0 for SpCas9 and AsCas12a).
Use the constructor link{CrisprNuclease}
to create
a CrisprNuclease object.
nucleaseName
:To get the name of the CRISPR nuclease.
spacerLength
:To return the length of the spacer sequence.
targetLength
:To return the length of the target sequence (protospacer + pam).
pamLength
:To return the length of the PAM sequence.
pamSide
:To return the side of the PAM sequence with respect to the spacer sequence.
spacerGap
:To return the length of the gap between the PAM and spacer sequences.
pams
:To return the list of PAM sequences.
spacerGap<-
:To change the length of the gap between the PAM and spacer sequences.
pamSide<-
:To change the side of the PAM sequence with respect to the protospacer sequence.
spacerLength<-
:To change the length of the spacer sequence.
pamIndices
:To return the relative coordinates of the PAM sequence within the target sequence.
spacerIndices
:To return the relatiive coordinates of the spacer sequence within the target sequence.
SpCas9 <- CrisprNuclease("SpCas9", pams=c("(3/3)NGG", "(3/3)NAG", "(3/3)NGA"), weights=c(1, 0.2593, 0.0694), metadata=list(description="Wildtype Streptococcus pyogenes Cas9 (SpCas9) nuclease"), pam_side="3prime", spacer_length=20)
SpCas9 <- CrisprNuclease("SpCas9", pams=c("(3/3)NGG", "(3/3)NAG", "(3/3)NGA"), weights=c(1, 0.2593, 0.0694), metadata=list(description="Wildtype Streptococcus pyogenes Cas9 (SpCas9) nuclease"), pam_side="3prime", spacer_length=20)
CrisprNuclease object for the wildtype Streptococcus pyogenes Cas9 (SpCas9) nuclease.
data(SpCas9, package="crisprBase")
data(SpCas9, package="crisprBase")
CrisprNuclease object.
The SpCas9 nuclease recognizes NGG PAM sequences. Spacer sequences must be located upstream of PAM sequences.
CrisprNuclease object for the engineered Streptococcus pyogenes Cas9 SpG nuclease.
data(SpGCas9, package="crisprBase")
data(SpGCas9, package="crisprBase")
CrisprNuclease object.
The SpGCas9 nuclease recognizes NGN PAM sequences. Spacer sequences must be located upstream of PAM sequences.