crossOverCheck: Remove values/positions which are overlapping between discrete groups based
on their frequency.
Description
Given a group of discrete factors (i.e. position ids) and integer values,
the function tests if they overlap between groups. If overlap is found,
then the group having highest frequency of a given position wins, else the
position is filtered out from all the groups. The main use of this function
is to remove crossover sites from different samples in the data.
a vector of groupings for the value parameter (i.e. Chr,strand).
Required if psl.rd parameter is not defined.
value
a vector of integer locations/positions that needs to be binned,
i.e. genomic location. Required if psl.rd parameter is not defined.
grouping
additional vector of grouping of length posID or psl.rd by
which to pool the rows (i.e. samplenames). Default is NULL.
weight
a numeric vector of weights to use when calculating frequency
of value by posID and grouping if specified. Default is NULL.
windowSize
size of window within which values should be checked.
Default is 1.
psl.rd
a GRanges object. Default is NULL.
Value
a data frame of the original input with columns denoting whether a
given row was a Candidate and isCrossover. If psl.rd parameter is defined,
then a GRanges object with 'isCrossover', 'Candidate', and 'FoundIn' columns
appended at the end.