calc.maps.sphere {MDSMap} | R Documentation |
Estimate marker positions using spherically constrained weighted MDS
Description
Reads a text file of pairwise recombination fractions and LOD scores, estimates marker positions using spherically constrained weighted MDS
Usage
calc.maps.sphere(fname, p = 100, n = NULL, weightfn = "lod2",
mapfn = "haldane")
Arguments
fname |
Character string specifying the base name of the file fname.txt which contains the data to be analysed. The file should be white space or tab separated. |
p |
Integer - the penalty for deviations from the sphere - higher p forces points more closely onto a sphere. |
n |
Vector of integers or strings containing markers to be omitted from the analysis. |
weightfn |
Character string specifying the values to use for the weight matrix in the MDS 'lod2' or 'lod'. |
mapfn |
Character string specifying the map function to use on the recombination fractions 'haldane' is default, 'kosambi' or 'none'. |
Details
This can be very slow with large sets of markers, in which case it may be
better to consider calc.maps.pc
.
Reads a file of the form described below and casts the data into matrices of
pairwise recombination fractions and weights determined by the weightfn
parameter (LOD
or LOD^2^
) calculates a distance matrix from the map
function. Haldane is the default map function, None just uses recombination
fractions and the other alternative is Kosambi (see link{dmap}
for details).
Performs both an unconstrained and dual spherically constrained weighted MDS
on the distance matrix using smacofSym
and
smacofSphere
(de Leeuw & Mair 2009)
and maps this to an interval (see map.to.interval
for details).
Inevitably the constrained MDS has higher stress than the unconstrained MDS and a good rule of thumb is that this should not be more than about 10
File names should be of the form fname.txt
and it is assumed that they are in
a tab or space separated file of the format displayed below. The first entry on
the first row is the number of markers to be analysed. Underneath this is a
table in which the first two columns contain marker names, the third column
contains the pairwise recombination fractions between the markers and the
fourth column the associated LOD score. Note that marker names in the first
column vary more slowly than in the second column. Missing recombination pairs
are acceptable. Recombination fractions greater than 0.499999 are set to that
value.
nmarkers | |||
marker_1 | marker_2 | recombination fraction | LOD |
1 | 2 | . | . |
1 | 3 | . | . |
1 | 4 | . | . |
. | . | . | . |
. | . | . | . |
. | . | . | . |
2 | 3 | . | . |
2 | 4 | . | . |
. | . | . | . |
Value
A list (S3 class 'spheremap') with the following elements:
smacofsym |
The unconstrained wMDS results. |
smacofsphere |
The spherically constrained wMDS results. |
mapsphere |
Map of the markers onto an interval containing order-the rank of each marker. |
distmap |
A symmetric matrix of pairwise distances between markers where the columns are in the estimated order. |
lodmap |
A symmetric matrix of lod scores associated with the distances in distmap. |
locimap |
A data frame of the markers containing the name of each marker, the number in the configuration plot if that is being used, the position of each marker in order of increasing distance and the nearest neighbour fit of the marker. |
length |
Integer giving the total length of the segment. |
removed |
A vector of the names of markers removed from the analysis. |
locikey |
A data frame showing the number associated with each marker name for interpreting the wMDS configuration plots. |
stressratio |
The ratio of the constrained to unconstrained stress. |
ssphere |
The stress per point of the spherically constrained wMDS. |
ssym |
Stress per point of the unconstrained wMDS. |
meannnfit |
The mean across all markers of the nearest neighbour fits. |
References
de Leeuw J, Mair P (2009) Multidimensional scaling using majorization: SMACOF in R. J Stat Softw 31: 1-30 http://www.jstatsoft.org/v31/i03/
See Also
calc.maps.pc
, calc.pair.rf.lod
, smacofSym
, smacofSphere
, map.to.interval
, dmap
, calc.nnfit
Examples
smap<-calc.maps.sphere(system.file("extdata", "lgI.txt", package="MDSMap"),
weightfn='lod',mapfn='kosambi')