IRangesList-class: List of IRanges and NormalIRanges

Description Constructor Coercion Methods for NormalIRangesList objects Author(s) See Also Examples

Description

IRangesList and NormalIRangesList objects for storing IRanges and NormalIRanges objects respectively.

Constructor

IRangesList(..., compress=TRUE): The ... argument accepts either a comma-separated list of IRanges objects, or a single LogicalList / logical RleList object, or 2 elements named start and end each of them being either a list of integer vectors or an IntegerList object. When IRanges objects are supplied, each of them becomes an element in the new IRangesList, in the same order, which is analogous to the list constructor. If compress, the internal storage of the data is compressed.

Coercion

In the code snippets below, from is a list-like object.

as(from, "SimpleIRangesList"): Coerces from, to a SimpleIRangesList, requiring that all IntegerRanges elements are coerced to internal IRanges elements. This is a convenient way to ensure that all IntegerRanges have been imported into R (and that there is no unwanted overhead when accessing them).

as(from, "CompressedIRangesList"): Coerces from, to a CompressedIRangesList, requiring that all IntegerRanges elements are coerced to internal IRanges elements. This is a convenient way to ensure that all IntegerRanges have been imported into R (and that there is no unwanted overhead when accessing them).

as(from, "SimpleNormalIRangesList"): Coerces from, to a SimpleNormalIRangesList, requiring that all IntegerRanges elements are coerced to internal NormalIRanges elements.

as(from, "CompressedNormalIRangesList"): Coerces from, to a CompressedNormalIRangesList, requiring that all IntegerRanges elements are coerced to internal NormalIRanges elements.

In the code snippet below, x is an IRangesList object.

unlist(x): Unlists x, an IRangesList, by concatenating all of the ranges into a single IRanges instance. If the length of x is zero, an empty IRanges is returned.

Methods for NormalIRangesList objects

max(x): An integer vector containing the maximum values of each of the elements of x.

min(x): An integer vector containing the minimum values of each of the elements of x.

Author(s)

Michael Lawrence and Hervé Pagès

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
range1 <- IRanges(start=c(1,2,3), end=c(5,2,8))
range2 <- IRanges(start=c(15,45,20,1), end=c(15,100,80,5))
named <- IRangesList(one = range1, two = range2)
length(named) # 2
names(named) # "one" and "two"
named[[1]] # range1
unnamed <- IRangesList(range1, range2)
names(unnamed) # NULL

x <- IRangesList(start=list(c(1,2,3), c(15,45,20,1)),
                 end=list(c(5,2,8), c(15,100,80,5)))
as.list(x)

Example output

Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

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

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

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

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

[1] 2
[1] "one" "two"
IRanges object with 3 ranges and 0 metadata columns:
          start       end     width
      <integer> <integer> <integer>
  [1]         1         5         5
  [2]         2         2         1
  [3]         3         8         6
NULL
[[1]]
IRanges object with 3 ranges and 0 metadata columns:
          start       end     width
      <integer> <integer> <integer>
  [1]         1         5         5
  [2]         2         2         1
  [3]         3         8         6

[[2]]
IRanges object with 4 ranges and 0 metadata columns:
          start       end     width
      <integer> <integer> <integer>
  [1]        15        15         1
  [2]        45       100        56
  [3]        20        80        61
  [4]         1         5         5

IRanges documentation built on Dec. 14, 2020, 2 a.m.