View source: R/addMetricAndArrangeGRanges.R
addMetricAndArrangeGRanges | R Documentation |
Perform an inner join between a GRanges object and a data.frame. Sort the resulting GRanges based on a metric column.
addMetricAndArrangeGRanges(
gr,
order,
gr_key = "name",
order_key = "name",
order_value = "exp",
shuffle_tie = TRUE
)
gr |
a GRanges object. |
order |
a data.frame with at least two columns: keys and values. |
gr_key |
name of the gr metadata column containing unique names for
each genomic region in |
order_key |
name of the |
order_value |
name of the |
shuffle_tie |
a boolean Value (TRUE / FALSE). When TRUE, shuffle the GRanges before sorting, mixing the ties. |
This utility function allow the addition of a metric column to
genomic regions of interest. One of its common use case is to add
gene expression values on a set of transcription start sites.
The resulting GRanges object will only contain regions presents in both
gr
and order
.
a GRanges sorted in descending order.
data("stackepi_gr")
ramdomOrder <- data.frame(gene_id = stackepi_gr$gene_id,
value = rnorm(length(stackepi_gr)))
addMetricAndArrangeGRanges(stackepi_gr,
ramdomOrder, gr_key = "gene_id",
order_key = "gene_id", order_value = "value")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.