greedy_algorithm: Greedy algorithm for a set of overlapping intervals.

Description Usage Arguments Details Value See Also

View source: R/greedy.R

Description

A function to create a set of non-overlapping intervals using a greedy algorithm by prefering intervals with higeher scores.

Usage

1
2
3
4
5
6
7
8
9
greedy_algorithm(
  granges_list,
  max_score = "raw_score",
  overlap = 0,
  is_circular = F,
  overhang = 0,
  use_strand = T,
  second_range = NULL
)

Arguments

granges_list

A set of intervals as a GRangesList object. Requires a score column to be specified in max_score.

max_score

Name of a column in granges_list containing integers or floats to be used as a score to maximize over.

overlap

A non-negative integer specifying the allowed overlap between two intervals.

is_circular

Boolean. If set true, intervals are assumed to be on a circular scale.

overhang

A non-negative integer how much of the end is overlapping with the start. specifying for a linearized circular scale Ignored if is_circular is FALSE.

use_strand

Boolean. If TRUE, strand information is used to detect overlaps

second_range

Optional, name of a column in granges_list containing another GRangesList object. If set, for intervals in granges_list to be compatible, they also have to be compatible in second_range.

Details

The algorithm seeks to maximize the sum of a score given in max_score, but does not necessarily return the best possible solution. Created mainly for comparison with the WIS-algorithm function get_wis.

When is_circular is TRUE, intervals exceeding the end of the scale given by (seqlength(granges_list) - overhang) are wrapped to the beginning.

Value

A GRangesList object with intervals compatible according to the specified options.

See Also

https://doi.org/10.1093/bioinformatics/bth324 for description of the algorithm


robbueck/wisard documentation built on Jan. 25, 2022, 12:35 a.m.