Skip to contents

Reverse genomic ranges by flipping the strand and moving the origin of the coordinate system to the opposite side.

Usage

reverse(x, ...)

# S4 method for GRanges
reverse(x, ...)

# S4 method for GBreaks
reverse(x, query = FALSE, ...)

Arguments

x

A GBreaks or a GRanges object

...

Additional arguments (ignored)

query

On GBreaks objects, operate on on the query or the target.

Value

Returns the modified GBreaks or GRanges object.

See also

Author

Charles Plessy

Examples

exampleInsertion
#> GBreaks object with 3 ranges and 1 metadata column:
#>       seqnames    ranges strand |        query
#>          <Rle> <IRanges>  <Rle> |    <GRanges>
#>   [1]     chrA   100-200      + | chrB:100-200
#>   [2]     chrA   201-300      + | chrB:301-400
#>   [3]     chrC   401-500      + | chrB:201-300
#>   -------
#>   seqinfo: 2 sequences from an unspecified genome
reverse(exampleInsertion)
#> GBreaks object with 3 ranges and 1 metadata column:
#>       seqnames    ranges strand |        query
#>          <Rle> <IRanges>  <Rle> |    <GRanges>
#>   [1]     chrA   401-501      - | chrB:100-200
#>   [2]     chrA   301-400      - | chrB:301-400
#>   [3]     chrC   101-200      - | chrB:201-300
#>   -------
#>   seqinfo: 2 sequences from an unspecified genome
reverse(exampleInsertion, query = TRUE)
#> GBreaks object with 3 ranges and 1 metadata column:
#>       seqnames    ranges strand |        query
#>          <Rle> <IRanges>  <Rle> |    <GRanges>
#>   [1]     chrA   100-200      - | chrB:401-501
#>   [2]     chrA   201-300      - | chrB:201-300
#>   [3]     chrC   401-500      - | chrB:301-400
#>   -------
#>   seqinfo: 2 sequences from an unspecified genome