strand {GenomicRanges} | R Documentation |
The strand
generic is meant as an accessor for
strand information. Four methods are defined by the GenomicRanges
package, described below.
strand(x)
x |
The object from which to obtain a strand factor, can be missing. |
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. NA
s in x
produce NA
s
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. NA
s in x
produce NA
s
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 NA
s.
Michael Lawrence
strand() strand(c("+", "-", NA, "*")) strand(c(-1L, 1L, NA, -1L, NA)) strand(c(FALSE, FALSE, TRUE, NA, TRUE, FALSE))