Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
loosolab
software
multicrispr
Commits
832c0136
Commit
832c0136
authored
Oct 13, 2020
by
aditya.bhagwat
Browse files
find_primespacers: allow for ontargetmethod/offtargetmethod == NULL
parent
5f5566c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
R/06_find_primespacers.R
View file @
832c0136
...
...
@@ -146,20 +146,22 @@ add_nickspacers <- function(primespacers, bsgenome,
mismatches
=
nickmatches
,
indexedgenomesdir
=
indexedgenomesdir
,
outdir
=
outdir
,
plot
=
FALSE
)
nickspacers
$
type
<-
'nickspacer'
mcols
(
nickspacers
)[[
ontargetmethod
]]
%<>%
round
(
digits
=
2
)
#
mcols(nickspacers)[[ontargetmethod]] %<>% round(digits = 2)
# Merge
nickdt
<-
gr2dt
(
nickspacers
)
%>%
extract
(
,
.
(
pename
=
pename
,
nickrange
=
as.character
(
granges
(
nickspacers
)),
nickspacer
=
crisprspacer
,
nickpam
=
crisprpam
,
nickoff
=
off
))
for
(
i
in
seq
(
0
,
nickmatches
)){
nickdt
[,
(
paste0
(
'nickoff'
,
i
))
:=
mcols
(
nickspacers
)[[
paste0
(
'off'
,
i
)]]]
}
method
<-
ontargetmethod
nickdt
[,
(
paste0
(
'nick'
,
method
))
:=
mcols
(
nickspacers
)[[
method
]]]
nickpam
=
crisprpam
))
if
(
!
is.null
(
offtargetmethod
)){
nickdt
[,
nickoff
:=
nickspacers
$
off
]
for
(
i
in
seq
(
0
,
nickmatches
)){
offvalues
<-
mcols
(
nickspacers
)[[
paste0
(
'off'
,
i
)]]
nickdt
[,
(
paste0
(
'nickoff'
,
i
))
:=
offvalues
]}}
if
(
!
is.null
(
ontargetmethod
)){
method
<-
ontargetmethod
nickdt
[,
(
paste0
(
'nick'
,
method
))
:=
mcols
(
nickspacers
)[[
method
]]]}
nickdt
%<>%
extract
(
,
lapply
(
.SD
,
pastelapse
),
by
=
'pename'
)
pedt
<-
gr2dt
(
primespacers
)
...
...
R/07_count_offtargets.R
View file @
832c0136
...
...
@@ -569,6 +569,7 @@ add_target_matches <- function(
#' @param indexedgenomesdir directory with indexed genomes
#' @param verbose TRUE (default) or FALSE
#' @examples
#' require(magrittr)
#' file <- system.file('extdata/SRF.bed', package='multicrispr')
#' bsgenome <- BSgenome.Mmusculus.UCSC.mm10::BSgenome.Mmusculus.UCSC.mm10
#' targets0 <- bed_to_granges(file, 'mm10')
...
...
man/add_genome_matches.Rd
View file @
832c0136
...
...
@@ -36,6 +36,7 @@ add_genome_matches(
Add genome matches
}
\examples{
require(magrittr)
file <- system.file('extdata/SRF.bed', package='multicrispr')
bsgenome <- BSgenome.Mmusculus.UCSC.mm10::BSgenome.Mmusculus.UCSC.mm10
targets0 <- bed_to_granges(file, 'mm10')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment