Interval plot GRanges

plot_intervals(
  gr,
  xref = "targetname",
  y = default_y(gr),
  nperchrom = 2,
  nchrom = 4,
  color_var = "targetname",
  facet_var = "seqnames",
  linetype_var = default_linetype(gr),
  size_var = default_size_var(gr),
  alpha_var = default_alpha_var(gr),
  title = NULL,
  scales = "free"
)

Arguments

gr

GRanges-class

xref

gr var used for scaling x axis

y

'names' (default) or name of gr variable

nperchrom

number (default 1): n head (and n tail) targets shown per chromosome

nchrom

number (default 6) of chromosomes shown

color_var

'seqnames' (default) or other gr variable

facet_var

NULL(default) or gr variable mapped to facet

linetype_var

NULL (default) or gr variable mapped to linetype

size_var

NULL (default) or gr variable mapped to size

alpha_var

NULL or gr variable mapped to alpha

title

NULL or string: plot title

scales

'free', 'fixed', etc

Value

ggplot object

See also

Examples

# SRF sites require(magrittr) bsgenome <- BSgenome.Mmusculus.UCSC.mm10::BSgenome.Mmusculus.UCSC.mm10 bedfile <- system.file('extdata/SRF.bed', package = 'multicrispr') targets <- bed_to_granges(bedfile, 'mm10', plot = FALSE)
#> Read SRF.bed into GRanges
#> 1974 ranges on 21 chromosomes
plot_intervals(targets)
# PE targets bsgenome <- BSgenome.Hsapiens.UCSC.hg38::BSgenome.Hsapiens.UCSC.hg38 gr <- char_to_granges(c(PRNP = 'chr20:4699600:+', HBB = 'chr11:5227002:-', HEXA = 'chr15:72346580-72346583:-', CFTR = 'chr7:117559593-117559595:+'), bsgenome) spacers <- find_primespacers(gr, bsgenome, plot = FALSE)
#> Find primespacers for 4 targets
#> Found 10 primespacers
#> Count offtargets with max 0 mismatches using bowtie
#> Count genome (mis)matches
#> Expand iupac ambiguities in pam
#> Write reads to ~/multicrisprout/spacers.fa
#> Map reads: ~/multicrisprout/spacers/spacers_to_BSgenome.Hsapiens.UCSC.hg38.txt
#> Load results
#> Read 53 hits with max 1 mismatch(es)
#> Retain 20 after removing NGG 'N' mismatches (avoid double counting expanded pams)
#> Retain 20 after removing NGG 'G1' mismatches(except for NGG -> NAG, which is allowed)
#> Retain 20 after removing NGG 'G2' mismatches
#> Retain 11 after removing more than 0 mismatches
#> Count matches
#> Count off-targets
#> 9 are off0 free
#> Score ontargets
#> Add (4-23-3) contextseqs
#> Score contextseqs with Doench2014
#> Find nickspacers
#> Find spacers in 10 targets
#> Found 32 spacers
#> Count offtargets with max 2 mismatches using bowtie
#> Count genome (mis)matches
#> Expand iupac ambiguities in pam
#> Write reads to ~/multicrisprout/spacers.fa
#> Map reads: ~/multicrisprout/spacers/spacers_to_BSgenome.Hsapiens.UCSC.hg38.txt
#> Load results
#> Read 91 hits with max 2 mismatch(es)
#> Retain 37 after removing NGG 'N' mismatches (avoid double counting expanded pams)
#> Retain 36 after removing NGG 'G1' mismatches(except for NGG -> NAG, which is allowed)
#> Retain 33 after removing NGG 'G2' mismatches
#> Retain 33 after removing more than 2 mismatches
#> Count matches
#> Count off-targets
#> 30 are off0 free
#> 32 are off1 free
#> 24 are off2 free
#> Filter for best offtarget counts
#> Retain 32 with best off0 counts per pename
#> Retain 32 with best off1 counts per pename
#> Retain 24 with best off2 counts per pename
#> Score ontargets
#> Add (4-23-3) contextseqs
#> Score contextseqs with Doench2014
plot_intervals(gr)
plot_intervals(extend_for_pe(gr))
plot_intervals(spacers)
#> Warning: Removed 34 rows containing missing values (geom_point).
#> Warning: Removed 34 rows containing missing values (geom_point).
# Empty gr plot_intervals(GenomicRanges::GRanges())