Genome_intervals-class: Class "Genome\_intervals"

Description Slots Extends Methods Note See Also Examples

Description

A set of genomic intervals without specified strand. Genomic intervals are intervals over the integers with two further annotations: seqnames (a chromosome or more generally a sequence of origin) and inter_base (logical) that states whether the interval is to be understood as an interval over bases (such as coding-sequence) or inter-bases (such as restriction sites or insertion positions).

Slots

.Data:

See Intervals_full

annotation:

A "data.frame" with the same number of rows as .Data. It has a column named seq_name that is a factor and does not contain missing values. seq_name is used to represent the chromosome or more generally the sequence of origin of the intervals. annotation has a column named inter_base that is logical and does not contain missing values. inter_base is FALSE if the interval is to be understood as an interval over bases (such as coding-sequence) and TRUE if it is over inter-bases (such as restriction site or an insertion position). Like base intervals, inter-base interval are encoded over the integers. An inter-base at position n indicates the space between base n and n+1.

closed:

See Intervals_full

type:

See Intervals_full

Extends

Class "Intervals_full", directly. Class "Intervals_virtual", by class "Intervals\_full", distance 2. Class "matrix", by class "Intervals\_full", distance 3. Class "array", by class "Intervals\_full", distance 4. Class "structure", by class "Intervals\_full", distance 5. Class "vector", by class "Intervals\_full", distance 6, with explicit coerce.

Methods

[

signature(x = "Genome_intervals"): ...

[[

signature(x = "Genome_intervals"): ...

[[<-

signature(x = "Genome_intervals"): ...

\$

signature(x = "Genome_intervals"): ...

\$<-

signature(x = "Genome_intervals"): ...

annotation

signature(object = "Genome_intervals"): ...

annotation<-

signature(object = "Genome_intervals"): ...

coerce

signature(from = "Genome_intervals", to = "Intervals_full"): ...

coerce

signature(from = "Genome_intervals", to = "character"): ...

coerce

signature(from = "Genome_intervals", to = "data.frame"): ...

distance\_to\_nearest

signature(from = "Genome_intervals", to = "Genome_intervals"): ...

inter\_base

signature(x = "Genome_intervals"): ...

inter\_base<-

signature(x = "Genome_intervals"): ...

interval\_complement

signature(x = "Genome_intervals"): ...

interval\_intersection

signature(x = "Genome_intervals"): ...

interval\_overlap

signature(from = "Genome_intervals", to = "Genome_intervals"): ...

interval\_union

signature(x = "Genome_intervals"): ...

seqnames

signature(x = "Genome_intervals"): ...

seqnames<-

signature(x = "Genome_intervals"): ...

size

signature(x = "Genome_intervals"): ...

type<-

signature(x = "Genome_intervals"): ...

which\_nearest

For each interval in Set1, finds nearest (least distant) interval in Set2. Intervals on different chromsomes are never considered 'near' to each other. The returned value is a data.frame with the number of rows equal to the number of intervals in Set1. Each row specifies the distance to the nearest interval in Set2 (a 0 means that the interval overlaps one or more intervals in Set2), and the indices of near and overlapping intervals in Set2. See Intervals_full for further details.

width

Returns the interval length as the number of bp covered (base interval) or spanned(inter-base interval). Similar to the IRanges package width

function.

Note

A Genome_intervals is a "Intervals_full" of type Z (i.e. a set of intervals over the integers). The annotation slot can carry further columns that can serve as annotations.

See Also

Genome_intervals_stranded for a derived class that allows stranded genomic intervals.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# The "Genome_intervals" class

i <- new(
	 "Genome_intervals",
	 matrix(
	 	c(1,2,
	 	  3,5,
	 	  4,6,
	 	  8,9
	 	  ),
	 	byrow = TRUE,
                ncol = 2
	 ),
	 closed = matrix(
	 			c(
	 				TRUE, FALSE,
	 				TRUE, FALSE,
	 				TRUE, TRUE,
	 				TRUE, FALSE
	 			 ),
	 			byrow = TRUE,
     			ncol = 2
     			),
	 annotation = data.frame(
	 				seq_name = factor(c("chr01","chr01", "chr02","chr02")),
	 				inter_base = c(FALSE, FALSE, TRUE, TRUE)
	 				)
	 )

colnames(i) <- c( "start", "end" )

# print
print(i)

# size (number of bases per interval)
size(i)

## convert to a data.frame
as(i,"data.frame")

## simpler way to construct a Genome_intervals object:
G <- GenomeIntervals(start=c(1,3,4,5,10,8), end=c(5,5,6,8,11,9),
                     chromosome=rep(c("chr2","chrX","chr1"), each=2),
                     leftOpen=rep(c(FALSE, FALSE, TRUE), 2))
show(G)

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