Commit c3f15383 authored by aditya.bhagwat's avatar aditya.bhagwat
Browse files

Export score_ontargets

parent db63263a
Pipeline #154366 passed with stages
in 28 seconds
Package: multicrispr
Title: Multi-locus multi-purpose Crispr/Cas design
Version: 0.99.31
Version: 0.99.32
Encoding: UTF-8
Authors@R: c(person("Aditya", "Bhagwat", NULL, "aditya.bhagwat@mpi-bn.mpg.de", c("aut", "cre")),
person( "Johannes", "Graumann", NULL, 'johannes.graumann@mpi-bn.mpg.de',c("sad", "ctb")),
......
......@@ -26,6 +26,7 @@ export(index_targets)
export(plot_intervals)
export(plot_karyogram)
export(read_ranges)
export(score_ontargets)
export(up_flank)
export(write_ranges)
importFrom(BSgenome,getBSgenome)
......
......@@ -515,6 +515,7 @@ count_spacer_matches <- function(
#' @param pam string
#' @param outdir bowtie output directory
#' @param verbose TRUE (default) or FALSE
#' @return GRanges
#' @examples
#' require(magrittr)
#' file <- system.file('extdata/SRF.bed', package='multicrispr')
......@@ -569,6 +570,7 @@ add_target_matches <- function(
#' @param outdir bowtie output directory
#' @param indexedgenomesdir directory with indexed genomes
#' @param verbose TRUE (default) or FALSE
#' @return GRanges
#' @examples
#' require(magrittr)
#' file <- system.file('extdata/SRF.bed', package='multicrispr')
......
......@@ -130,27 +130,27 @@ doench2016 <- function(
#' @param bsgenome \code{\link[BSgenome]{BSgenome-class}}
#' @param ontargetmethod 'Doench2014' (default) or 'Doench2016'
#' (requires non-NULL argument python, virtualenv, or condaenv)
#' @param cutoff value to filter on
#' @param chunksize Doench2016 is executed in chunks of chunksize
#' @param verbose TRUE (default) or FALSE
#' @param plot TRUE (default) or FALSE
#' @param ... passed to \code{\link{plot_intervals}}
#' @return numeric vector
#' @examples
#'
#' # Install azimuth
#' #----------------
#' ## With reticulate
#' # require(reticulate)
#' # conda_create('azienv', c('python=2.7'))
#' # use_condaenv('azienv')
#' # py_install(c('azimuth', 'scikit-learn==0.17.1'), 'azienv', pip = TRUE)
#' # py_install(c('azimuth', 'scikit-learn==0.17.1', 'biopython=='1.76'),
#' # 'azienv', pip = TRUE)
#'
#' ## Directly
#' # conda create --name azienv python=2.7
#' # conda activate azienv
#' # pip install azimuth
#' # pip install scikit-learn==0.17.1
#' # pip install biopython==1.76
#' # pip install azimuth
#'
#' # PE example
#' #-----------
......@@ -161,9 +161,9 @@ doench2016 <- function(
#' HEXA = 'chr15:72346580-72346583:-', # del
#' CFTR = 'chr7:117559593-117559595:+'), # ins
#' bsgenome)
#' spacers <- find_primespacers(targets, bsgenome)
#' #spacers<- find_spacers(extend_for_pe(gr), bsgenome, complement = FALSE)
#' (spacers %<>% score_ontargets(bsgenome, 'Doench2014'))
#' spacers <- find_primespacers(targets, bsgenome, ontargetmethod=NULL,
#' offtargetmethod=NULL)
#' spacers %<>% score_ontargets(bsgenome, 'Doench2014')
#' # reticulate::use_condaenv('azienv')
#' # reticulate::import('azimuth')
#' # spacers %<>% score_ontargets(bsgenome, 'Doench2016')
......@@ -173,12 +173,12 @@ doench2016 <- function(
#' bedfile <- system.file('extdata/SRF.bed', package = 'multicrispr')
#' bsgenome <- BSgenome.Mmusculus.UCSC.mm10::BSgenome.Mmusculus.UCSC.mm10
#' targets <- extend(bed_to_granges(bedfile, 'mm10'))
#' spacers <- find_spacers(targets, bsgenome)
#' spacers <- find_spacers(targets, bsgenome, ontargetmethod=NULL,
#' offtargetmethod=NULL)
#' spacers %<>% score_ontargets(bsgenome, 'Doench2014')
#' # reticulate::use_condaenv('azienv')
#' # reticulate::import('azienv')
#' # (spacers %<>% count_offtargets(bsgenome, targets))
#' # (spacers %>% score_ontargets(bsgenome, 'Doench2014'))
#' # (spacers %>% score_ontargets(bsgenome, 'Doench2016'))
#' # reticulate::import('azimuth')
#' # spacers %>% score_ontargets(bsgenome, 'Doench2016')
#' @references
#' Doench 2014, Rational design of highly active sgRNAs for
#' CRISPR-Cas9-mediated gene inactivation. Nature Biotechnology,
......@@ -189,7 +189,7 @@ doench2016 <- function(
#' doi: 10.1038/nbt.3437
#'
#' Python module azimuth: github/MicrosoftResearch/azimuth
#' @noRd
#' @export
score_ontargets <- function(
spacers, bsgenome, ontargetmethod= c('Doench2014', 'Doench2016')[1],
chunksize = 10000, verbose = TRUE, plot = TRUE, ...
......
......@@ -32,6 +32,9 @@ add_genome_matches(
\item{verbose}{TRUE (default) or FALSE}
}
\value{
GRanges
}
\description{
Add genome matches
}
......
......@@ -29,6 +29,9 @@ add_target_matches(
\item{verbose}{TRUE (default) or FALSE}
}
\value{
GRanges
}
\description{
Add target matches
}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/08_score_ontargets.R
\name{score_ontargets}
\alias{score_ontargets}
\title{Add on-target efficiency scores}
\usage{
score_ontargets(
spacers,
bsgenome,
ontargetmethod = c("Doench2014", "Doench2016")[1],
chunksize = 10000,
verbose = TRUE,
plot = TRUE,
...
)
}
\arguments{
\item{spacers}{\code{\link[GenomicRanges]{GRanges-class}}: spacers}
\item{bsgenome}{\code{\link[BSgenome]{BSgenome-class}}}
\item{ontargetmethod}{'Doench2014' (default) or 'Doench2016'
(requires non-NULL argument python, virtualenv, or condaenv)}
\item{chunksize}{Doench2016 is executed in chunks of chunksize}
\item{verbose}{TRUE (default) or FALSE}
\item{plot}{TRUE (default) or FALSE}
\item{...}{passed to \code{\link{plot_intervals}}}
}
\value{
numeric vector
}
\description{
Add Doench2014 or Doench2016 on-target efficiency scores
}
\details{
\code{add_ontargets} adds efficiency scores
\code{filter_ontargets} adds efficiency scores and filters on them
}
\examples{
# Install azimuth
#----------------
## With reticulate
# require(reticulate)
# conda_create('azienv', c('python=2.7'))
# use_condaenv('azienv')
# py_install(c('azimuth', 'scikit-learn==0.17.1', 'biopython=='1.76'),
# 'azienv', pip = TRUE)
## Directly
# conda create --name azienv python=2.7
# conda activate azienv
# pip install scikit-learn==0.17.1
# pip install biopython==1.76
# pip install azimuth
# PE example
#-----------
require(magrittr)
bsgenome <- BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38
targets <- char_to_granges(c(PRNP = 'chr20:4699600:+', # snp
HBB = 'chr11:5227002:-', # snp
HEXA = 'chr15:72346580-72346583:-', # del
CFTR = 'chr7:117559593-117559595:+'), # ins
bsgenome)
spacers <- find_primespacers(targets, bsgenome, ontargetmethod=NULL,
offtargetmethod=NULL)
spacers \%<>\% score_ontargets(bsgenome, 'Doench2014')
# reticulate::use_condaenv('azienv')
# reticulate::import('azimuth')
# spacers \%<>\% score_ontargets(bsgenome, 'Doench2016')
# TFBS example
#-------------
bedfile <- system.file('extdata/SRF.bed', package = 'multicrispr')
bsgenome <- BSgenome.Mmusculus.UCSC.mm10::BSgenome.Mmusculus.UCSC.mm10
targets <- extend(bed_to_granges(bedfile, 'mm10'))
spacers <- find_spacers(targets, bsgenome, ontargetmethod=NULL,
offtargetmethod=NULL)
spacers \%<>\% score_ontargets(bsgenome, 'Doench2014')
# reticulate::use_condaenv('azienv')
# reticulate::import('azimuth')
# spacers \%>\% score_ontargets(bsgenome, 'Doench2016')
}
\references{
Doench 2014, Rational design of highly active sgRNAs for
CRISPR-Cas9-mediated gene inactivation. Nature Biotechnology,
doi: 10.1038/nbt.3026
Doench 2016, Optimized sgRNA design to maximize activity and minimize
off-target effects of CRISPR-Cas9. Nature Biotechnology,
doi: 10.1038/nbt.3437
Python module azimuth: github/MicrosoftResearch/azimuth
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment