Create a shrinkage function based on specified gaps and shrinkage rate.
1 2 3 4 5 6 7 8 9
GenomicRanges object which represent gaps
Gaps to be kept, it's a fixed value, if this value is bigger than certain gap interval, then that gap is not going to be shrunk.
shrinkageFun function will read in a GenomicRanges object
which represent the gaps, and return a function which works for
another GenomicRanges object, to shrink that object based on
previously specified gaps shrinking information. You could use
this function to treat multiple tracks(e.g. GRanges) to make sure
they shrunk based on the common gaps and the same ratio.
is_coord_truncate_gaps is used to check if a
object is in "truncate_gaps" coordiantes or not.
A shrinkage function which could shrink a GenomicRanges object, this function will add coord "truncate_gaps" and max.gap to metadata, ".ori" for oringal data as extra column
Michael Lawrence, Tengfei Yin
1 2 3 4 5 6 7 8 9 10 11 12 13
library(GenomicRanges) gr1 <- GRanges("chr1", IRanges(start = c(100, 300, 600), end = c(200, 400, 800))) shrink.fun1 <- shrinkageFun(gaps(gr1), max.gap = maxGap(gaps(gr1), 0.1)) shrink.fun2 <- shrinkageFun(gaps(gr1, start(gr1), end(gr1)), max.gap = maxGap(gaps(gr1), 0.1)) shrink.fun3 <- shrinkageFun(gaps(gr1), max.gap = 0) s1 <- shrink.fun1(gr1) s2 <- shrink.fun2(gr1) s3 <- shrink.fun3(gr1) metadata(s1)$coord values(s1)$.ori is_coord_truncate_gaps(s1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.