Description Usage Arguments Details Value Examples
tspOrder
Apply a traveling salesperson problem solver to find the
shortest path through the recombination fraction matrix. Requires that
the TSP R package and the TSP solver "Concorde" program are installed. See details.
1 |
cross |
The QTL cross object. |
concorde_path |
Required. The directory containing concorde executables. |
return |
If "cross" is specified, pass the marker order through newLG, which quickly reorders the markers of the original cross to follow the TSP order. Otherwise, return a named list of markers in order for each chromosome. |
... |
Additional arguments passed on to solve_TSP that are then paseed to TSP::contol. |
This function relies on the TSP R packages to perform the TSP solvers. See documentation therein, esspecially the function TSP::solve_TSP. We permit inference of marker order within a Hamiltonian circuit by adding a dummy node that has 0 distance to all other nodes. This allows for discrete start and end points and is more appropriate for genetic map construction than forcing a complete route through all markers.
To install the concorde program: http://www.math.uwaterloo.ca/tsp/concorde/downloads/codes/src/co031219.tgz. If on a mac, this is not super easy. See https://qmha.wordpress.com/2015/08/20/installing-concorde-on-mac-os-x/ for details on the best way to do this.
Either a cross object with reordered markers, or a named list of markers in a new order.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
library(qtlTools)
set.seed(42)
map<-sim.map(len = 200, n.mar = 200, include.x = F, eq.spacing=T)
cross<-sim.cross(map, type = "riself", map.function = "kosambi", error.prob = 0)
cross<-est.rf(cross)
markerlist<-lapply(chrnames(cross), function(x) sample(markernames(cross, chr =x)))
names(markerlist)<-as.character(chrnames(cross))
cross.rand<-newLG(cross, markerList = markerlist)
set.seed(42)
cross.ord<-tspOrder(cross = cross.rand,
max.rf = .5,
concorde_path = "/Users/John/Documents/concorde/TSP")
plot(match(markernames(cross), markernames(cross.ord)),
xlab = "position in similated map", ylab = "position in ordered map")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.