[adegenet-forum] seqTrack max(prot
Jombart, Thibaut
t.jombart at imperial.ac.uk
Fri Feb 17 14:34:14 CET 2012
Hello
Actually no, as prox.mat is a proximity matrix. So the code is looking, amongst the possible ancestors, for the one with the largest proximity.
>From the documentation of seqTrack:
"
prox.mat: an optional matrix of proximities between
haplotypes/genotypes used to resolve ties in the choice of
ancestors, by picking up the 'closest' ancestor amongst
possible ancestors, in the sense of ‘prox.mat’.
‘prox.mat[i,j]’ must indicate a proximity for the
relationship 'i ancestor to j'. For instance, if ‘prox.mat’
contains spatial proximities, then ‘prox.mat[i,j]’ gives a
measure of how easy it is to migrate from location 'i' to
'j'.
"
As for the threshold, values less than 1e-12 can usually be considered as zero. The only way it could be a problem is if distances between, say, bacteria in a petri dish were expressed in millions of km.
Cheers
Thibaut
--
######################################
Dr Thibaut JOMBART
MRC Centre for Outbreak Analysis and Modelling
Department of Infectious Disease Epidemiology
Imperial College - School of Public Health
St Mary’s Campus
Norfolk Place
London W2 1PG
United Kingdom
Tel. : 0044 (0)20 7594 3658
t.jombart at imperial.ac.uk
http://sites.google.com/site/thibautjombart/
http://adegenet.r-forge.r-project.org/
________________________________________
From: adegenet-forum-bounces at r-forge.wu-wien.ac.at [adegenet-forum-bounces at r-forge.wu-wien.ac.at] on behalf of Joseph Hughes [hughes.joseph at gmail.com]
Sent: 16 February 2012 14:16
To: adegenet-forum at r-forge.wu-wien.ac.at
Subject: [adegenet-forum] seqTrack max(prot
Dear all,
I am trying to understanding how seqTrack uses the proximity matrix in the code and I am a bit confused about the following section (line 106 in seqTrack.R):
## Choose the most connected ancestor, given prox.mat
if(!is.null(prox.mat)){ # if we've got no other info
toKeep <- test.equal(max(prox.mat[ances,idx]), prox.mat[ances,idx])
ances <- ances[toKeep]
}
It seems to me that the ancestor that has the maximum distance to the progenitor, is being kept. Is this correct?
Also how was the threshold in the following chosen and how would this influence a study looking at spread over very short distance:
## AUXILIARY FUNCTIONS ##
## test equality in floats
test.equal <- function(val,vec){
return(abs(val-vec) < 1e-12)
}
Kind regards,
Joseph Hughes
More information about the adegenet-forum
mailing list