Learn R Programming

genomeIntervals (version 1.28.0)

Genome_intervals_stranded-class: Class "Genome\_intervals\_stranded"

Description

A set of genomic intervals with a specified strand.

Arguments

Slots

.Data:
See Genome_intervals
annotation:
A data.frame (see Genome_intervals for basic requirements). The annotation moreover has a strand column that is a factor with exactly two levels(typically "+" and "-").
closed:
See Genome_intervals
type:
See Genome_intervals

Extends

Class "Genome_intervals", directly. Class "Intervals_full", by class "Genome\_intervals", distance 2. Class "Intervals_virtual", by class "Genome\_intervals", distance 3. Class "matrix", by class "Genome\_intervals", distance 4. Class "array", by class "Genome\_intervals", distance 5. Class "structure", by class "Genome\_intervals", distance 6. Class "vector", by class "Genome\_intervals", distance 7, with explicit coerce.

Methods

coerce
signature(from = "Genome_intervals_stranded", to = "character"): ...
distance\_to\_nearest
signature(from = "Genome_intervals_stranded", to = "Genome_intervals_stranded"): ...
interval\_complement
signature(x = "Genome_intervals_stranded"): ...
interval\_intersection
signature(x = "Genome_intervals_stranded"): ...
interval\_overlap
signature(to = "Genome_intervals_stranded", from = "Genome_intervals_stranded"): ...
interval\_union
signature(x = "Genome_intervals_stranded"): ...
strand
signature(x = "Genome_intervals_stranded"): ...
strand<-
signature(x = "Genome_intervals_stranded"): ...

See Also

Genome_intervals the parent class without strand.

Examples

Run this code

# The "Genome_intervals_stranded" class
j <- new(
	 "Genome_intervals_stranded",
	 matrix(
	 	c(1,2,  
	 	  3,5,
	 	  4,6,
	 	  8,9
	 	  ),
	 	byrow = TRUE,
                ncol = 2
	 ),
	 closed = matrix(
	 			c(
	 				FALSE, FALSE,
	 				TRUE, FALSE,
	 				TRUE, TRUE,
	 				TRUE, FALSE
	 			 ),
	 			byrow = TRUE,
     			ncol = 2
     			),
     annotation = data.frame(
     				seq_name = factor( c("chr01","chr01", "chr02","chr02") ),
	 				strand = factor( c("+", "+", "+", "-") ),
	 				inter_base = c(FALSE,FALSE,FALSE,TRUE)
	 				)
	 )

## print
print(j)

## size of each interval as count of included bases 
size(j)

## close intervals left and right (canonical representation)
close_intervals(j)


## simpler way to construct a Genome_intervals_stranded object
GS <- GenomeIntervals(start=c(1,3,4,5,8,10), end=c(5,5,6,8,9,11),
                      chromosome=rep(c("chr2","chrX","chr1"), each=2),
                      strand=c("-","-","+","+","+","+") )
show(GS)

Run the code above in your browser using DataLab