Learn R Programming

genomeIntervals (version 1.28.0)

interval_union: Genome interval set operations

Description

Compute interval set operations on "Genome_intervals" or "Genome_intervals_stranded" objects.

Usage

"interval_union"(x, ...) "interval_union"(x, ...)
"interval_complement"(x) "interval_complement"(x)
"interval_intersection"(x,...) "interval_intersection"(x,...)

Arguments

x
A "Genome_intervals" or "Genome_intervals_stranded" object.
...
Optionally, additional objects of the same class as x.

Value

A single object of appropriate class, representing the union, complement or intersection of intervals computed over entries with same seq_name, inter_base and also strand if all passed objects are of the class "Genome_intervals_stranded".

Details

Wrappers calling the corresponding functions of the package intervals by same seq_name, inter_base and if needed strand. Note that the union of single input object x returns the reduced form of x, i.e. the interval representation of the covered set.

See Also

interval_union, interval_complement, interval_intersection and reduce from the package intervals.

Examples

Run this code
## load toy examples
data(gen_ints)
## content of i object
i
	 
## complement
interval_complement(i)
 
## reduced form (non-overlapping interval representation of the covered set)
interval_union(i)

## union
interval_union(i[1:2,], i[1:4,])
 
# map to genome intervals and union again
i.nostrand = as(i,"Genome_intervals")
interval_union(i.nostrand)
 
## intersection with a second object
# print i and j in closed interval notation
close_intervals(i)
close_intervals(j)

# interval_intersection
interval_intersection(i,j)

#interval intersection non-stranded
interval_intersection(i.nostrand, as(j, "Genome_intervals"))

Run the code above in your browser using DataLab