interval_overlap-methods: Assess overlap from one set of genomic intervals to another

Description Usage Arguments Details Value Examples

Description

Given two objects, a 'from' and a 'to', assess which intervals in 'to' overlap which of 'from'.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S4 method for signature 'Genome_intervals,Genome_intervals'
interval_overlap(
                 from, to,
                 check_valid = TRUE
                 )
## S4 method for signature 
## 'Genome_intervals_stranded,Genome_intervals_stranded'
interval_overlap(
                 from, to,
                 check_valid = TRUE
                 )

Arguments

from

A Genome_intervals or Genome_intervals_stranded object.

to

A Genome_intervals or Genome_intervals_stranded object.

check\_valid

Should validObject be called before passing to compiled code?

Details

A wrapper calling intervals:interval_overlap by seq_name and by strand (if both to and from are "Genome_intervals_stranded" objects).

Value

A list, with one element for each row of from. The elements are vectors of indices, indicating which to rows overlap each from. A list element of length 0 indicates a from with no overlapping to intervals.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(gen_ints)	 
# i as entered
i

# i in close_intervals notation
close_intervals(i)
 
# j in close_intervals notation
close_intervals(j)
 
# list of intervals of j overlapping intervals of i
interval_overlap(i,j)
	 

Example output

Loading required package: intervals
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:intervals:

    type, type<-

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Object of class Genome_intervals_stranded
7 base intervals and 0 inter-base intervals(*):
i.gene.1 chr01 + [1, 2] 
i.gene.2 chr01 + (2, 5) 
i.gene.3 chr02 - [11, 12) 
i.gene.4 chr02 - [8, 9) 
i.gene.5 chr02 - [5, 10] 
i.gene.6 chr02 + [4, 12] 
i.gene.7 chr03 + [2, 6) 

annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr02      FALSE      -
4    chr02      FALSE      -
5    chr02      FALSE      -
6    chr02      FALSE      +
7    chr03      FALSE      +
Object of class Genome_intervals_stranded
7 base intervals and 0 inter-base intervals(*):
i.gene.1 chr01 + [1, 2] 
i.gene.2 chr01 + [3, 4] 
i.gene.3 chr02 - [11, 11] 
i.gene.4 chr02 - [8, 8] 
i.gene.5 chr02 - [5, 10] 
i.gene.6 chr02 + [4, 12] 
i.gene.7 chr03 + [2, 5] 

annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr02      FALSE      -
4    chr02      FALSE      -
5    chr02      FALSE      -
6    chr02      FALSE      +
7    chr03      FALSE      +
Object of class Genome_intervals_stranded
5 base intervals and 0 inter-base intervals(*):
j.gene.1 chr01 + [1, 1] 
j.gene.2 chr01 + [6, 10] 
j.gene.3 chr01 - [4, 5] 
j.gene.4 chr02 + [12, 15] 
j.gene.5 chr02 - [8, 8] 

annotation:
  seq_name inter_base strand
1    chr01      FALSE      +
2    chr01      FALSE      +
3    chr01      FALSE      -
4    chr02      FALSE      +
5    chr02      FALSE      -
[[1]]
[1] 1

[[2]]
integer(0)

[[3]]
integer(0)

[[4]]
[1] 5

[[5]]
[1] 5

[[6]]
[1] 4

[[7]]
integer(0)

genomeIntervals documentation built on Nov. 8, 2020, 4:56 p.m.