gr.findoverlaps: Wrapper to 'GenomicRanges::findOverlaps' with added...

gr.findoverlapsR Documentation

Wrapper to GenomicRanges::findOverlaps with added functionality

Description

Wrapper to GenomicRanges::findOverlaps with added functionality

Returns GRanges of matches with two additional fields:

  • $query.id - index of matching query

  • $subject.id - index of matching subject

Optional "by" field is a character scalar that specifies a metadata column present in both query and subject that will be used to additionally restrict matches, i.e. to pairs of ranges that overlap and also have the same values of their "by" fields

Usage

gr.findoverlaps(
  query,
  subject,
  ignore.strand = TRUE,
  first = FALSE,
  qcol = NULL,
  scol = NULL,
  type = "any",
  by = NULL,
  return.type = "same",
  max.chunk = 1e+13,
  verbose = FALSE,
  mc.cores = 1,
  maxgap = -1L,
  ...
)

Arguments

query

Query GRanges pile

subject

Subject GRanges pile

ignore.strand

boolean Strand ignored (default = TRUE)

first

boolean Flag if TRUE restricts to only the first match of the subject. If FALSE will return all matches. (default = FALSE)

qcol

character vector of query meta-data columns to add to results (default = NULL)

scol

character vector of subject meta-data columns to add to results (default = NULL)

type

type argument as defined by IRanges::findOverlaps ("any", "start", "end", "within", "equal"). (default = 'any')

by

vector Meta-data column to consider when performing overlaps (default = NULL)

return.type

character Select data format to return (supplied as character): "same", "data.table", "GRanges". (default = 'same')

max.chunk

integer Maximum number of query*subject ranges to consider at once. Lower number increases runtime but decreased memory. If length(query)*length(subject) is less than max.chunk, overlaps will run in one batch. (default = 1e3)

verbose

boolean Flag to increase the verbosity. (default = FALSE)

mc.cores

Number of cores to use when running in chunked mode (default = 1)

...

Additional arguments sent to IRanges::findOverlaps.

Value

GRanges pile of the intersection regions, with query.id and subject.id marking sources


mskilab/gUtils documentation built on June 6, 2023, 12:08 a.m.