GenoGAMDataSet-subsetting: Subset methods for GenoGAMDataSet

Description Usage Arguments Details Value Author(s) References Examples

Description

Subset methods for GenoGAMDataSet

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S4 method for signature 'GenoGAMDataSet'
subset(x, ...)

## S4 method for signature 'GenoGAMDataSet,GRanges'
subsetByOverlaps(x, ranges,
  maxgap = -1L, minoverlap = 0L, type = c("any", "start", "end",
  "within", "equal"), invert = FALSE, ...)

## S4 method for signature 'GenoGAMDataSet,GRanges,ANY,ANY'
x[i]

Arguments

x

A GenoGAMDataSet object.

...

Further arguments. Mostly a logical statement in case of the 'subset' function. Note that the columnnames for chromosomes and positions are: 'seqnames' and 'pos'.

ranges, i

A GRanges object. In case of subsetting by double brackets 'i' is the index of the tile.

maxgap, minoverlap

Intervals with a separation of 'maxgap' or less and a minimum of 'minoverlap' overlapping positions, allowing for 'maxgap', are considered to be overlapping. 'maxgap' should be a scalar, non-negative, integer. 'minoverlap' should be a scalar, positive integer.

type

By default, any overlap is accepted. By specifying the 'type' parameter, one can select for specific types of overlap. The types correspond to operations in Allen's Interval Algebra (see references in). If type is start or end, the intervals are required to have matching starts or ends, respectively. While this operation seems trivial, the naive implementation using outer would be much less efficient. Specifying equal as the type returns the intersection of the start and end matches. If type is within, the query interval must be wholly contained within the subject interval. Note that all matches must additionally satisfy the minoverlap constraint described above.

The maxgap parameter has special meaning with the special overlap types. For start, end, and equal, it specifies the maximum difference in the starts, ends or both, respectively. For within, it is the maximum amount by which the query may be wider than the subject.

invert

If TRUE, keep only the query ranges that do _not_ overlap the subject.

Details

Those are various methods to subset the GenoGAMDataSet object. By logical statement or GRanges overlap. The '[' subsetter is just a short version of 'subsetByOverlaps'.

Value

A subsetted GenoGAMDataSet object.

Author(s)

Georg Stricker georg.stricker@in.tum.de

References

Allen's Interval Algebra: James F. Allen: Maintaining knowledge about temporal intervals. In: Communications of the ACM. 26/11/1983. ACM Press. S. 832-843, ISSN 0001-0782

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# subset by overlaps
ggd <- makeTestGenoGAMDataSet()
SummarizedExperiment::rowRanges(ggd)
gr <- GenomicRanges::GRanges("chrI", IRanges(10000,19000))
res <- IRanges::subsetByOverlaps(ggd, gr)
SummarizedExperiment::rowRanges(res)

# Subset by logical statement
ggd <- makeTestGenoGAMDataSet()
SummarizedExperiment::rowRanges(ggd)
res <- subset(ggd, seqnames == "chrI" & pos <= 17000)
SummarizedExperiment::rowRanges(res)

gstricker/fastGenoGAM documentation built on May 17, 2019, 8:56 a.m.