strand-utils {GenomicRanges} | R Documentation |
Some useful strand
methods.
## 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
x |
The object from which to obtain a strand factor, can be missing. |
value |
Replacement value for the strand. |
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. 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
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 NA
s.
Michael Lawrence
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)))