Skip to contents

Produce a new object in which the information about the target and query genomes have been inverted. As a large number of GenomicBreaks functions require GBreaks objects that were sorted with strand information ignored, a sort option is provided to do that.

Usage

swap(gb, sort = FALSE)

Arguments

gb

A GBreaks object.

sort

Sort the returned object, ignoring strand.

Value

A new GBreaks object representing the input's query ranges, with the input's target ranges in the query slot. The strand information is unchanged.

Examples

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