getAnnotationLevels | R Documentation |
This function takes a set of genomic ranges in GRanges-class
object and assign to each range
a unique level such that each range or group of ranges (if 'annotation.group' is defined) resides on different levels.
getAnnotationLevels(
annot.gr = NULL,
offset = NULL,
annotation.group = NULL,
direction = "positive"
)
annot.gr |
A |
offset |
A |
annotation.group |
A name of an extra field present in 'annot.gr' to be used to report unique levels for a set of ranges that belong to the same group. |
direction |
Set to 'positive' or 'negative' to make sure reported levels are either decreasing or increasing from the defined 'offset' (default: 'positive'). |
A numeric
vector of unique levels corresponding to submitted ranges via 'annot.gr'.
David Porubsky
## Define random set of ranges grouped by gene name
test.gr1 <- GenomicRanges::GRanges(
seqnames = "target.region",
ranges = IRanges::IRanges(
start = c(19000000, 19030000, 19070000),
end = c(19010000, 19050000, 19090000)
)
)
test.gr1$ID <- "gene1"
test.gr2 <- GenomicRanges::shift(test.gr1, shift = 10000)
test.gr2$ID <- "gene2"
test.gr3 <- GenomicRanges::shift(test.gr1, shift = 90000)
test.gr3$ID <- "gene3"
test.gr <- c(test.gr1, test.gr2, test.gr3)
## Obtain unique annotation levels grouped by ID
getAnnotationLevels(annot.gr = test.gr, offset = 1, annotation.group = "ID")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.