getOfftargetScore: Calculate score for each off target

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/getOfftargetScore.R

Description

Calculate score for each off target with given feature vectors and weights vector

Usage

1
2
3
getOfftargetScore(featureVectors, 
    weights = c(0, 0, 0.014, 0, 0, 0.395, 0.317, 0, 0.389, 0.079, 0.445, 0.508, 
    0.613, 0.851, 0.732, 0.828, 0.615, 0.804, 0.685, 0.583))

Arguments

featureVectors

a data frame generated from buildFeatureVectorForScoring. It contains IsMismatch.posX (Indicator variable indicating whether this position X is mismatch or not, 1 means yes and 0 means not, X = 1- gRNA.size) representing all positions in the gRNA), strand (strand of the off target, + for plus and - for minus strand), chrom (chromosome of the off target), chromStart (start position of the off target), chromEnd (end position of the off target), name (gRNA name),gRNAPlusPAM (gRNA sequence with PAM sequence concatenated), OffTargetSequence (the genomic sequence of the off target), n.mismatch (number of mismatches between the off target and the gRNA), forViewInUCSC (string for viewing in UCSC genome browser, e.g., chr14:31665685-31665707), score (score of the off target), mismatch.distance2PAM (a comma separated distances of all mismatches to PAM, e.g., 14,11 means one mismatch is 14 bp away from PAM and the other mismatch is 11 bp away from PAM), alignment (alignment between gRNA and off target, e.g., ......G..C.......... means that this off target aligns with gRNA except that G and C are mismatches),NGG (this off target contains canonical PAM or not, 1 for yes and 0 for no) mean.neighbor.distance.mismatch (mean distance between neighboring mismatches)

weights

a numeric vector size of gRNA length, default c(0, 0, 0.014, 0, 0, 0.395, 0.317, 0, 0.389, 0.079, 0.445, 0.508, 0.613, 0.851, 0.732, 0.828, 0.615, 0.804, 0.685, 0.583) which is used in Hsu et al., 2013 cited in the reference section

Details

score is calculated using the weights and algorithm by Hsu et al., 2013 cited in the reference section

Value

a data frame containing strand (strand of the match, + for plus and - for minus strand), chrom (chromosome of the off target), chromStart (start position of the off target), chromEnd (end position of the off target),name (gRNA name), gRNAPlusPAM (gRNA sequence with PAM sequence concatenated), OffTargetSequence (the genomic sequence of the off target), n.mismatch (number of mismatches between the off target and the gRNA), forViewInUCSC (string for viewing in UCSC genome browser, e.g., chr14:31665685-31665707), score (score of the off target), mismatch.distance2PAM (a comma separated distances of all mismatches to PAM, e.g., 14,11 means one mismatch is 14 bp away from PAM and the other mismatch is 11 bp away from PAM), alignment (alignment between gRNA and off target, e.g., ......G..C.......... means that this off target aligns with gRNA except that G and C are mismatches), NGG (this off target contains canonical PAM or not, 1 for yes and 0 for no) mean.neighbor.distance.mismatch (mean distance between neighboring mismatches)

Author(s)

Lihua Julie Zhu

References

Patrick D Hsu, David A Scott, Joshua A Weinstein, F Ann Ran, Silvana Konermann, Vineeta Agarwala, Yinqing Li, Eli J Fine, Xuebing Wu, Ophir Shalem, Thomas J Cradick, Luciano A Marraffini, Gang Bao & Feng Zhang (2013) DNA targeting specificity of rNA-guided Cas9 nucleases. Nature Biotechnology 31:827-834

See Also

offTargetAnalysis

Examples

1
2
3
4
5
6
    hitsFile <-  system.file("extdata", "hits.txt", 
        package = "CRISPRseek")
    hits <- read.table(hitsFile, sep = "\t", header = TRUE,
        stringsAsFactors = FALSE)
    featureVectors <- buildFeatureVectorForScoring(hits)
    getOfftargetScore(featureVectors)

Example output

Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Loading required package: Biostrings
Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: IRanges
Loading required package: XVector

Attaching package: 'Biostrings'

The following object is masked from 'package:base':

    strsplit

Warning messages:
1: multiple methods tables found for 'organism' 
2: multiple methods tables found for 'species' 
3: multiple methods tables found for 'seqinfo' 
4: multiple methods tables found for 'seqinfo<-' 
5: multiple methods tables found for 'seqnames' 
6: replacing previous import 'BiocGenerics::organism' by 'BSgenome::organism' when loading 'CRISPRseek' 
7: replacing previous import 'BiocGenerics::species' by 'BSgenome::species' when loading 'CRISPRseek' 
  IsMismatch.pos1 IsMismatch.pos2 IsMismatch.pos3 IsMismatch.pos4
3               0               0               0               0
1               0               0               0               0
2               0               0               0               0
4               0               0               0               0
  IsMismatch.pos5 IsMismatch.pos6 IsMismatch.pos7 IsMismatch.pos8
3               0               0               0               0
1               0               0               1               0
2               0               0               0               0
4               0               0               0               1
  IsMismatch.pos9 IsMismatch.pos10 IsMismatch.pos11 IsMismatch.pos12
3               0                0                0                0
1               0                0                0                0
2               1                0                1                0
4               0                0                0                0
  IsMismatch.pos13 IsMismatch.pos14 IsMismatch.pos15 IsMismatch.pos16
3                0                0                0                0
1                0                0                0                0
2                0                0                0                0
4                0                0                0                0
  IsMismatch.pos17 IsMismatch.pos18 IsMismatch.pos19 IsMismatch.pos20 strand
3                0                0                0                0      +
1                0                0                1                0      -
2                0                0                0                0      +
4                0                0                1                0      -
  chrom chromStart chromEnd                              name
3  chrX   48649587 48649609 gRNAf1_Hsap_GATA1_ex2Start24End46
1 chr17   51150403 51150425 gRNAf1_Hsap_GATA1_ex2Start24End46
2 chr19   51673303 51673325 gRNAf1_Hsap_GATA1_ex2Start24End46
4  chrX   83738197 83738219 gRNAf1_Hsap_GATA1_ex2Start24End46
              gRNAPlusPAM       OffTargetSequence n.mismatch
3 TGTCCTCCACACCAGAATCAGGG TGTCCTCCACACCAGAATCAGGG          0
1 TGTCCTCCACACCAGAATCAGGG TGTCCTGCACACCAGAATGATAG          2
2 TGTCCTCCACACCAGAATCAGGG TGTCCTCCTCCCCAGAATCAAAG          2
4 TGTCCTCCACACCAGAATCAGGG TGTCCTCAACACCAGAATGATAG          2
            forViewInUCSC score mismatch.distance2PAM            alignment NGG
3  chrX:48649587-48649609 100.0                       ....................   1
1 chr17:51150403-51150425   2.2                  14,2 ......G...........G.   0
2 chr19:51673303-51673325   1.9                 12,10 ........T.C.........   0
4  chrX:83738197-83738219   2.9                  13,2 .......A..........G.   0
  mean.neighbor.distance.mismatch mismatch.type subPAM
3                              20                   GG
1                              12   rC:dC,rC:dC     AG
2                               2   rA:dA,rA:dG     AG
4                              11   rC:dT,rC:dC     AG

CRISPRseek documentation built on Jan. 14, 2021, 2:50 a.m.