strand {GenomicRanges}R Documentation

Accessing strand information

Description

The strand generic is meant as an accessor for strand information. Four methods are defined by the GenomicRanges package, described below.

Usage

strand(x)

Arguments

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

Details

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

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 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

Examples

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

[Package GenomicRanges version 1.0.7 Index]