Methods
CLONE(x, optionsopt) → {*}
- Source:
Clone a vector-like object.
For TypedArrays, this just uses slice()
.
For Arrays, this creates a copy and runs CLONE
on each element in the copy.
Custom classes should provide a _bioconductor_CLONE
method to define the cloning operation.
This method should accept the same arguments as COMBINE
except for x
.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
x |
* | Some vector-like object. |
||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
A clone of x
, i.e., the return value and x
should not compare equal.
If deepCopy=true
, all internal components are also cloned.
- Type
- *
COMBINE(objects) → {*}
- Source:
Combine multiple vector-like objects.
For Array and TypedArrays, the combined array is of a class that avoids information loss.
Custom classes should provide a _bioconductor_COMBINE
method to define the combining operation.
This method should accept the same arguments as COMBINE
.
Parameters:
Name | Type | Description |
---|---|---|
objects |
Array | Array of vector-like objects to be combined.
It is assumed that the objects are of the same class, or at least compatible with each other -
for custom classes, the definition of "compatibility" depends on the |
Returns:
A vector-like object containing the concatenated data from the input objects.
- If the first entry of
objects
is an instance of a custom class, the return value should be of the same class. - If all
objects
are TypedArrays of the same class, the return value will be a TypedArray of that class. - If any of the
objects
are Arrays, the return value will be an Array. - If any of the
objects
are 64-bit TypedArrays of different classes, the return value will be an Array. - Otherwise, for any other classes of TypedArrays in
objects
, the return value will be a Float64Array.
- Type
- *
COMBINE_COLUMNS(objects) → {*}
- Source:
Combine multiple two-dimensional objects by column.
Custom classes should provide a _bioconductor_COMBINE_COLUMNS
method to define the combining operation.
This method should accept:
- an "empty" instance of the class of the first object, to be populated with data.
- an array of objects to be combined, like
objects
.
Parameters:
Name | Type | Description |
---|---|---|
objects |
Array | Array of two-dimensional objects to be combined by column.
It is assumed that the objects are of the same class, or at least compatible with each other -
for custom classes, the definition of "compatibility" depends on the |
Returns:
A two-dimensional object containing the column-wise concatenated data from the input objects, typically of the same class as the first entry of objects
.
- Type
- *
COMBINE_ROWS(objects) → {*}
- Source:
Combine multiple two-dimensional objects by row.
Custom classes should provide a _bioconductor_COMBINE_ROWS
method to define the combining operation.
This method should accept:
- an "empty" instance of the class of the first object, to be populated with data.
- an array of objects to be combined, like
objects
.
Parameters:
Name | Type | Description |
---|---|---|
objects |
Array | Array of two-dimensional objects to be combined by row.
It is assumed that the objects are of the same class, or at least compatible with each other -
for custom classes, the definition of "compatibility" depends on the |
Returns:
A two-dimensional object containing the row-wise concatenated data from the input objects, typically of the same class as the first entry of objects
.
- Type
- *
flexibleCombineRows(objects) → {DataFrame}
- Source:
Flexibly combine multiple DataFrames by row by filling in missing columns with an array of null
s.
This is equivalent to calling COMBINE
on an array of DataFrames that may have mismatching columns.
Parameters:
Name | Type | Description |
---|---|---|
objects |
Array | Array of DataFrames to be combined. |
Returns:
The combined DataFrame, where the number of rows is equal to sum of rows across objects
,
and the columns is equal to the union of columns across objects
.
- Type
- DataFrame
LENGTH(x) → {number}
- Source:
Compute the length of a vector-like object.
For Array and TypedArrays, this just returns the length
property directly.
Custom classes should provide a _bioconductor_LENGTH
method to describe their length.
This method should accept no arguments.
Parameters:
Name | Type | Description |
---|---|---|
x |
* | Some vector-like object. |
Returns:
Length of the object.
- Type
- number
NUMBER_OF_COLUMNS(x) → {number}
- Source:
Return the number of columns for a two-dimensional object.
Custom classes should provide a _bioconductor_NUMBER_OF_COLUMNS
method, accepting no arguments.
Parameters:
Name | Type | Description |
---|---|---|
x |
* | Some two-dimensional object. |
Returns:
Number of columns.
- Type
- number
NUMBER_OF_ROWS(x) → {number}
- Source:
Return the number of rows for a two-dimensional object.
Custom classes should provide a _bioconductor_NUMBER_OF_ROWS
method, accepting no arguments.
Parameters:
Name | Type | Description |
---|---|---|
x |
* | Some two-dimensional object. |
Returns:
Number of rows.
- Type
- number
presplitFactor(factor) → {Object}
- Source:
Given a factor, return the indices corresponding to each level.
This can be used in subsequent splitRows
calls.
Parameters:
Name | Type | Description |
---|---|---|
factor |
Array | TypedArray | Array containing the factor of interest. |
Returns:
Object where each key is a factor level and each value is an array containing the indices corresponding to that level in factor
.
- Type
- Object
SLICE(x, i, optionsopt) → {*}
- Source:
Slice a vector-like object.
For Array and TypedArrays, this just uses slice()
or subarray()
.
Custom classes should provide a _bioconductor_SLICE
method to create a slice.
This method should accept the same arguments as SLICE
except for x
.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
x |
* | Some vector-like object. |
||||||||||||
i |
Object | Array | TypedArray | An Array or TypedArray of integer indices specifying the slice of Alternatively, an object containing |
||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
A vector-like object, typically of the same class as x
, containing data for the specified slice.
If allowInPlace = true
, x
may be modified in place, and the return value may be a reference to x
.
- Type
- *
SLICE_2D(x, rowsnullable, columnsnullable, optionsopt) → {*}
- Source:
Slice a two-dimensional object by its rows and/or columns.
Custom classes should provide a _bioconductor_SLICE_2D
method, accepting the same arguments as this generic but with x
replaced by an "empty" instance of the same class.
Each method should then fill the empty instance with the sliced contents of x
.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
x |
* | Some two-dimensional object. |
||||||||||||
rows |
Object | Array | TypedArray |
<nullable> |
An Array or TypedArray of integer indices specifying the row-wise slice of Alternatively, an object containing Alternatively |
|||||||||||
columns |
Object | Array | TypedArray |
<nullable> |
An Array or TypedArray of integer indices specifying the column-wise slice of Alternatively, an object containing Alternatively |
|||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
A two-dimensional object, typically of the same class as x
, containing data for the specified slice.
- Type
- *
SPLIT(x, factor) → {Object}
- Source:
Split a vector-like object along its length according to the levels of a factor of the same length.
This works automatically for all classes for which there is a SLICE
method,
but custom classes may also choose to define their own _bioconductor_SPLIT
method.
Parameters:
Name | Type | Description |
---|---|---|
x |
* | Some vector-like object. |
factor |
Array | TypedArray | Array containing the factor to use for splitting.
This should have the same length as Alternatively, the output of |
Returns:
An object containing one key per level of factor
,
where the value is the slice of x
corresponding to the indices of that level in factor
.
- Type
- Object
which(x, optionsopt) → {Array}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
x |
Array | TypedArray | Array of values to be interpreted as truthy or falsey. |
||||||||||||
options |
Object |
<optional> |
{}
|
Optional parameters. Properties
|
Returns:
Array of indices of the entries of x
that are truthy (if not=false
) or falsey (if not=true
).
This array is guaranteed to be sorted in ascending order.
- Type
- Array