# Load the metadata table
md_fname <- system.file("extdata", "gol_F1_metadata_small.txt", package = "CrispRVariants")
md <- read.table(md_fname, sep = "\t", stringsAsFactors = FALSE)
# Get bam filenames and their full paths
bam_fnames <- sapply(md$bam.filename, function(fn){
system.file("extdata", fn, package = "CrispRVariants")})
reference <- Biostrings::DNAString("GGTCTCTCGCAGGATGTTGCTGG")
gd <- GenomicRanges::GRanges("18", IRanges::IRanges(4647377, 4647399),
strand = "+")
crispr_set <- readsToTarget(bam_fnames, target = gd, reference = reference,
names = md$experiment.name, target.loc = 17)
Run the code above in your browser using DataLab