IRanges

IRanges

An IRanges object is a collection of integer ranges, inspired by the class of the same name from the Bioconductor ecosystem. Each range consists of a start position and a width, and may be associated with arbitrary range-level metadata in a DataFrame. The IRanges defines methods for the following generics:

Constructor

new IRanges(start, width, optionsopt)

Source:
Parameters:
Name Type Attributes Default Description
start Array | TypedArray

Array of start positions for each range. This should be coercible into an Int32Array.

width Array | TypedArray

Array of widths for each range. This should be coercible into an Int32Array.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
names Array <optional>
<nullable>
null

Array of strings of length equal to start, containing names for each range. Alternatively null, in which case the ranges are assumed to be unnamed.

elementMetadata DataFrame <optional>
<nullable>
null

A DataFrame with number of rows equal to the length of start, containing arbitrary per-range annotations. Alternatively null, in which case a zero-column DataFrame is automatically constructed.

metadata Object <optional>
{}

Object containing arbitrary metadata as key-value pairs.

Extends

Classes

IRanges

Methods

(static) empty() → {IRanges}

Source:
Returns:

A zero-length IRanges object.

Type
IRanges

$setElementMetadata(elementMetadatanullable) → {Vector}

Source:
Overrides:
Parameters:
Name Type Attributes Description
elementMetadata DataFrame <nullable>

Arbitrary metadata for each vector element. This should have number of rows equal to the vector length. Alternatively null, in which case all existing per-element metadata is removed.

Returns:

A reference to this Vector object after setting the element metadata to value.

Type
Vector

$setMetadata(value) → {Annotated}

Source:
Overrides:
Parameters:
Name Type Description
value Object

Object containing the metadata.

Returns:

A reference to this Annotated object.

Type
Annotated

$setNames(namesnullable) → {Vector}

Source:
Overrides:
Parameters:
Name Type Attributes Description
names Array <nullable>

Array of strings containing a name for each range. This should have length equal to the number of ranges. Alternatively null, if no names are present.

Returns:

A reference to this Vector object after setting the element metadata to value.

Type
Vector

$setStart(value) → {IRanges}

Source:
Parameters:
Name Type Description
value Array | TypedArray

Array of start positions for each range. This should have length equal to the number of ranges and be coercible into an Int32Array.

Returns:

A reference to this IRanges object after setting the start positions to value.

Type
IRanges

$setWidth(value) → {IRanges}

Source:
Parameters:
Name Type Description
value Array | TypedArray

Array of widths for each range. This should have length equal to the number of ranges and be coercible into an Int32Array.

Returns:

A reference to this IRanges object after setting the widths to value.

Type
IRanges

buildOverlapIndex() → {IRangesOverlapIndex}

Source:
Returns:

A pre-built index for computing overlaps with other IRanges instances.

Type
IRangesOverlapIndex

elementMetadata() → {DataFrame}

Source:
Overrides:
Returns:

A DataFrame with one row corresponding to each vector element, containing arbitrary per-element metadata.

Type
DataFrame

end() → {Int32Array}

Source:
Returns:

Array of integers containing the end position (specifically, one-past-the-end) for each range.

Type
Int32Array

metadata() → {Map}

Source:
Overrides:
Returns:

Map containing arbitrary metadata.

Type
Map

names() → (nullable) {Array}

Source:
Overrides:
Returns:

Array of strings containing the name of each range, or null if no names are available.

Type
Array

setElementMetadata(elementMetadatanullable, optionsopt) → {Vector}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
elementMetadata DataFrame <nullable>

Arbitrary metadata for each vector element. This should have number of rows equal to the vector length. Alternatively null, in which case all existing per-element metadata is removed.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this Vector instance in place. If false, a new instance is returned.

Returns:

The Vector object after setting the element metadata to value. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
Vector

setMetadata(value, optionsopt) → {Annotated}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
value Object | Map

Object containing the metadata.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this Annotated instance in place. If false, a new instance is returned.

Returns:

The Annotated object after replacing the metadata. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
Annotated

setNames(namesnullable, optionsopt) → {Vector}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
names Array <nullable>

Array of strings containing a name for each range. This should have length equal to the number of ranges. Alternatively null, if no names are present.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this Vector instance in place. If false, a new instance is returned.

Returns:

The Vector object after setting the names to value. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
Vector

setStart(value, optionsopt) → {IRanges}

Source:
Parameters:
Name Type Attributes Default Description
value Array | TypedArray

Array of start positions for each range. This should have length equal to the number of ranges and be coercible into an Int32Array.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this IRanges instance in place. If false, a new instance is returned.

Returns:

The IRanges object after setting the start positions to value. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
IRanges

setWidth(value, optionsopt) → {IRanges}

Source:
Parameters:
Name Type Attributes Default Description
value Array | TypedArray

Array of widths for each range. This should have length equal to the number of ranges and be coercible into an Int32Array.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this IRanges instance in place. If false, a new instance is returned.

Returns:

The IRanges object after setting the widths to value. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
IRanges

start() → {Int32Array}

Source:
Returns:

Array of integers containing the start position for each range.

Type
Int32Array

width() → {Int32Array}

Source:
Returns:

Array of integers containing the width of each range.

Type
Int32Array