Learn Python and AI for free! One week only. No credit card needed.
Ends in:
"Genome_intervals"
or "Genome_intervals_stranded"
objects.
"interval_union"(x, ...)
"interval_union"(x, ...)
"interval_complement"(x)
"interval_complement"(x)
"interval_intersection"(x,...)
"interval_intersection"(x,...)
"Genome_intervals"
or "Genome_intervals_stranded"
object.x
.seq_name
, inter_base
and
also strand
if all passed objects are of the class "Genome_intervals_stranded"
.
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.
interval_union
,
interval_complement
,
interval_intersection
and
reduce
from the package intervals
.
## 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