digestGenome: Digest reference genome

Description Usage Arguments Value Examples

View source: R/digestGenome.R

Description

Performs an in silico digestion of a given reference genome using a given restriction enzyme sequence.

Usage

1
2
3
4
5
6
7
8
digestGenome(
  res_enz,
  cut_pos,
  name_RE,
  ref_gen,
  sel_chr = paste0("chr", c(seq_len(22), "X", "Y")),
  out_path = "digested_genome/"
)

Arguments

res_enz

Character containing the restriction enzyme sequence.

cut_pos

Numeric indicating the nucleotide position where restriction enzyme cuts (zero-based) (for example, for DpnII is 0).

name_RE

Restriction enzyme name.

ref_gen

A BSgenome object of the reference genome.

sel_chr

Character vector indicating which chromosomes to select for the digestion. Default: chr1-22, chrX, chrY.

out_path

Output path where to save the genomic track. The default is a directory named digested_genome/ created in your working directory. The rda objects are saved in folder named by the ref_gene_name_RE in the out_path folder.

Value

Creates a rda file for every chromosome defined in sel_chr.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(BSgenome.Hsapiens.UCSC.hg19)
ref_gen <- BSgenome.Hsapiens.UCSC.hg19

hg19_dpnii <- digestGenome(
    res_enz = "GATC",
    cut_pos = 0,
    name_RE = "dpnII",
    sel_chr = "chr16", # Only in chr16 to reduce example running time
    ref_gen = ref_gen,
    out_path = file.path(tempdir(), "digested_genome/")
)

UMI4Cats documentation built on Dec. 31, 2020, 2:01 a.m.