strand-utils {GenomicRanges}R Documentation

Strand utilities

Description

Some useful strand methods.

Usage

## S4 method for signature 'missing'
strand(x)
## S4 method for signature 'character'
strand(x)
## S4 method for signature 'factor'
strand(x)
## S4 method for signature 'integer'
strand(x)
## S4 method for signature 'logical'
strand(x)
## S4 method for signature 'Rle'
strand(x)
## S4 method for signature 'DataTable'
strand(x)
## S4 replacement method for signature 'DataTable'
strand(x) <- value

Arguments

x

The object from which to obtain a strand factor, can be missing.

value

Replacement value for the strand.

Details

If x is missing, returns an empty factor with the standard levels that any strand factor should have: +, -, and *.

If x is a character vector or factor, it is coerced to a factor with the levels listed above.

If x is an integer vector, it is coerced to a factor with the levels listed above. 1 and -1 values in x are mapped to the + and - levels respectively. NAs in x produce NAs in the result.

If x is a logical vector, it is coerced to a factor with the levels listed above. FALSE and TRUE values in x are mapped to the + and - levels respectively. NAs in x produce NAs in the result.

If x is a 'logical'-Rle vector, it is transformed with runValue(x) <- strand(runValue(x)) and returned.

If x inherits from DataTable, the "strand" column is returned as a factor with the levels listed above. If x has no "strand" column, this return value is populated with NAs.

Author(s)

Michael Lawrence

See Also

strand

Examples

strand()
strand(c("+", "-", NA, "*"))
strand(c(-1L, 1L, NA, -1L, NA))
strand(c(FALSE, FALSE, TRUE, NA, TRUE, FALSE))
strand(Rle(c(FALSE, FALSE, TRUE, NA, TRUE, FALSE)))

[Package GenomicRanges version 1.12.1 Index]