See ?`GenomicRanges-comparison` in the
GenomicRanges package for a description of these arguments.
ignore.strand
Whether or not the strand should be ignored when comparing 2 genomic
tuples.
...
One or more GTuples objects. The GTuples objects after the
first one are used to break ties
na.last
Ignored.
decreasing
TRUE or FALSE.
ties.method
A character string specifying how ties are treated. Only "first"
is supported for now.
by
An optional formula that is resolved against as.env(x);
the resulting variables are passed to order to generate the
ordering permutation.
na.rm
logical. Should missing values be removed before checking? WARNING: This
currently has no effect and is ignored.
strictly
logical indicating if the check should be for strictly increasing
values.
Details
Two elements of a GTuples object (i.e. two genomic tuples) are
considered equal iff they are on the same underlying sequence and strand,
and have the same positions (tuples). duplicated() and
unique() on a GTuples object are conforming to this.
The "natural order" for the elements of a GTuples object is to
order them (a) first by sequence level, (b) then by strand, (c) then by
pos_{1}, …, pos_{m}.
This way, the space of genomic tuples is totally ordered.
order(), sort(), is.unsorted(), and rank() on a
GTuples object are using this "natural order".
Also ==, !=, <=, >=, < and >
on GTuples objects are using this "natural order".
pcompare(x, y):
Performs "generalized range-wise comparison" of x and y,
that is, returns an integer vector where the i-th element is a code
describing how the i-th element in x is qualitatively positioned
relatively to the i-th element in y.
A code that is < 0, = 0, or > 0, corresponds to
x[i] < y[i], x[i] == y[i], or x[i] > y[i],
respectively.
WARNING: These predefined codes are not as detailed as those for
Ranges-comparison. Specifically, only the sign of
the code matters, not the actual value.
match(x, table, nomatch = NA_integer_):
Returns an integer vector of the length of x,
containing the index of the first matching range in table
(or nomatch if there is no matching range) for each tuple
in x.
duplicated(x, fromLast = FALSE, method = c("hash", "base")):
Determines which elements of x are equal to elements
with smaller subscripts, and returns a logical vector indicating
which elements are duplicates.
See duplicated in the base package for more
details.
unique(x, fromLast = FALSE, method = c("hash", "base")):
Removes duplicate tuples from x.
See unique in the base package for more
details.
x %in% table:
A shortcut for finding the ranges in x that match any of
the tuples in table. Returns a logical vector of length
equal to the number of tuples in x.
findMatches(x, table):
An enhanced version of match that returns all the matches
in a Hits object.
countMatches(x, table):
Returns an integer vector of the length of x containing the
number of matches in table for each element in x.
order(...):
Returns a permutation which rearranges its first argument (a
GTuples object) into ascending order, breaking ties by
further arguments.
See order in the BiocGenerics package
for more information.
sort(x):
Sorts x.
See sort in the base package for more details.
rank(x, na.last = TRUE, ties.method = c("average", "first",
"random", "max", "min")):
Returns the sample ranks of the tuples in x.
See rank in the base package for more details.
Value
For pcompare: see Details section above.
For selfmatch: an integer vector of the same length as x.
For duplicated, unique, and %in%: see
?BiocGenerics::duplicated,
?BiocGenerics::unique,
and ?`%in%`.
For findMatches: a Hits object by default (i.e. if
select="all").
For countMatches: an integer vector of the length of x
containing the number of matches in table for each element
in x.
For sort: see ?BiocGenerics::sort.
Author(s)
Peter Hickey
See Also
The GTuples class.
GenomicRanges-comparison in the GRanges
package for comparing and ordering genomic ranges.
intra-tuple-methods for intra-tuple transformations.
findOverlaps-methods for finding
overlapping genomic ranges.