gdb.init_examples()
# Export the example DB to a reference FASTA
ref_fasta <- tempfile(fileext = ".fa")
gdb.export_fasta(ref_fasta)
# Replace two regions with literal sequences
intervals <- data.frame(
chrom = c("chr1", "chr1"),
start = c(100, 200),
end = c(110, 210)
)
donors <- c("AAAAAAAAAA", "CCCCCCCCCC")
out <- tempfile(fileext = ".fa")
trackdb <- tempfile()
ggenome.implant(intervals, donors,
output = out,
genome_fasta = ref_fasta,
create_trackdb = TRUE,
trackdb_path = trackdb
)
# Verify the implanted sequences via the new trackdb
gdb.init(trackdb)
gseq.extract(data.frame(chrom = "chr1", start = 100, end = 110))
# Clean up
unlink(c(ref_fasta, out, paste0(out, ".fai"), trackdb), recursive = TRUE)
Run the code above in your browser using DataLab