syncRangesDir: Synchronize orientation of genomic ranges given the desired...

View source: R/syncRangesDir.R

syncRangesDirR Documentation

Synchronize orientation of genomic ranges given the desired majority direction.

Description

This function takes a set of ranges in GRanges-class or GRangesList-class object and return the same ranges in same class object such that total length of plus (direct, '+') and minus (minus, '-') . oriented ranges meet the user defined 'majority.strand' orientation.

Usage

syncRangesDir(ranges, majority.strand = "+", strand.only = FALSE)

Arguments

ranges

A GRanges object.

majority.strand

A desired majority strand directionality to be reported.

strand.only

If set to TRUE simple character string of strand directionality ('+', '-') is reported.

Value

A GRanges-class or GRangesList-class object.

Author(s)

David Porubsky

Examples

## Define test genomic ranges to synchronize directionality ##
test.gr <- GenomicRanges::GRanges(seqnames = 'test',
ranges = IRanges::IRanges(start = c(1, 200, 300),
                          end  = c(200, 300, 500)), strand = c('-', '+', '-')
                          )
syncRangesDir(ranges = test.gr, majority.strand = "+")


daewoooo/SVbyEye documentation built on March 31, 2024, 8:58 a.m.