This function carries out re-ordering of one single window according to user defined criteria. The best order is chosen based on the difference in log likelihood. Different heuristics are avaible to select which orders to test. Note that testing all orders has factorial complexity (N!/2) meaning that it's not feasible for window sizes larger than 6.
ripple.window(input.seq, ws = 4, tol = 0.001, phase.cores = 1,
ripple.cores = 1, start = 1, verbosity = NULL, type = "one",
n = NULL, pref = NULL, no_reverse = TRUE, optimize = "likelihood")An object of class sequence.
The window size in which ti consider re-ordering
The tolerance for checking convergence of the EM model
The number of parallel processes to use to estimate phases. Should be no higher than 4.
The number of parallel processes that should be used when testing different marker orders.
The position of the first marker of the window within the input sequence
A character vector that includes any or all of "batch", "order", "position", "time" and "phase" to output progress status information.
One of "one", "all" or "rand".
For method "rand": The number of random samples to be tested.
For method "rand": One of "similar", "dissimilar" or "neutral". Controls if sampling probability should be adjusted based on similarity to the input sequence. See description.
For method "one": If FALSE, the method will also
create all possible reverse sequences if the marker swaps.
Either "likelihood" or "count". Passed to ripple.ord
in order to optimize the map's likelihood or the RECORD COUNT criterion.
Unless you are absolutely sure why, you should use "likelihood".
An object of class sequence that is the best order for the
re-ordered window within the input sequence.
Methods:
all:Checks for all possible permutations in the window. Will be very
very slow for large window size.
one:Checks for all possible pairwise switches in the window. The
complexity scales as sum(ws:1), ws being the window size.
rand:First, generates all possible permutations. Then samples
n sequences from those and tests those. Time complexity is N.
The "rand" method can be further tuned to preferentially select similar, dissimilar sequences or to perform unbiased sampling. In the first two cases sampling probability is adjusted via a spearman correlation of the sequences to all possible sequences.