strand: Accessing strand information

Description Usage Arguments Details Value See Also Examples

Description

Get or set the strand information contained in an object.

Usage

1
2
3
4
5
6
7
8
strand(x, ...)
strand(x, ...) <- value

unstrand(x)

invertStrand(x)
## S4 method for signature 'ANY'
invertStrand(x)

Arguments

x

An object containing strand information.

...

Additional arguments, for use in specific methods.

value

The strand information to set on x.

Details

All the strand methods defined in the GenomicRanges package use the same set of 3 values (called the "standard strand levels") to specify the strand of a genomic location: +, -, and *. * is used when the exact strand of the location is unknown, or irrelevant, or when the "feature" at that location belongs to both strands.

Note that unstrand is not a generic function, just a convenience wrapper to the generic strand() setter (strand<-) that does:

1
2
  strand(x) <- "*"
  x

The default method for invertStrand does:

1
2
  strand(x) <- invertStrand(strand(x))
  x

Value

If x is a vector-like object, strand(x) will typically return a vector-like object parallel to x, that is, an object of the same length as x where the i-th element describes the strand of the i-th element in x.

unstrand(x) and invertStrand(x) return a copy of x with the strand set to "*" for unstrand or inverted for invertStrand (i.e. "+" and "-" switched, and "*" untouched).

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
strand
showMethods("strand")

`strand<-`
showMethods("strand<-")

unstrand

invertStrand
showMethods("invertStrand")
selectMethod("invertStrand", "ANY")  # the default method

library(GenomicRanges)

showMethods("strand")
selectMethod("strand", "missing")
strand()

showMethods("strand<-")

Example output

Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit, which, which.max, which.min

standardGeneric for "strand" defined from package "BiocGenerics"

function (x, ...) 
standardGeneric("strand")
<environment: 0x3ef7a10>
Methods may be defined for arguments: x
Use  showMethods("strand")  for currently available ones.
Function: strand (package BiocGenerics)
<No methods>

standardGeneric for "strand<-" defined from package "BiocGenerics"

function (x, ..., value) 
standardGeneric("strand<-")
<environment: 0x3f143e8>
Methods may be defined for arguments: x, value
Use  showMethods("strand<-")  for currently available ones.
Function: strand<- (package BiocGenerics)
<No methods>

function (x) 
{
    strand(x) <- "*"
    x
}
<environment: namespace:BiocGenerics>
standardGeneric for "invertStrand" defined from package "BiocGenerics"

function (x) 
standardGeneric("invertStrand")
<environment: 0x3e0a728>
Methods may be defined for arguments: x
Use  showMethods("invertStrand")  for currently available ones.
Function: invertStrand (package BiocGenerics)
x="ANY"

Method Definition:

function (x) 
{
    strand(x) <- invertStrand(strand(x))
    x
}
<environment: namespace:BiocGenerics>

Signatures:
        x    
target  "ANY"
defined "ANY"
Loading required package: stats4
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Function: strand (package BiocGenerics)
x="DataTable"
x="DelegatingGenomicRanges"
x="GNCList"
x="GPos"
x="GRanges"
x="GRangesList"
x="NULL"
x="Rle"
x="RleList"
x="character"
x="factor"
x="integer"
x="logical"
x="missing"

Method Definition:

function (x, ...) 
{
    .local <- function (x) 
    factor(levels = c("+", "-", "*"))
    .local(x, ...)
}
<environment: namespace:GenomicRanges>

Signatures:
        x        
target  "missing"
defined "missing"
factor(0)
Levels: + - *
Function: strand<- (package BiocGenerics)
x="DataTable", value="ANY"
x="GRangesList", value="ANY"
x="GRangesList", value="character"
x="GenomicRanges", value="ANY"

BiocGenerics documentation built on April 17, 2021, 6:01 p.m.